$wp_rewrite->
set_permalink_structure( $permalink_structure );
/*
* Flush rules with the hard option to force refresh of the web-server's
* rewrite config file (e.g. .htaccess or web.config).
*/
$wp_rewrite->
flush_rules( true
);
$test_url = '';
// Test against a real WordPress post.
$first_post =
get_page_by_path( sanitize_title( _x( 'hello-world', 'Default post slug'
) ), OBJECT, 'post'
);
if ( $first_post ) { $test_url =
get_permalink( $first_post->ID
);
} /*
* Send a request to the site, and check whether
* the 'X-Pingback' header is returned as expected.
*
* Uses wp_remote_get() instead of wp_remote_head() because web servers
* can block head requests.
*/