get_to_ping example


function do_trackbacks( $post ) {
    global $wpdb;

    $post = get_post( $post );

    if ( ! $post ) {
        return false;
    }

    $to_ping = get_to_ping( $post );
    $pinged  = get_pung( $post );

    if ( empty( $to_ping ) ) {
        $wpdb->update( $wpdb->posts, array( 'to_ping' => '' ), array( 'ID' => $post->ID ) );
        return;
    }

    if ( empty( $post->post_excerpt ) ) {
        /** This filter is documented in wp-includes/post-template.php */
        $excerpt = apply_filters( 'the_content', $post->post_content, $post->ID );
    } else {
        


    if ( defined( 'WP_IMPORTING' ) ) {
        return;
    }

    if ( get_option( 'default_pingback_flag' ) ) {
        add_post_meta( $post_id, '_pingme', '1', true );
    }
    add_post_meta( $post_id, '_encloseme', '1', true );

    $to_ping = get_to_ping( $post_id );
    if ( ! empty( $to_ping ) ) {
        add_post_meta( $post_id, '_trackbackme', '1' );
    }

    if ( ! wp_next_scheduled( 'do_pings' ) ) {
        wp_schedule_single_event( time(), 'do_pings' );
    }
}

/** * Returns the ID of the post's parent. * * @since 3.1.0 * @since 5.9.0 The `$post` parameter was made optional. * * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. * @return int|false Post parent ID (which can be 0 if there is no parent), * or false if the post does not exist. */
Home | Imprint | This part of the site doesn't use cookies.