Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: add_ping

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
3002  * @return int How many rows were updated.
3003  */
3004 function add_ping($post_id, $uri) {
3005      global $wpdb;
3006      $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
3007      $pung = trim($pung);
3008      $pung = preg_split('/\s/', $pung);
3009      $pung[] = $uri;
3010      $new = implode("\n", $pung);
3011      $new = apply_filters('add_ping', $new);
3012      // expected_slashed ($new)
3013      $new = stripslashes($new);
3014      return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
3015 }
3016
3017 /**
3018  * Retrieve enclosures already enclosed for a post.
3019  *
3020  * @since 1.5.0