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
2138  * @return int How many rows were updated.
2139  */
2140 function add_ping($post_id, $uri) {
2141      global $wpdb;
2142      $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
2143      $pung = trim($pung);
2144      $pung = preg_split('/\s/', $pung);
2145      $pung[] = $uri;
2146      $new = implode("\n", $pung);
2147      $new = apply_filters('add_ping', $new);
2148      // expected_slashed ($new)
2149      $new = stripslashes($new);
2150      return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
2151 }
2152
2153 /**
2154  * Retrieve enclosures already enclosed for a post.
2155  *
2156  * @since 1.5.0