コード例 #1
0
 /**
  * Create instances, and register callbacks.
  *
  * @return void
  */
 public function setup()
 {
     $nonce = Inpsyde_Nonce_Validator_Factory::create('save_redirect_site_setting');
     $data = new Mlp_Redirect_Settings_Data($nonce, $this->option_name);
     $view = new Mlp_Redirect_Site_Settings_Form($nonce, $data);
     add_filter('mlp_blogs_add_fields', array($view, 'render'));
     add_filter('mlp_blogs_save_fields', array($data, 'save'));
 }
コード例 #2
0
 /**
  * Initializes the objects.
  *
  * @return void
  */
 public function setup()
 {
     $meta_key = 'mlp_redirect';
     $nonce = Inpsyde_Nonce_Validator_Factory::create('save_redirect_user_setting');
     $user_settings_controller = new Mlp_User_Settings_Controller(new Mlp_Redirect_User_Settings_Html($meta_key, $nonce), new Mlp_User_Settings_Updater($meta_key, $nonce));
     $user_settings_controller->setup();
     $redirect_filter = new Mlp_Redirect_Filter($meta_key);
     add_filter('mlp_do_redirect', array($redirect_filter, 'filter_redirect'));
 }
コード例 #3
0
 /**
  * Constructor
  *
  * @param  Inpsyde_Property_List_Interface $data
  */
 public function __construct(Inpsyde_Property_List_Interface $data)
 {
     $this->plugin_data = $data;
     $this->nonce_validator = Inpsyde_Nonce_Validator_Factory::create('save_cpt_translator_settings');
     // Quit here if module is turned off
     if (!$this->register_setting()) {
         return;
     }
     add_filter('mlp_allowed_post_types', array($this, 'filter_allowed_post_types'));
     add_action('mlp_modules_add_fields', array($this, 'draw_options_page_form_fields'));
     // Use this hook to handle the user input of your modules' options page form fields
     add_action('mlp_modules_save_fields', array($this, 'save_options_page_form_fields'));
     // replace the permalink if selected
     add_action('mlp_before_link', array($this, 'before_mlp_link'));
     add_action('mlp_after_link', array($this, 'after_mlp_link'));
 }
コード例 #4
0
 /**
  * Constructor
  *
  * @param Mlp_Module_Manager_Interface $module_manager
  * @param Mlp_Language_Api_Interface   $language_api
  * @param Mlp_Assets_Interface         $assets
  */
 public function __construct(Mlp_Module_Manager_Interface $module_manager, Mlp_Language_Api_Interface $language_api, Mlp_Assets_Interface $assets)
 {
     $this->module_manager = $module_manager;
     $this->language_api = $language_api;
     $this->assets = $assets;
     // Quit here if module is turned off
     if (!$this->register_setting()) {
         return;
     }
     $this->nonce_validator = Inpsyde_Nonce_Validator_Factory::create('save_quicklink_position');
     $this->redirect_quick_link();
     add_action('wp_head', array($this, 'load_style'), 0);
     add_filter('the_content', array($this, 'frontend_tab'));
     add_action('mlp_modules_add_fields', array($this, 'draw_options_page_form_fields'));
     // Use this hook to handle the user input of your modules' options page form fields
     add_filter('mlp_modules_save_fields', array($this, 'save_options_page_form_fields'));
 }
コード例 #5
0
 /**
  * Create nonce, view and data objects.
  *
  * @wp-hook inpsyde_mlp_loaded
  *
  * @return void
  */
 private function create_instances()
 {
     $this->data = new Mlp_Language_Nav_Menu_Data($this->handle, $this->meta_key, Inpsyde_Nonce_Validator_Factory::create('add_languages_to_nav_menu'), $this->assets);
     $this->view = new Mlp_Simple_Nav_Menu_Selectors($this->data);
 }
コード例 #6
0
 /**
  * @param Mlp_Content_Relations_Interface $content_relations
  */
 public function __construct(Mlp_Content_Relations_Interface $content_relations)
 {
     $this->content_relations = $content_relations;
     $this->nonce = Inpsyde_Nonce_Validator_Factory::create($this->get_nonce_action(), get_current_blog_id());
 }