Example #1
0
 /**
  * Ads page relative actions.
  * This is called upon instantiation of the class.
  *
  * @author Panagiotis Vagenas <*****@*****.**>
  * @since  1.0.0
  */
 protected function bindActions()
 {
     $scripts = Script::getInstance($this);
     if (!has_action('admin_init', [$scripts, 'init'])) {
         add_action('admin_init', [$scripts, 'init']);
     }
     add_action('wp_ajax_' . IfcScripts::ACTION_SAVE_PREFIX . $this->menuSlug, [AjaxHandler::getInstance($this), 'saveOptions']);
     add_action('wp_ajax_' . IfcScripts::ACTION_RESET_PREFIX . $this->menuSlug, [AjaxHandler::getInstance($this), 'resetOptions']);
     add_action('wp_ajax_' . IfcScripts::ACTION_EXPORT_PREFIX . $this->menuSlug, [AjaxHandler::getInstance($this), 'exportOptions']);
     add_action('wp_ajax_' . IfcScripts::ACTION_IMPORT_PREFIX . $this->menuSlug, [AjaxHandler::getInstance($this), 'importOptions']);
     add_action('wp_ajax_' . IfcScripts::ACTION_UPDATE_CORE_OPTIONS_PREFIX . $this->menuSlug, [AjaxHandler::getInstance($this), 'updateCoreOptions']);
 }
Example #2
0
 public function __construct(AbsCmpFields $component, $name)
 {
     parent::__construct($component, $name);
     $this->setSelect2option('placeholder', 'Please make a selection');
     add_filter(Script::getInstance($this->menuPageComponent->getMenuPage())->getJsObjectFilter(), [$this, 'filterJsObjForOptions']);
 }