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
1536  * @return mixed {@internal Missing Description}}
1537  */
1538 function add_ping($post_id, $uri) {
1539      global $wpdb;
1540      $pung = $wpdb->get_var( $wpdb->prepare( "SELECT pinged FROM $wpdb->posts WHERE ID = %d", $post_id ));
1541      $pung = trim($pung);
1542      $pung = preg_split('/\s/', $pung);
1543      $pung[] = $uri;
1544      $new = implode("\n", $pung);
1545      $new = apply_filters('add_ping', $new);
1546      // expected_slashed ($new)
1547      $new = stripslashes($new);
1548      return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
1549 }
1550
1551 function get_enclosed($post_id) { // Get enclosures already enclosed for a post
1552      $custom_fields = get_post_custom( $post_id );
1553      $pung = array();
1554      if ( !is_array( $custom_fields ) )