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
759 }
760
761 function add_ping($post_id, $uri) { // Add a URI to those already pung
762      global $wpdb;
763      $pung = $wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_id");
764      $pung = trim($pung);
765      $pung = preg_split('/\s/', $pung);
766      $pung[] = $uri;
767      $new = implode("\n", $pung);
768      $new = apply_filters('add_ping', $new);
769      return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id");
770 }
771
772 //fetches the pages returned as a FLAT list, but arranged in order of their hierarchy, i.e., child parents
773 //immediately follow their parents
774 function get_page_hierarchy($posts, $parent = 0) {
775      $result = array ( );
776      if ($posts) { foreach ($posts as $post) {
777           if ($post->post_parent == $parent) {