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
1920  * @return int How many rows were updated.
1921  */
1922 function add_ping($post_id, $uri) {
1923      global $wpdb;
1924      $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
1925      $pung = trim($pung);
1926      $pung = preg_split('/\s/', $pung);
1927      $pung[] = $uri;
1928      $new = implode("\n", $pung);
1929      $new = apply_filters('add_ping', $new);
1930      // expected_slashed ($new)
1931      $new = stripslashes($new);
1932      return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
1933 }
1934
1935 /**
1936  * Retrieve enclosures already enclosed for a post.
1937  *
1938  * @since 1.5.0