예제 #1
0
 public function __construct($file)
 {
     parent::__construct($file, [$this, 'convertHeadspace']);
     if (!\is_admin()) {
         $this->outputMeta();
     }
 }
예제 #2
0
 public function __construct($file)
 {
     parent::__construct($file);
     if (defined('WP_STAGE') && WP_STAGE !== 'local') {
         $this->hideAcf();
     }
     $this->saveJson();
 }
예제 #3
0
 function __construct($file)
 {
     parent::__construct($file);
     \add_action('wp_footer', function () {
         echo '<code><pre>';
         var_dump(new Wunderlist());
         echo '</pre></code>';
     });
 }
예제 #4
0
 public function __construct($file)
 {
     parent::__construct($file);
     $this->createNowCpt();
     $this->templates = ['now-page.php' => 'Now Page Template'];
     \add_filter('acf/settings/load_json', [$this, 'addAcfJsonLoadPoint']);
     \add_filter('page_attributes_dropdown_pages_args', [$this, 'registerPageTemplate']);
     \add_filter('wp_insert_post_data', [$this, 'registerPageTemplate']);
     \add_action('init', [$this, 'parseUrl']);
 }
예제 #5
0
 public function __construct($file)
 {
     parent::__construct($file);
     $this->createCpt();
     \add_action('init', [$this, 'registerLanguageTaxonomy'], 20);
     \add_action('pre_get_posts', [$this, 'parseQueryWithoutSlug']);
     \add_filter('post_type_link', [$this, 'filterPostLink'], 10, 2);
     \add_filter('single_template', [$this, 'registerTemplate']);
     \add_action('wp_enqueue_scripts', [$this, 'registerSubmitScript']);
     \add_action('wp_ajax_nopriv_submitLp', [$this, 'registerAjax']);
 }
예제 #6
0
 public function __construct($file)
 {
     parent::__construct($file);
     $this->createCpt();
     \add_filter('archive_template', [$this, 'archiveTemplate']);
     \add_filter('single_template', [$this, 'singleTemplate']);
     \add_action('init', [$this, 'addSingleRewrite']);
     \add_action('init', [$this, 'addArchiveRewrite']);
     \add_filter('post_type_link', [$this, 'filterPostLink'], 10, 2);
     if (\is_admin()) {
         \add_action('admin_enqueue_scripts', [$this, 'registerScript']);
         \add_action('wp_ajax_quanJobUserId', [$this, 'jobAddressInfo']);
     }
 }
예제 #7
0
 function __construct($file)
 {
     parent::__construct($file);
     \add_action('wp_enqueue_scripts', function () use($file) {
         \wp_enqueue_script('ai', plugins_url('js/adaptiveImages.js', $file), ['jquery'], '1.0.0', true);
     });
     \add_action('admin_enqueue_scripts', function ($hook) use($file) {
         \wp_register_script('ai', plugins_url('js/adaptiveImages.js', $file), ['jquery'], '1.0.0', true);
         \wp_register_script('aiFunctions', plugins_url('js/_aiFunctions.js', $file), ['jquery'], '1.0.0', true);
         if ($hook === 'post.php') {
             \wp_enqueue_script('aiAdmin', plugins_url('js/aiAdmin.js', $file), ['jquery', 'aiFunctions'], '1.0.0', true);
         }
     });
     \add_action('wp_ajax_ai_validate_url', [new Admin(), 'ajaxValidateUrl']);
     \add_action('wp_ajax_ai_get_image', [new Admin(), 'ajaxGetImage']);
     \add_action('wp_ajax_ai_load_image', [new AdaptiveImages(), 'getBestImage']);
     \add_action('wp_ajax_nopriv_ai_load_image', [new AdaptiveImages(), 'getBestImage']);
     \add_action('_admin_menu', [$this, 'setOptionsPage']);
 }
예제 #8
0
 public function __construct($file)
 {
     $profile = $this->profilePage();
     parent::__construct($file, [$profile, 'addRewriteRules']);
     $this->translations();
 }