Пример #1
0
<?php

if (!function_exists('add_filter')) {
    exit;
}
global $hocwp_tos_tabs;
$parent_slug = 'hocwp_theme_option';
$option = new HOCWP_Option(__('Socials', 'hocwp-theme'), 'hocwp_option_social');
$option->set_parent_slug($parent_slug);
$option->set_use_style_and_script(true);
$option->add_section(array('id' => 'account', 'title' => __('Account', 'hocwp-theme'), 'description' => __('Your social accounts to config API on website.', 'hocwp-theme')));
$option->add_section(array('id' => 'facebook', 'title' => __('Facebook', 'hocwp-theme'), 'description' => __('All information about Facebook account and Facebook Insights Admins.', 'hocwp-theme')));
$option->add_section(array('id' => 'google', 'title' => __('Google', 'hocwp-theme'), 'description' => __('All information about Google account and Google console.', 'hocwp-theme')));
$option->add_field(array('id' => 'facebook_site', 'title' => __('Facebook page URL', 'hocwp-theme'), 'value' => hocwp_get_wpseo_social_value('facebook_site')));
$twitter_account = hocwp_get_wpseo_social_value('twitter_site');
if (!empty($twitter_account) && !hocwp_url_valid($twitter_account)) {
    $twitter_account = 'http://twitter.com/' . $twitter_account;
}
$option->add_field(array('id' => 'twitter_site', 'title' => __('Twitter URL', 'hocwp-theme'), 'value' => $twitter_account));
$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);
 final function add_option_to_sidebar_tab(HOCWP_Option $option)
 {
     if (!hocwp_menu_page_exists($this->option_name)) {
         global $hocwp_pos_tabs;
         $option->set_parent_slug($this->admin_menu_parent);
         $option->add_option_tab($hocwp_pos_tabs);
         $option->set_page_header_callback('hocwp_plugin_option_page_header');
         $option->set_page_footer_callback('hocwp_plugin_option_page_footer');
         $option->set_page_sidebar_callback('hocwp_plugin_option_page_sidebar');
     }
 }
Пример #3
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';
Пример #4
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');