/**
  * Register and enqueues public-facing JavaScript files.
  *
  * @since    1.0.0
  */
 public function enqueue_scripts()
 {
     PT_CV_Html::frontend_scripts();
 }
 /**
  * Register and enqueue admin-specific JavaScript.
  *
  * @since     1.0.0
  *
  * @return    null    Return early if no settings page is registered.
  */
 public function enqueue_admin_scripts()
 {
     if (!isset($this->plugin_screen_hook_suffix)) {
         return;
     }
     $screen = get_current_screen();
     if ($this->plugin_screen_hook_suffix == $screen->id || in_array($screen->id, $this->plugin_sub_screen_hook_suffix)) {
         // WP assets
         wp_enqueue_script('wp-color-picker');
         wp_enqueue_script('jquery-ui-sortable');
         // Main admin script
         PT_CV_Asset::enqueue('admin', 'script', array('src' => plugins_url('assets/js/admin.js', __FILE__), 'deps' => array('jquery')));
         // Localize strings
         PT_CV_Asset::localize_script('admin', PT_CV_PREFIX_UPPER . 'ADMIN', array('_prefix' => PT_CV_PREFIX, '_group_prefix' => PT_CV_Html::html_group_class() . '-', '_nonce' => wp_create_nonce(PT_CV_PREFIX_ . 'ajax_nonce'), 'supported_version' => PT_CV_Functions::wp_version_compare('3.5'), 'text' => array('no_taxonomy' => __('There is no taxonomy for selected content type', 'content-views-query-and-display-post-page'), 'pagination_disable' => __('Pagination is disabled when Limit = -1', 'content-views-query-and-display-post-page'), 'prevent_click' => __('Opening a link is prevented in preview box', 'content-views-query-and-display-post-page')), 'btn' => array('preview' => array('show' => __('Show Preview', 'content-views-query-and-display-post-page'), 'hide' => __('Hide Preview', 'content-views-query-and-display-post-page'), 'update' => __('Update Preview', 'content-views-query-and-display-post-page'))), 'data' => array('post_types_vs_taxonomies' => PT_CV_Values::post_types_vs_taxonomies())));
         // Bootstrap for Admin
         PT_CV_Asset::enqueue('bootstrap-admin', 'script', array('src' => plugins_url('assets/bootstrap/js/bootstrap.full.js', PT_CV_FILE)));
         // For Preview
         PT_CV_Html::frontend_scripts();
         PT_CV_Asset::enqueue('select2');
     }
 }
예제 #3
0
 public function enqueue_assets()
 {
     // Execute if assets were not enqueued in default way
     if (!apply_filters(PT_CV_PREFIX_ . 'default_enqueue_assets', 1)) {
         global $pt_cv_id;
         if (!empty($pt_cv_id) || apply_filters(PT_CV_PREFIX_ . 'view_executed', 0)) {
             PT_CV_Html::frontend_styles();
             PT_CV_Html::frontend_scripts();
         }
     }
 }