Пример #1
0
 function temporary_activate_post_type_settings()
 {
     global $wp_post_types;
     $pts = get_post_types(array('show_ui' => true, '_builtin' => true));
     $cpts = get_post_types(array('show_ui' => true, '_builtin' => false));
     $first_post_type = "";
     $key = 1;
     foreach ($pts as $pt) {
         if (empty($first_post_type)) {
             $first_post_type = $pt;
             ESSBOptionsStructureHelper::menu_item('advanced', 'advancedpost', __('Display Settings by Post Type', ESSB3_TEXT_DOMAIN), 'default', 'activate_first', 'advancedpost-1');
         }
         ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedpost-' . $key, $wp_post_types[$pt]->label);
         ESSBOptionsStructureHelper::field_heading('advanced', 'advancedpost-' . $key, 'heading1', __('Advanced settings for post type: ' . $wp_post_types[$pt]->label, ESSB3_TEXT_DOMAIN));
         essb_prepare_location_advanced_customization('advanced', 'advancedpost-' . $key, 'post-type-' . $pt, true);
         $key++;
     }
     foreach ($cpts as $cpt) {
         ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedpost-' . $key, $wp_post_types[$cpt]->label);
         ESSBOptionsStructureHelper::field_heading('advanced', 'advancedpost-' . $key, 'heading1', __('Advanced settings for post type: ' . $wp_post_types[$cpt]->label, ESSB3_TEXT_DOMAIN));
         essb_prepare_location_advanced_customization('advanced', 'advancedpost-' . $key, 'post-type-' . $cpt, true);
         $key++;
     }
     $key = 1;
     $cpt = 'woocommerce';
     $cpt_title = 'WooCommerce';
     ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedmodule-' . $key, $cpt_title);
     ESSBOptionsStructureHelper::field_heading('advanced', 'advancedmodule-' . $key, 'heading1', __('Advanced settings for plugin: ' . $cpt_title, ESSB3_TEXT_DOMAIN));
     essb_prepare_location_advanced_customization('advanced', 'advancedmodule-' . $key, 'post-type-' . $cpt, true);
     $key++;
     $cpt = 'wpecommerce';
     $cpt_title = 'WP e-Commerce';
     ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedmodule-' . $key, $cpt_title);
     ESSBOptionsStructureHelper::field_heading('advanced', 'advancedmodule-' . $key, 'heading1', __('Advanced settings for plugin: ' . $cpt_title, ESSB3_TEXT_DOMAIN));
     essb_prepare_location_advanced_customization('advanced', 'advancedmodule-' . $key, 'post-type-' . $cpt, true);
     $key++;
     $cpt = 'jigoshop';
     $cpt_title = 'JigoShop';
     ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedmodule-' . $key, $cpt_title);
     ESSBOptionsStructureHelper::field_heading('advanced', 'advancedmodule-' . $key, 'heading1', __('Advanced settings for plugin: ' . $cpt_title, ESSB3_TEXT_DOMAIN));
     essb_prepare_location_advanced_customization('advanced', 'advancedmodule-' . $key, 'post-type-' . $cpt, true);
     $key++;
     $cpt = 'ithemes';
     $cpt_title = 'iThemes Exchange';
     ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedmodule-' . $key, $cpt_title);
     ESSBOptionsStructureHelper::field_heading('advanced', 'advancedmodule-' . $key, 'heading1', __('Advanced settings for plugin: ' . $cpt_title, ESSB3_TEXT_DOMAIN));
     essb_prepare_location_advanced_customization('advanced', 'advancedmodule-' . $key, 'post-type-' . $cpt, true);
     $key++;
     $cpt = 'bbpress';
     $cpt_title = 'bbPress';
     ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedmodule-' . $key, $cpt_title);
     ESSBOptionsStructureHelper::field_heading('advanced', 'advancedmodule-' . $key, 'heading1', __('Advanced settings for plugin: ' . $cpt_title, ESSB3_TEXT_DOMAIN));
     essb_prepare_location_advanced_customization('advanced', 'advancedmodule-' . $key, 'post-type-' . $cpt, true);
     $key++;
     $cpt = 'buddypress';
     $cpt_title = 'BuddyPress';
     ESSBOptionsStructureHelper::submenu_item('advanced', 'advancedmodule-' . $key, $cpt_title);
     ESSBOptionsStructureHelper::field_heading('advanced', 'advancedmodule-' . $key, 'heading1', __('Advanced settings for plugin: ' . $cpt_title, ESSB3_TEXT_DOMAIN));
     essb_prepare_location_advanced_customization('advanced', 'advancedmodule-' . $key, 'post-type-' . $cpt, true);
     $key++;
 }
<?php

//---- quick setup wizard steps
ESSBOptionsStructureHelper::menu_item('quick', 'quick-1', __('1. Template', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-2', __('2. Button Style', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-3', __('3. Social Share Buttons', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-4', __('4. Counters', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-5', __('5. Display Buttons On', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-6', __('6. Position Of Buttons', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-7', __('7. Mobile', ESSB3_TEXT_DOMAIN), 'bolt');
ESSBOptionsStructureHelper::menu_item('quick', 'quick-8', __('8. Final Settings', ESSB3_TEXT_DOMAIN), 'bolt');
//------- wizard menu
ESSBOptionsStructureHelper::field_heading('quick', 'quick-1', 'heading1', __('1. Template', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_func('quick', 'quick-1', 'essb3_options_template_select', __('Template', ESSB3_TEXT_DOMAIN), __('This will be your default theme for site. You are able to select different theme for each post/page.', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_select('quick', 'quick-1', 'css_animations', __('Activate animations', ESSB3_TEXT_DOMAIN), __('Animations
		are provided with CSS transitions and work on best with retina
		templates.', ESSB3_TEXT_DOMAIN), essb_available_animations());
ESSBOptionsStructureHelper::field_heading('quick', 'quick-2', 'heading1', __('2. Button Style', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_image_radio('quick', 'quick-2', 'button_style', __('Buttons Style', ESSB3_TEXT_DOMAIN), __('Select your default button style', ESSB3_TEXT_DOMAIN), essb_available_buttons_style());
ESSBOptionsStructureHelper::field_image_radio('quick', 'quick-2', 'button_pos', __('Buttons Align', ESSB3_TEXT_DOMAIN), __('Choose how buttons
									to be aligned. Default position is left but you can also select
									Right or Center', ESSB3_TEXT_DOMAIN), essb_available_buttons_align());
ESSBOptionsStructureHelper::field_switch('quick', 'quick-2', 'nospace', __('Remove spacing between buttons', ESSB3_TEXT_DOMAIN), __('Activate this option to remove default space between share buttons.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_heading('quick', 'quick-2', 'heading2', __('Buttons width', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_image_radio('quick', 'quick-2', 'button_width', __('Width of buttons', ESSB3_TEXT_DOMAIN), __('Choose between automatic width, pre defined width or display in columns.', ESSB3_TEXT_DOMAIN), essb_available_buttons_width());
ESSBOptionsStructureHelper::field_section_start('quick', 'quick-2', __('Fixed width share buttons', ESSB3_TEXT_DOMAIN), __('Customize the fixed width options', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_textbox('quick', 'quick-2', 'fixed_width_value', __('Custom buttons width', ESSB3_TEXT_DOMAIN), __('Provide custom width of button in pixels without the px symbol.', ESSB3_TEXT_DOMAIN), '', 'input60', 'fa-arrows-h', 'right');
ESSBOptionsStructureHelper::field_select('quick', 'quick-2', 'fixed_width_align', __('Choose alignment of network name', ESSB3_TEXT_DOMAIN), __('Provide different alignment of network name, when fixed button width is activated. When counter position is Inside or Inside name, that alignment will be applied for the counter. Default value is center.', ESSB3_TEXT_DOMAIN), array("" => "Center", "left" => "Left", "right" => "Right"));
ESSBOptionsStructureHelper::field_section_end('quick', 'quick-2');
ESSBOptionsStructureHelper::field_section_start('quick', 'quick-2', __('Full width share buttons', ESSB3_TEXT_DOMAIN), __('Full width option will make buttons to take the width of your post content area.', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_textbox('quick', 'quick-2', 'fullwidth_share_buttons_correction', __('Max width of button on desktop', ESSB3_TEXT_DOMAIN), __('Provide custom width of single button when full width is active. This value is number in percents without the % symbol.', ESSB3_TEXT_DOMAIN), '', 'input60', 'fa-arrows-h', 'right');
ESSBOptionsStructureHelper::submenu_item('social', 'after-share-3', __('Custom HTML Message', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::submenu_item('social', 'after-share-4', __('Custom Code', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::menu_item('social', 'shorturl', __('Short URL', ESSB3_TEXT_DOMAIN), 'bookmark');
//---- display
//---- advanced
ESSBOptionsStructureHelper::menu_item('advanced', 'optimization', __('Optimization Options', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('advanced', 'advanced', __('Advanced Options', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('advanced', 'administrative', __('Administrative Options', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('advanced', 'deactivate', __('Deactivate Functions & Modules', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('advanced', 'counterrecovery', __('Share Counter Recovery', ESSB3_TEXT_DOMAIN), 'sign-in');
ESSBOptionsStructureHelper::menu_item('advanced', 'localization', __('Translate Options', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('style', 'buttons', __('Color Customization', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('style', 'fans', __('Followers Counter Color Customization', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('style', 'image', __('Image Share Color Customization', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('style', 'css', __('Additional CSS', ESSB3_TEXT_DOMAIN), 'default');
ESSBOptionsStructureHelper::menu_item('style', 'css2', __('Additional Footer CSS', ESSB3_TEXT_DOMAIN), 'default');
//ESSBOptionsStructureHelper::menu_item('advanced', 'advancedpost', __('Display Settings by Post Type', ESSB3_TEXT_DOMAIN), 'default');
//ESSBOptionsStructureHelper::menu_item('advanced', 'advancedcat', __('Display Settings by Post Category', ESSB3_TEXT_DOMAIN), 'default');
// -- option fields: social
ESSBOptionsStructureHelper::field_heading('social', 'sharing-11', 'heading1', __('Template', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_func('social', 'sharing-11', 'essb3_options_template_select', __('Template', ESSB3_TEXT_DOMAIN), __('This will be your default theme for site. You are able to select different theme for each post/page.', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_heading('social', 'sharing-12', 'heading1', __('Style', ESSB3_TEXT_DOMAIN));
/*ESSBOptionsStructureHelper::field_select('social', 'sharing-12', 'button_style', __('Buttons Style', ESSB3_TEXT_DOMAIN), __('Select your default button display style.', ESSB3_TEXT_DOMAIN), $essb_avaiable_button_style);
*/
ESSBOptionsStructureHelper::field_image_radio('social', 'sharing-12', 'button_style', __('Buttons Style', ESSB3_TEXT_DOMAIN), __('Select your default button style', ESSB3_TEXT_DOMAIN), essb_available_buttons_style());
/*ESSBOptionsStructureHelper::field_select('social', 'sharing-12', 'button_pos', __('Buttons Align', ESSB3_TEXT_DOMAIN), __('Choose how buttons
									to be aligned. Default position is left but you can also select
									Right or Center', ESSB3_TEXT_DOMAIN), array("" => "Left", "center" => "Center", "right" => "Right"));
*/
ESSBOptionsStructureHelper::field_image_radio('social', 'sharing-12', 'button_pos', __('Buttons Align', ESSB3_TEXT_DOMAIN), __('Choose how buttons
									to be aligned. Default position is left but you can also select