http://twitter.com/share?text=<TITLE>&url=<URL>
E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com
http://www.facebook.com/sharer.php?u=&p[title]=
| /** | |
| * Detects if two elements are colliding | |
| * | |
| * Credit goes to BC on Stack Overflow, cleaned up a little bit | |
| * | |
| * @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery | |
| * @param $div1 | |
| * @param $div2 | |
| * @returns {boolean} | |
| */ |
| <?php | |
| /** | |
| * Check if an array is a multidimensional array. | |
| * | |
| * @param array $arr The array to check | |
| * @return boolean Whether the the array is a multidimensional array or not | |
| */ | |
| function is_multi_array( $x ) { | |
| if( count( array_filter( $x,'is_array' ) ) > 0 ) return true; | |
| return false; |
| <?php | |
| $url = 'http://server.com/path'; | |
| $data = array('key1' => 'value1', 'key2' => 'value2'); | |
| // use key 'http' even if you send the request to https://... | |
| $options = array( | |
| 'http' => array( | |
| 'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
| 'method' => 'POST', | |
| 'content' => http_build_query($data), |
| /** | |
| * Custom WP gallery | |
| */ | |
| add_shortcode('gallery', 'my_gallery_shortcode'); | |
| function my_gallery_shortcode($attr) { | |
| $post = get_post(); | |
| static $instance = 0; | |
| $instance++; |