예제 #1
0
<?php

if (!function_exists('add_filter')) {
    exit;
}
global $hocwp_theme_option, $hocwp_tos_tabs;
$hocwp_theme_option = new HOCWP_Option(__('Theme Options', 'hocwp-theme'), 'hocwp_theme_option');
$hocwp_theme_option->set_parent_slug('');
$hocwp_theme_option->set_icon_url('dashicons-admin-generic');
$hocwp_theme_option->set_position(61);
$hocwp_theme_option->set_use_style_and_script(true);
$hocwp_theme_option->init();
$hocwp_theme_option = new HOCWP_Option(__('Private Types', 'hocwp-theme'), 'hocwp_private_types');
$hocwp_theme_option->set_parent_slug('');
$hocwp_theme_option->set_icon_url('dashicons-admin-post');
$hocwp_theme_option->set_position(90);
$hocwp_theme_option->set_use_style_and_script(false);
$hocwp_theme_option->init();
require HOCWP_THEME_INC_PATH . '/options/setting-theme-setting.php';
require HOCWP_THEME_INC_PATH . '/options/setting-theme-home.php';
require HOCWP_THEME_INC_PATH . '/options/setting-theme-custom.php';
require HOCWP_THEME_INC_PATH . '/options/setting-theme-custom-css.php';
require HOCWP_THEME_INC_PATH . '/options/setting-theme-add-to-head.php';
require HOCWP_THEME_INC_PATH . '/options/setting-theme-add-to-footer.php';
require HOCWP_THEME_INC_PATH . '/options/setting-optimize.php';
require HOCWP_THEME_INC_PATH . '/options/setting-social.php';
require HOCWP_THEME_INC_PATH . '/options/setting-login.php';
require HOCWP_THEME_INC_PATH . '/options/setting-smtp-email.php';
require HOCWP_THEME_INC_PATH . '/options/setting-writing.php';
require HOCWP_THEME_INC_PATH . '/options/setting-reading.php';
require HOCWP_THEME_INC_PATH . '/options/setting-discussion.php';
예제 #2
0
<?php

if (!function_exists('add_filter')) {
    exit;
}
global $hocwp_plugin_option, $hocwp_pos_tabs;
$hocwp_plugin_option = new HOCWP_Option(__('Plugin Options', 'hocwp-theme'), 'hocwp_plugin_option');
$hocwp_plugin_option->set_parent_slug('');
$hocwp_plugin_option->set_icon_url('dashicons-admin-generic');
$hocwp_plugin_option->set_position(66);
$hocwp_plugin_option->set_use_style_and_script(true);
$hocwp_plugin_option->init();
function hocwp_plugin_remove_option_submenu_page()
{
    remove_submenu_page('hocwp_plugin_option', 'hocwp_plugin_option');
}
add_action('admin_menu', 'hocwp_plugin_remove_option_submenu_page', 99);
function hocwp_plugin_redirect_option_page()
{
    $valid = apply_filters('hocwp_plugin_license_valid', true);
    if (!$valid) {
        $page = hocwp_get_current_admin_page();
        if ('hocwp_plugin_option' == $page) {
            $base_url = admin_url('admin.php');
            $base_url = add_query_arg('page', 'hocwp_plugin_license', $base_url);
            wp_redirect($base_url);
            exit;
        }
    }
}
add_action('admin_init', 'hocwp_plugin_redirect_option_page');