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
3329  * @return int How many rows were updated.
3330  */
3331 function add_ping($post_id, $uri) {
3332      global $wpdb;
3333      $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
3334      $pung = trim($pung);
3335      $pung = preg_split('/\s/', $pung);
3336      $pung[] = $uri;
3337      $new = implode("\n", $pung);
3338      $new = apply_filters('add_ping', $new);
3339      // expected_slashed ($new)
3340      $new = wp_unslash($new);
3341      return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
3342 }
3343
3344 /**
3345  * Retrieve enclosures already enclosed for a post.
3346  *
3347  * @since 1.5.0