public function init()
 {
     if (parent::init()) {
         add_action('admin_init', array($this, 'action_admin_init'));
         return true;
     }
     return false;
 }
 /**
  * Component init method
  * @return [type] [description]
  */
 public function init()
 {
     if (parent::init()) {
         add_filter('the_content', array($this, 'removeWhitespaces'), 2);
         return true;
     }
     return false;
 }
示例#3
0
 public function init()
 {
     if (parent::init()) {
         add_action('delete_attachment', array($this, 'removeCustomImageSizes'));
         add_filter('image_downsize', array($this, 'filter_imageDownsize'), 10, 3);
         return true;
     }
     return false;
 }
示例#4
0
 public function init()
 {
     if (!parent::init()) {
         return false;
     }
     if ($this->ajax_action_name) {
         add_action('wp_ajax_' . $this->ajax_action_name, array($this, 'ajax_action'));
         add_action('wp_ajax_nopriv_' . $this->ajax_action_name, array($this, 'ajax_action'));
     }
     return true;
 }
 /**
  * Init function.
  *
  * @return void
  */
 public function init()
 {
     if (!parent::init()) {
         return false;
     }
     if (is_admin()) {
         $this->_initSettingsTranslation();
     } else {
         add_filter('icl_ls_languages', array($this, 'filter_icl_ls_languages_fix_tours_link'), 20);
     }
     return true;
 }
 public function init()
 {
     if (parent::init()) {
         if (is_admin() && $this->getTaxonomies() && $this->getStorage()) {
             $this->initFields();
             $this->initTableColumn();
             $this->initSaveData();
             $this->initRemoveData();
         }
         return true;
     }
     return false;
 }
示例#7
0
 /**
  * Init method.
  * @return void
  */
 public function init()
 {
     if (parent::init()) {
         add_action('customize_register', array($this, 'hook_onCustomizeRegister'));
         if (is_admin()) {
             add_action('customize_controls_print_scripts', array($this, 'action_customize_controls_print_scripts'));
             add_action('wp_ajax_customizer_reset', array($this, 'action_ajax_reset'));
             // add_action( 'customize_preview_init', array( $this, 'hook_registerPreviewAssets' ) );
             // add_action( 'customize_controls_enqueue_scripts', array( $this, 'hook_registerManageAssets' ) );
         }
         return true;
     }
     return false;
 }
示例#8
0
 public function init()
 {
     if (parent::init()) {
         if (!$this->table_name) {
             throw new Exception('Option "table_name" can not be empty.');
         }
         if (!$this->storage_key) {
             throw new Exception('Option "storage_key" can not be empty.');
         }
         if ($this->check_table_exists && !$this->tableExists()) {
             throw new Exception(sprintf('Table "%s" does not exist.', $this->getTableName()));
         }
         return true;
     }
     return false;
 }
示例#9
0
 public function init()
 {
     if (!parent::init()) {
         return false;
     }
     if ($this->register_in_assets) {
         $file_url = $this->get_font_file_url();
         if ($file_url) {
             if (is_admin()) {
                 add_action('admin_enqueue_scripts', array($this, 'register_assets'));
             } else {
                 add_action('wp_enqueue_scripts', array($this, 'register_assets'));
             }
         }
     }
     return true;
 }
示例#10
0
 /**
  * Checks requirements and setup all required filters.
  * @return void
  */
 public function init()
 {
     if (!parent::init()) {
         return false;
     }
     if (!is_super_admin()) {
         return true;
     }
     $fileUrl = $this->getUpdatesFileUrl();
     if (empty($fileUrl)) {
         return $this->error('Updates file url is empty.');
     }
     if (!function_exists('json_decode')) {
         return $this->error('Function "json_decode" does not exists.');
     }
     add_action('admin_menu', array($this, 'updateAdminMenu'));
     if (is_admin_bar_showing()) {
         add_action('admin_bar_menu', array($this, 'updateAdminBarMenu'), 1000);
     }
     return true;
 }
示例#11
0
 public function init()
 {
     if (!parent::init()) {
         return false;
     }
     if ($this->calendar_show_left_tickets_format && $this->tickets_number_suffix) {
         if ($this->time_select_text_format) {
             $this->time_select_text_format .= $this->tickets_number_suffix;
         }
         if ($this->date_field_text_format) {
             $this->date_field_text_format .= $this->tickets_number_suffix;
         }
     }
     // booking and orders processing hooks
     add_action('woocommerce_add_to_cart_handler_tour', array($this, 'handler_add_to_cart_handler_tour'));
     add_filter('woocommerce_get_cart_item_from_session', array($this, 'filter_woocommerce_get_cart_item_from_session'), 1, 3);
     add_filter('woocommerce_get_item_data', array($this, 'filter_woocommerce_get_item_data'), 20, 2);
     add_filter('woocommerce_attribute_label', array($this, 'filter_woocommerce_attribute_label'), 20, 2);
     add_action('woocommerce_add_order_item_meta', array($this, 'filter_woocommerce_add_order_item_meta'), 1, 2);
     //WPML integration
     add_filter('wcml_exception_duplicate_products_in_cart', array($this, 'filter_wcml_exception_duplicate_products_in_cart'), 20, 2);
     add_action('adventure_tours_booking_form_notices', array($this, 'filter_notices'));
     return true;
 }