Example #1
0
 /**
  * Ensure our rewrite endpoint is there.
  */
 function test_rewrite_endpoint()
 {
     global $wp_rewrite;
     unset($wp_rewrite->endpoints);
     wp_oembed_rewrite_endpoint();
     $this->assertEquals(EP_PERMALINK | EP_PAGES | EP_ATTACHMENT, $wp_rewrite->endpoints[0][0]);
     $this->assertEquals('embed', $wp_rewrite->endpoints[0][1]);
     $this->assertEquals('embed', $wp_rewrite->endpoints[0][2]);
 }
Example #2
0
/**
 * Add our rewrite endpoint on plugin activation.
 *
 * @codeCoverageIgnore
 */
function oembed_api_activate_plugin()
{
    wp_oembed_rewrite_endpoint();
    flush_rewrite_rules(false);
}