WordPress.org

Make WordPress Core

Changeset 2743


Ignore:
Timestamp:
08/03/2005 12:40:42 AM (16 years ago)
Author:
matt
Message:

Adding some hooks, fixes #1489

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-functions.php

    r2699 r2743  
    448448            elseif(($test['path'] != '/') && ($test['path'] != ''))
    449449                $post_links[] = $link_test;
     450            do_action('pre_ping',  &$post_links, &$pung);
    450451        endif;
    451452    endforeach;
  • trunk/wp-includes/functions-post.php

    r2713 r2743  
    582582    $pung = trim($pung);
    583583    $pung = preg_split('/\s/', $pung);
     584    $pung = apply_filters('get_pung', $pung);
    584585    return $pung;
    585586}
     
    589590    $custom_fields = get_post_custom( $post_id );
    590591    $pung = array();
    591     if( is_array( $custom_fields ) ) {
    592         while( list( $key, $val ) = each( $custom_fields ) ) {
    593             if( $key == 'enclosure' ) {
    594                 if (is_array($val)) {
    595                     foreach($val as $enc) {
    596                         $enclosure = split( "\n", $enc );
    597                         $pung[] = trim( $enclosure[ 0 ] );
    598                     }
    599                 }
    600             }
    601         }
    602     }
     592    if ( !is_array( $custom_fields ) )
     593        return $pung;
     594
     595    foreach ( $custom_fields as $key => $val ) {
     596        if ( 'enclosure' != $key || !is_array( $val ) )
     597            continue;
     598        foreach( $val as $enc ) {
     599            $enclosure = split( "\n", $enc );
     600            $pung[] = trim( $enclosure[ 0 ] );
     601        }
     602    }
     603    $pung = apply_filters('get_enclosed', $pung);
    603604    return $pung;
    604605}
     
    609610    $to_ping = trim($to_ping);
    610611    $to_ping = preg_split('/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY);
     612    $to_ping = apply_filters('get_to_ping',  $to_ping);
    611613    return $to_ping;
    612614}
     
    619621    $pung[] = $uri;
    620622    $new = implode("\n", $pung);
     623    $new = apply_filters('add_ping', $new);
    621624    return $wpdb->query("UPDATE $wpdb->posts SET pinged = '$new' WHERE ID = $post_id");
    622625}
Note: See TracChangeset for help on using the changeset viewer.