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
778 }
779
780 function add_ping($post_id, $uri) { // Add a URI to those already pung
781      global $wpdb;
782      $pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id");
783      $pung = trim($pung);
784      $pung = preg_split('/\s/', $pung);
785      $pung[] = $uri;
786      $new = implode("\n", $pung);
787      $new = apply_filters('add_ping', $new);
788      return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id");
789 }
790
791 //fetches the pages returned as a FLAT list, but arranged in order of their hierarchy, i.e., child parents
792 //immediately follow their parents
793 function get_page_hierarchy($posts, $parent = 0) {
794      $result = array ( );
795      if ($posts) { foreach ($posts as $post) {
796           if ($post->post_parent == $parent) {