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
2726  * @return int How many rows were updated.
2727  */
2728 function add_ping($post_id, $uri) {
2729      global $wpdb;
2730      $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
2731      $pung = trim($pung);
2732      $pung = preg_split('/\s/', $pung);
2733      $pung[] = $uri;
2734      $new = implode("\n", $pung);
2735      $new = apply_filters('add_ping', $new);
2736      // expected_slashed ($new)
2737      $new = stripslashes($new);
2738      return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
2739 }
2740
2741 /**
2742  * Retrieve enclosures already enclosed for a post.
2743  *
2744  * @since 1.5.0