Esempio n. 1
0
 function init()
 {
     // global
     global $pagenow;
     // determine action hooks
     if ($pagenow == 'customize.php') {
         $this->admin_head = 'customize_controls_print_scripts';
         $this->admin_footer = 'customize_controls_print_footer_scripts';
     } elseif ($pagenow == 'wp-login.php') {
         $this->admin_enqueue_scripts = 'login_enqueue_scripts';
         $this->admin_head = 'login_head';
         $this->admin_footer = 'login_footer';
     } elseif (!is_admin()) {
         $this->admin_enqueue_scripts = 'wp_enqueue_scripts';
         $this->admin_head = 'wp_head';
         $this->admin_footer = 'wp_footer';
     }
     // actions
     acf_maybe_add_action($this->admin_enqueue_scripts, array($this, 'do_admin_enqueue_scripts'), 20);
     acf_maybe_add_action($this->admin_head, array($this, 'do_admin_head'), 20);
     acf_maybe_add_action($this->admin_footer, array($this, 'do_admin_footer'), 20);
 }
Esempio n. 2
0
 function enqueue()
 {
     // bail ealry if already enqueued
     if ($this->enqueued) {
         return;
     }
     // update setting
     $this->enqueued = true;
     // global
     global $pagenow;
     // determine action hooks
     if ($pagenow == 'customize.php') {
         $this->admin_head = 'customize_controls_print_scripts';
         $this->admin_footer = 'customize_controls_print_footer_scripts';
     } elseif ($pagenow == 'wp-login.php') {
         $this->admin_enqueue_scripts = 'login_enqueue_scripts';
         $this->admin_head = 'login_head';
         $this->admin_footer = 'login_footer';
     } elseif (!is_admin()) {
         $this->admin_enqueue_scripts = 'wp_enqueue_scripts';
         $this->admin_head = 'wp_head';
         $this->admin_footer = 'wp_footer';
     }
     // actions
     acf_maybe_add_action($this->admin_enqueue_scripts, array($this, 'admin_enqueue_scripts'), 20);
     acf_maybe_add_action($this->admin_head, array($this, 'admin_head'), 20);
     acf_maybe_add_action($this->admin_footer, array($this, 'admin_footer'), 20);
 }