コード例 #1
0
/**
 * @hook init
 * register help for module
 */
function _hw_awc_init()
{
    if (class_exists('HW_HELP')) {
        HW_HELP::set_helps_path('awc', HW_AWC_PATH . 'helps');
        HW_HELP::register_help('awc');
        HW_HELP::load_module_help('awc');
    }
}
コード例 #2
0
 /**
  * initial something
  */
 public function _hw_bcn_help_init()
 {
     //reigster help for this plugin
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('breadcrumb', HW_BREADCRUMB_PATH . 'helps');
         HW_HELP::register_help('breadcrumb');
         HW_HELP::load_module_help('breadcrumb');
     }
 }
コード例 #3
0
 /**
  * initial something
  */
 public function _init()
 {
     //register help for the plugin
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('post_view_counter', HWPVC_PLUGIN_PATH . 'helps');
         HW_HELP::set_helps_url('post_view_counter', HWPVC_PLUGIN_URL . '/helps');
         HW_HELP::register_help('post_view_counter');
         HW_HELP::load_module_help('post_view_counter');
     }
 }
コード例 #4
0
 /**
  * @wp_hook action init
  */
 public function _hwss_init()
 {
     wp_register_script('hwss-js', HW_SOCIALSHARE_URL . '/js/main.js', array('jquery'));
     wp_register_script('hwss-admin-js', HW_SOCIALSHARE_URL . '/js/hwss-admin-js.js', array('jquery'));
     //create help
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('share', HW_SOCIALSHARE_PATH . 'helps');
         HW_HELP::set_helps_url('share', HW_SOCIALSHARE_URL . '/helps');
         HW_HELP::register_help('share');
         HW_HELP::load_module_help('share');
     }
 }
コード例 #5
0
 /**
  * main class constructor
  */
 function __construct()
 {
     $this->setup_actions();
     //init hooks
     //override plugin textdomain path for yarpp plugin
     load_plugin_textdomain('hw-yarpp', false, HWRP_PLUGIN_PATH . '/langs');
     //register help
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('relatedpost', HWRP_PLUGIN_PATH . 'helps');
         HW_HELP::set_helps_url('relatedpost', HWRP_PLUGIN_URL . 'helps');
         HW_HELP::register_help('relatedpost');
         HW_HELP::load_module_help('relatedpost');
         //HW_HELP::$relatedpost;
     }
 }
コード例 #6
0
function _hwpagenavi_init()
{
    if (class_exists('HW_HELP')) {
        HW_HELP::set_helps_path('pagenavi', HW_PAGENAVI_PATH . 'helps');
        HW_HELP::register_help('pagenavi');
        HW_HELP::load_module_help('pagenavi');
    }
}
コード例 #7
0
 /**
  * admin init
  * @hook init
  */
 public function _init()
 {
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('lct', plugin_dir_path(__FILE__) . 'helps');
         HW_HELP::set_helps_url('lct', plugins_url('', __FILE__) . '/helps');
         HW_HELP::register_help('lct');
         HW_HELP::load_module_help('lct');
     }
 }
コード例 #8
0
function _hw_navmenu_init()
{
    if (class_exists('HW_HELP')) {
        HW_HELP::set_helps_path('navmenu', HW_MENU_PATH . 'helps');
        HW_HELP::set_helps_url('navmenu', HW_MENU_URL . '/helps');
        HW_HELP::register_help('navmenu');
        HW_HELP::load_module_help('navmenu');
    }
}
コード例 #9
0
 /**
  * init hook
  */
 public function _init_something()
 {
     //load plugin help
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('wpcf7', HW_WPCF7_PATH . 'helps');
         HW_HELP::set_helps_url('wpcf7', HW_WPCF7_URL . '/helps');
         HW_HELP::register_help('wpcf7');
         HW_HELP::load_module_help('wpcf7');
     }
 }
コード例 #10
0
 /**
  * @hook init
  * init action callback (testing)
  */
 public function _init_something()
 {
     //show/hide advanced feature exists in admin menu
     $show_advanced = hw_get_setting('enable_developer_feature');
     if (!$show_advanced) {
         //acf menu, according to http://www.advancedcustomfields.com/resources/how-to-hide-acf-menu-from-clients/
         add_filter('acf/settings/show_admin', '__return_false');
     }
     //register help for the plugin
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('hoangweb', HW_HOANGWEB_PATH . 'helps');
         HW_HELP::set_helps_url('hoangweb', HW_HOANGWEB_URL . '/helps');
         HW_HELP::register_help('hoangweb');
         HW_HELP::load_module_help('hoangweb');
     }
 }
コード例 #11
0
 /**
  * Initialise translations & something
  */
 public function _load_plugin_data()
 {
     //textdomain
     load_plugin_textdomain('metaslider', false, dirname(plugin_basename(__FILE__)) . '/languages/');
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('slider', HWML_PLUGIN_PATH . 'helps');
         HW_HELP::set_helps_url('slider', HWML_PLUGIN_URL . '/helps');
         HW_HELP::register_help('slider');
         HW_HELP::load_module_help('slider');
     }
 }
コード例 #12
0
 /**
  * init something
  */
 public function _init()
 {
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path('livechat', HW_LIVECHAT_PATH . 'helps');
         HW_HELP::register_help('livechat');
         HW_HELP::load_module_help('livechat');
     }
 }
コード例 #13
0
 /**
  * register help for module
  * @param $file
  * @param $name
  * @param $path help path
  * @return mixed|void
  */
 public function register_help($name, $file = '', $path = 'help')
 {
     $name = preg_replace('#\\.php$#', '', trim($name));
     //help name
     if ($file === '') {
         $file = $name . '.html';
     }
     //default help file same as help handling file
     if (class_exists('HW_HELP')) {
         HW_HELP::set_helps_path($name, $this->module_path . '/' . ltrim($path, '\\/'));
         HW_HELP::set_helps_url($name, $this->get_module_file_url($path));
         HW_HELP::register_help($name);
         $help = HW_HELP::load_module_help($name);
         $this->option('help_handler', array('class' => get_class($help), 'file' => $file));
         if (is_object($help)) {
             $help->_option('module', $this);
         }
     }
 }