예제 #1
0
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';
require HOCWP_THEME_INC_PATH . '/options/setting-permalink.php';
require HOCWP_THEME_INC_PATH . '/options/setting-utilities.php';
예제 #2
0
$option->add_field(array('id' => 'instagram_url', 'title' => __('Instagram URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('instagram_url')));
$option->add_field(array('id' => 'linkedin_url', 'title' => __('LinkedIn URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('linkedin_url')));
$option->add_field(array('id' => 'myspace_url', 'title' => __('Myspace URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('myspace_url')));
$option->add_field(array('id' => 'pinterest_url', 'title' => __('Pinterest URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('pinterest_url')));
$option->add_field(array('id' => 'youtube_url', 'title' => __('YouTube URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('youtube_url')));
$option->add_field(array('id' => 'google_plus_url', 'title' => __('Google+ URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('google_plus_url')));
$option->add_field(array('id' => 'rss_url', 'title' => __('RSS URL', 'hocwp-theme')));
$option->add_field(array('id' => 'addthis_id', 'title' => __('AddThis ID', 'hocwp-theme'), 'section' => 'account'));
$option->add_field(array('id' => 'fbadminapp', 'title' => __('Facebook App ID', 'hocwp-theme'), 'section' => 'facebook', 'value' => hocwp_get_wpseo_social_value('fbadminapp')));
$option->add_field(array('id' => 'google_api_key', 'title' => __('Google API Key', 'hocwp-theme'), 'section' => 'google'));
$option->add_field(array('id' => 'google_client_id', 'title' => __('Google Client ID', 'hocwp-theme'), 'section' => 'google'));
$option->add_option_tab($hocwp_tos_tabs);
$option->set_page_header_callback('hocwp_theme_option_form_before');
$option->set_page_footer_callback('hocwp_theme_option_form_after');
$option->set_page_sidebar_callback('hocwp_theme_option_sidebar_tab');
$option->init();
hocwp_option_add_object_to_list($option);
function hocwp_option_social_update($input)
{
    $key = 'facebook_site';
    if (isset($input[$key])) {
        hocwp_update_wpseo_social($key, $input[$key]);
    }
    $key = 'twitter_site';
    if (isset($input[$key])) {
        hocwp_update_wpseo_social($key, $input[$key]);
    }
    $key = 'instagram_url';
    if (isset($input[$key])) {
        hocwp_update_wpseo_social($key, $input[$key]);
    }
예제 #3
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');