wp_extract_urls example

return false;
    }

    if ( null === $content ) {
        $content = $post->post_content;
    }

    $post_links = array();

    $pung = get_enclosed( $post->ID );

    $post_links_temp = wp_extract_urls( $content );

    foreach ( $pung as $link_test ) {
        // Link is no longer in post.         if ( ! in_array( $link_test$post_links_temp, true ) ) {
            $mids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $link_test ) . '%' ) );
            foreach ( $mids as $mid ) {
                delete_metadata_by_mid( 'post', $mid );
            }
        }
    }

    
$pung = get_pung( $post );

    if ( empty( $content ) ) {
        $content = $post->post_content;
    }

    /* * Step 1. * Parsing the post, external links (if any) are stored in the $post_links array. */
    $post_links_temp = wp_extract_urls( $content );

    /* * Step 2. * Walking through the links array. * First we get rid of links pointing to sites, not to specific files. * Example: * http://dummy-weblog.org * http://dummy-weblog.org/ * http://dummy-weblog.org/post.php * We don't wanna ping first and second types, even if they have a valid <link/>. */
    
Home | Imprint | This part of the site doesn't use cookies.