コード例 #1
0
 function testWhetherPreAndPostCallbackTriggered()
 {
     global $post_callback_invoked;
     global $pre_callback_invoked;
     add_action("_wpr_router_pre_callback", "_wpr_precallback_test");
     add_action("_wpr_router_post_callback", "_wpr_postcallback_test");
     function _wpr_precallback_test()
     {
         global $pre_callback_invoked;
         $pre_callback_invoked = true;
     }
     function _wpr_postcallback_test()
     {
         global $post_callback_invoked;
         $post_callback_invoked = true;
     }
     $_GET['page'] = '_wpr/autoresponders';
     Routing::run_controller();
     $this->assertEquals($pre_callback_invoked, true);
     $this->assertEquals($post_callback_invoked, true);
 }
コード例 #2
0
 public function admin_init()
 {
     $this->register_scripts_and_styles();
     $this->enqueue_admin_scripts();
     if (_wpr_whether_html_broadcast_view_frame_request()) {
         _wpr_render_broadcast_view_frame();
     }
     if (Routing::is_admin_popup()) {
         Routing::render_admin_screen_popup();
     }
     if (Routing::is_template_html_request()) {
         Routing::render_template_html();
     }
     if ($this->whetherBroadcastCompositionScreen()) {
         $this->enqueueAdminScripts();
     }
     if ($this->isAdminPage()) {
         Routing::run_controller();
     }
 }