public function admin_enqueue_scripts()
 {
     hocwp_register_core_style_and_script();
     hocwp_admin_enqueue_scripts();
     wp_register_style('hocwp-admin-style', HOCWP_URL . '/css/hocwp-admin' . HOCWP_CSS_SUFFIX, array('hocwp-style'), $this->version);
     wp_register_script('hocwp-admin', HOCWP_URL . '/js/hocwp-admin' . HOCWP_JS_SUFFIX, array('jquery', 'hocwp'), $this->version, true);
     wp_register_style($this->textdomain . '-style', $this->url . '/css/hocwp-plugin-admin' . HOCWP_CSS_SUFFIX, array('hocwp-admin-style'), $this->version);
     wp_register_script($this->textdomain, $this->url . '/js/hocwp-plugin-admin' . HOCWP_JS_SUFFIX, array('hocwp-admin'), $this->version, true);
     wp_localize_script($this->textdomain, 'hocwp', hocwp_default_script_localize_object());
     wp_enqueue_style($this->textdomain . '-style');
     wp_enqueue_script($this->textdomain);
 }
Exemplo n.º 2
0
function hocwp_setup_theme_admin_scripts()
{
    global $pagenow;
    if ('post-new.php' == $pagenow || 'post.php' == $pagenow) {
        $post_type = hocwp_get_current_post_type();
        if ('hocwp_slider' == $post_type) {
            add_filter('hocwp_use_color_picker', '__return_true');
        }
    }
    hocwp_admin_enqueue_scripts();
    $jquery_ui_datetime_picker = apply_filters('hocwp_admin_jquery_datetime_picker', false);
    if ((bool) $jquery_ui_datetime_picker) {
        hocwp_enqueue_jquery_ui_datepicker();
    }
    if ('profile.php' == $pagenow) {
        hocwp_google_plus_client_script();
    }
}