コード例 #1
0
    public function test_embed_reversal()
    {
        $string = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/219074591&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>
					bananas after';
        $reversal_test = Shortcake_Bakery::get_instance()->reverse_embed($string);
        $this->assertTrue($reversal_test['success']);
        $expected_shortcode = array('shortcode' => 'soundcloud', 'attributes' => array('url' => 'https://api.soundcloud.com/tracks/219074591', 'type' => 'visual', 'autoplay' => 0), 'inner_content' => null, 'raw' => '[soundcloud url="https://api.soundcloud.com/tracks/219074591" type="visual" autoplay="0"]');
        $this->assertEquals($expected_shortcode, $reversal_test['shortcodes'][0]);
    }
コード例 #2
0
 /**
  * Set up shortcode actions
  */
 private function setup_actions()
 {
     add_action('init', array($this, 'action_init_register_shortcodes'));
     add_action('shortcode_ui_after_do_shortcode', function ($shortcode) {
         return Shortcake_Bakery::get_shortcake_admin_dependencies();
     });
     add_action('admin_enqueue_scripts', array($this, 'action_admin_enqueue_scripts'));
     add_action('media_buttons', array($this, 'action_media_buttons'));
     add_action('wp_ajax_shortcake_bakery_embed_reverse', array($this, 'action_ajax_shortcake_bakery_embed_reverse'));
 }
コード例 #3
0
function Shortcake_Bakery()
{
    return Shortcake_Bakery::get_instance();
}