/** * This function is run when the Theme Customizer is loaded. */ function customize_register($wp_customize) { $wp_customize->add_section('epic_us', array('title' => __('Upgrade Epic', 'epic'), 'priority' => 1)); $wp_customize->add_setting('epic_us', array('default' => false, 'type' => 'epic_us')); $wp_customize->add_control(new WP_Customize_US_Control($wp_customize, 'epic_us', array('content' => sprintf(__('<strong>Premium support</strong>, more Customizer options, color schemes, web fonts, and more! %s.', 'epic'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(sds_get_pro_link('customizer')), __('Upgrade to Pro', 'epic'))), 'section' => 'epic_us'))); $wp_customize->get_section('colors')->description = sprintf(__('Looking for more color customizations? %s.', 'epic'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(sds_get_pro_link('customizer-colors')), __('Upgrade to Pro', 'epic'))); }
function sds_theme_options_upgrade_cta($type) { switch ($type) { case 'color-schemes': ?> <p> <?php printf('<a href="%1$s" target="_blank">%2$s</a> %3$s', esc_url(sds_get_pro_link('theme-options-colors')), __('Upgrade to Minimize Pro', 'minimize'), __('and receive more color schemes!', 'minimize')); ?> </p> <?php break; case 'web-fonts': ?> <p> <?php printf('<a href="%1$s" target="_blank">%2$s</a> %3$s', esc_url(sds_get_pro_link('theme-options-fonts')), __('Upgrade to Minimize Pro', 'minimize'), __('to use more web fonts!', 'minimize')); ?> </p> <?php break; case 'help-support': ?> <p> <?php printf('<a href="%1$s" target="_blank">%2$s</a> %3$s', esc_url(sds_get_pro_link('theme-options-help')), __('Upgrade to Minimize Pro', 'minimize'), __('to receive priority ticketing support!', 'minimize')); ?> </p> <?php break; } }
/** * This function renders a metabox. */ function simple_shop_us_metabox($post) { // Get the post type label $post_type = get_post_type_object($post->post_type); $label = isset($post_type->labels->singular_name) ? $post_type->labels->singular_name : __('Post'); echo '<p class="howto">'; printf(__('Looking to configure a unique layout for this %1$s? %2$s.', 'simple-shop'), esc_html(strtolower($label)), sprintf('<a href="%1$s" target="_blank">Upgrade to Pro</a>', esc_url(sds_get_pro_link('metabox-layout-settings')))); echo '</p>'; }
/** * This function registers Customizer components. */ function customize_register($wp_customize) { $wp_customize->add_section('baton_us', array('title' => __('Upgrade Baton', 'baton'), 'priority' => 1)); $wp_customize->add_setting('baton_us', array('default' => false, 'type' => 'baton_us', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control(new SDS_Theme_Options_Customize_US_Control($wp_customize, 'baton_us', array('content' => sprintf(__('Receive <strong>premium support</strong>, individual Customizer options for colors and fonts, and more! %1$s. %2$s %3$s %4$s', 'baton'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(sds_get_pro_link('customizer')), __('Upgrade to Pro', 'baton')), sprintf('<h4>%1$s</h4>', __('Upgrade to Baton Pro to add the following features:', 'baton')), sprintf('<ul class="upgrade-features-list"> <li>%1$s</li> <li>%2$s</li> <li>%3$s</li> <li>%4$s</li> <li>%5$s</li> <li>%6$s</li> </ul>', __('Priority Support', 'baton'), __('Custom Scripts and Styles', 'baton'), __('Individual Color Customisation', 'baton'), __('Individual Font Families and Sizes', 'baton'), __('Header Alignment', 'baton'), __('"Features 2" Baton Note Widget Display', 'baton')), sprintf('<a href="%1$s" class="button button-primary" target="_blank">%2$s</a>', esc_url(sds_get_pro_link('customizer')), __('Upgrade Now!', 'baton'))), 'section' => 'baton_us'))); }
/** * This function handles the rendering of the about page. */ public function sds_about_theme_page() { ?> <div class="wrap about-wrap"> <h1><?php printf(__('Welcome to %1$s', 'baton'), $this->theme->get('Name')); ?> </h1> <div class="about-text sds-about-text"><?php printf(__('Learn more about %1$s on this page.', 'baton'), $this->theme->get('Name')); ?> </div> <h3 class="nav-tab-wrapper sds-theme-options-nav-tab-wrapper sds-theme-options-tab-wrap"> <a href="#getting-started" id="getting-started-tab" class="nav-tab sds-theme-options-tab nav-tab-active"><?php _e('Getting Started', 'baton'); ?> </a> <a href="#free-vs-pro" id="free-vs-pro-tab" class="nav-tab sds-theme-options-tab"><?php _e('Free vs. Pro', 'baton'); ?> </a> <?php do_action('sds_about_page_navigation_tabs'); // Hook for extending tabs ?> </h3> <div id="sds-about-page"> <?php /* * Getting Started */ ?> <div id="getting-started-tab-content" class="sds-theme-options-tab-content sds-theme-options-tab-content-active"> <div class="sds-about-page-section"> <h3><?php printf(__('Welcome to %1$s', 'baton'), $this->theme->get('Name')); ?> </h3> <p><?php _e('Thanks for choosing Slocum Themes. We\'ve created this page to help guide you through setting up your website. We hope that you enjoy our themes.', 'baton'); ?> </p> </div> <div class="sds-about-page-section"> <h3><?php _e('Get Started in the Customizer', 'baton'); ?> </h3> <p><?php printf(__('%1$s utilizes the WordPress Customizer. This means that you can customize everything in one place! Visit the <a href="%2$s">Customizer</a> to get started.', 'baton'), $this->theme->get('Name'), esc_url(wp_customize_url())); ?> </p> <p> <a href="<?php echo esc_url(wp_customize_url()); ?> " class="button button-primary"><?php _e('Launch Customizer', 'baton'); ?> </a> </p> </div> <div class="sds-about-page-section"> <h3><?php _e('General Documentation', 'baton'); ?> </h3> <p><?php printf(__('Be sure to have a look at our <a href="%1$s" target="_blank">General Documentation</a> for helpful guides.', 'baton'), esc_url('https://slocumthemes.com/docs/section/general/')); ?> </p> </div> <div class="sds-about-page-section"> <h3><?php _e('Build the Perfect WordPress Website Course', 'baton'); ?> </h3> <p><?php _e('We created free a 9-part course that will help you build the perfect WordPress website. We cover topics such as: security, lead generation, backups, and more.', 'baton'); ?> </p> <p> <a href="<?php echo esc_url('https://slocumthemes.com/freecourse'); ?> " class="button button-primary" target="_blank"><?php _e('Enroll in the free course', 'baton'); ?> </a> </div> <?php do_action('sds_about_page_getting_started'); ?> </div> <?php /* * Free vs. Pro */ ?> <div id="free-vs-pro-tab-content" class="sds-theme-options-tab-content"> <div class="sds-about-page-section"> <h3><?php _e('Free vs. Pro', 'baton'); ?> </h3> <p><?php printf(__('Use the table below to determine if the Pro version of %1$s is right for you.', 'baton'), $this->theme->get('Name')); ?> </p> <table class="sds-about-page-table free-vs-pro-table"> <tr> <th></th> <th><?php echo $this->theme->get('Name'); ?> </th> <th><?php printf(__('%1$s Pro', 'baton'), $this->theme->get('Name')); ?> </th> </tr> <?php /* * Color Schemes */ // Count number of defined color schemes (ignoring "default") $sds_color_schemes_count = function_exists('sds_color_schemes') ? count(sds_color_schemes()) : 0; // Free color scheme count $free_color_schemes_count = apply_filters('sds_about_page_free_color_schemes_count', $sds_color_schemes_count); // Pro color scheme count $pro_color_schemes_count = apply_filters('sds_about_page_pro_color_schemes_count', 0); ?> <?php if (function_exists('sds_color_schemes') || $pro_color_schemes_count > 0) { ?> <tr> <td class="sds-about-page-free-vs-pro-component"> <h4><?php _e('Color Schemes', 'baton'); ?> </h4> <p> <?php // Free and Pro color schemes if ($free_color_schemes_count > 0 && $pro_color_schemes_count > 0) { printf(__('Both %1$s and %1$s Pro have color schemes.', 'baton'), $this->theme->get('Name')); } else { if ($free_color_schemes_count === 0 && $pro_color_schemes_count > 0) { printf(__('%1$s Pro has color schemes.', 'baton'), $this->theme->get('Name')); } else { if ($free_color_schemes_count > 0 && $pro_color_schemes_count === 0) { printf(__('%1$s has color schemes.', 'baton'), $this->theme->get('Name')); } } } // Free vs Pro color scheme count if ($free_color_schemes_count < $pro_color_schemes_count) { printf(__(' %1$s Pro offers more color schemes for you to choose from.', 'baton'), $this->theme->get('Name')); } ?> </p> </td> <td class="sds-about-page-free-vs-pro-free-component"> <span class="fa <?php echo $free_color_schemes_count > 0 ? 'fa-check' : 'fa-times'; ?> "></span> <?php if ($free_color_schemes_count > 0) { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php printf(_n('%1$s Color Scheme', '%1$s Color Schemes', $free_color_schemes_count, 'baton'), $free_color_schemes_count); ?> </span> <?php } else { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php _e('No Color Schemes', 'baton'); ?> </span> <?php } ?> </td> <td class="sds-about-page-free-vs-pro-pro-component"> <span class="fa <?php echo $pro_color_schemes_count > 0 ? 'fa-check' : 'fa-times'; ?> "></span> <?php if ($pro_color_schemes_count > 0) { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php printf(_n('%1$s Color Scheme', '%1$s Color Schemes', $pro_color_schemes_count, 'baton'), $pro_color_schemes_count); ?> </span> <?php } else { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php _e('No Color Schemes', 'baton'); ?> </span> <?php } ?> </td> </tr> <?php } ?> <?php /* * Web Fonts */ // Count number of defined web fonts $sds_web_fonts_count = function_exists('sds_web_fonts') ? count(sds_web_fonts()) : 0; // Free web font count $free_web_fonts_count = apply_filters('sds_about_page_free_web_fonts_count', $sds_web_fonts_count); // Pro web font count $pro_web_fonts_count = apply_filters('sds_about_page_pro_web_fonts_count', 0); ?> <?php if (function_exists('sds_web_fonts') || $pro_web_fonts_count > 0) { ?> <tr> <td class="sds-about-page-free-vs-pro-component"> <h4><?php _e('Web Fonts', 'baton'); ?> </h4> <p> <?php // Free and Pro web fonts if ($free_web_fonts_count > 0 && $pro_web_fonts_count > 0) { printf(__('Both %1$s and %1$s Pro have web fonts.', 'baton'), $this->theme->get('Name')); } else { if ($free_web_fonts_count === 0 && $pro_web_fonts_count > 0) { printf(__('%1$s Pro has web fonts.', 'baton'), $this->theme->get('Name')); } else { if ($free_web_fonts_count > 0 && $pro_web_fonts_count === 0) { printf(__('%1$s has web fonts.', 'baton'), $this->theme->get('Name')); } } } // Free vs Pro web font count if ($free_web_fonts_count < $pro_web_fonts_count) { printf(__(' %1$s Pro offers more web fonts for you to choose from.', 'baton'), $this->theme->get('Name')); } ?> </p> </td> <td class="sds-about-page-free-vs-pro-free-component"> <span class="fa <?php echo $free_web_fonts_count > 0 ? 'fa-check' : 'fa-times'; ?> "></span> <?php if ($free_web_fonts_count > 0) { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php printf(_n('%1$s Web Font', '%1$s Web Fonts', $free_web_fonts_count, 'baton'), $free_web_fonts_count); ?> </span> <?php } else { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php _e('No Web Fonts', 'baton'); ?> </span> <?php } ?> </td> <td class="sds-about-page-free-vs-pro-pro-component"> <span class="fa <?php echo $pro_web_fonts_count > 0 ? 'fa-check' : 'fa-times'; ?> "></span> <?php if ($pro_web_fonts_count > 0) { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php printf(_n('%1$s Web Font', '%1$s Web Fonts', $pro_web_fonts_count, 'baton'), $pro_web_fonts_count); ?> </span> <?php } else { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php _e('No Web Fonts', 'baton'); ?> </span> <?php } ?> </td> </tr> <?php } ?> <?php /* * Content Layouts */ // Count number of defined content layouts (ignoring "default") $sds_content_layouts_count = function_exists('sds_content_layouts') ? count(sds_content_layouts()) - 1 : 0; // Free content layout count $free_content_layouts_count = apply_filters('sds_about_page_free_content_layouts_count', $sds_content_layouts_count); // Pro content layout count $pro_content_layouts_count = apply_filters('sds_about_page_pro_content_layouts_count', 0); ?> <?php if (function_exists('sds_content_layouts') || $pro_content_layouts_count > 0) { ?> <tr> <td class="sds-about-page-free-vs-pro-component"> <h4><?php _e('Content Layouts', 'baton'); ?> </h4> <p> <?php // Free and Pro content layouts if ($free_content_layouts_count > 0 && $pro_content_layouts_count > 0) { printf(__('Both %1$s and %1$s Pro have content layouts.', 'baton'), $this->theme->get('Name')); } else { if ($free_content_layouts_count === 0 && $pro_content_layouts_count > 0) { printf(__('%1$s Pro has content layouts.', 'baton'), $this->theme->get('Name')); } else { if ($free_content_layouts_count > 0 && $pro_content_layouts_count === 0) { printf(__('%1$s has content layouts.', 'baton'), $this->theme->get('Name')); } } } // Free vs Pro content layout count if ($free_content_layouts_count < $pro_content_layouts_count) { printf(__(' %1$s Pro offers more content layouts for you to choose from.', 'baton'), $this->theme->get('Name')); } ?> </p> </td> <td class="sds-about-page-free-vs-pro-free-component"> <span class="fa <?php echo $free_content_layouts_count > 0 ? 'fa-check' : 'fa-times'; ?> "></span> <?php if ($free_content_layouts_count > 0) { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php printf(_n('%1$s Content Layout', '%1$s Content Layouts', $free_content_layouts_count, 'baton'), $free_content_layouts_count); ?> </span> <?php } else { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php _e('No Content Layouts', 'baton'); ?> </span> <?php } ?> </td> <td class="sds-about-page-free-vs-pro-pro-component"> <span class="fa <?php echo $pro_content_layouts_count > 0 ? 'fa-check' : 'fa-times'; ?> "></span> <?php if ($pro_content_layouts_count > 0) { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php printf(_n('%1$s Content Layout', '%1$s Content Layouts', $pro_content_layouts_count, 'baton'), $pro_content_layouts_count); ?> </span> <?php } else { ?> <br /> <span class="sds-about-page-free-vs-pro-desc"><?php _e('No Content Layouts', 'baton'); ?> </span> <?php } ?> </td> </tr> <?php } ?> <?php /* * Priority Support */ ?> <tr> <td class="sds-about-page-free-vs-pro-component"> <h4><?php _e('Priority Support', 'baton'); ?> </h4> <p><?php printf(__('Get priority helpdesk support by upgrading to %1$s Pro.', 'baton'), $this->theme->get('Name')); ?> </p> </td> <td class="sds-about-page-free-vs-pro-free-component"> <span class="fa fa-times"></span> </td> <td class="sds-about-page-free-vs-pro-pro-component"> <span class="fa fa-check"></span> </td> </tr> <?php /* * Footer Copyright & Branding */ ?> <tr> <td class="sds-about-page-free-vs-pro-component"> <h4><?php _e('Footer Copyright & Branding', 'baton'); ?> </h4> <p><?php _e('Adjust footer copyright & branding messages in the Customizer.', 'baton'); ?> </p> </td> <td class="sds-about-page-free-vs-pro-free-component"> <span class="fa fa-times"></span> </td> <td class="sds-about-page-free-vs-pro-pro-component"> <span class="fa fa-check"></span> </td> </tr> <?php /* * Custom Scripts and Styles */ ?> <tr> <td class="sds-about-page-free-vs-pro-component"> <h4><?php _e('Custom Scripts and Styles', 'baton'); ?> </h4> <p><?php _e('Add custom scripts and custom CSS styles to your site.', 'baton'); ?> </p> </td> <td class="sds-about-page-free-vs-pro-free-component"> <span class="fa fa-times"></span> </td> <td class="sds-about-page-free-vs-pro-pro-component"> <span class="fa fa-check"></span> </td> </tr> <?php do_action('sds_about_page_free_vs_pro_table'); ?> </table> </div> <div class="sds-about-page-section sds-about-page-section-free-vs-pro-upgrade sds-about-page-section-center"> <p> <a href="<?php echo esc_url(function_exists('sds_get_pro_link') ? sds_get_pro_link('free-vs-pro-upgrade') : 'https://slocumthemes.com/'); ?> " class="button button-primary" target="_blank"><?php printf(__('Upgrade to %1$s Pro!', 'baton'), $this->theme->get('Name')); ?> </a> </p> </div> <?php do_action('sds_about_page_free_vs_pro'); ?> </div> <?php do_action('sds_about_page_content'); // Hook for extending content ?> </div> <div id="sds-theme-options-ads" class="sidebar"> <?php do_action('sds_theme_options_ads'); ?> <div class="sds-theme-options-ad"> <div class="slocum-themes"> <?php printf(__('Brought to you by <a href="%1$s" target="_blank">Slocum Themes</a>', 'baton'), 'http://slocumthemes.com/'); ?> </div> </div> </div> </div> <?php }
function sds_theme_options_ads() { ?> <div class="sds-theme-options-ad"> <a href="<?php echo esc_url(sds_get_pro_link('theme-options-ad')); ?> " target="_blank" class="sds-theme-options-upgrade-ad"> <h3><?php _e('Upgrade to Baton Pro!', 'baton'); ?> </h3> <ul> <li><?php _e('Priority Ticketing Support', 'baton'); ?> </li> <li><?php _e('More Color Schemes', 'baton'); ?> </li> <li><?php _e('More Web Fonts', 'baton'); ?> </li> <li><?php _e('Adjust Featured Image Sizes', 'baton'); ?> </li> <li><?php _e('Easily Add Custom Scripts/Styles', 'baton'); ?> </li> <li><?php _e('and More!', 'baton'); ?> </li> </ul> <span class="sds-theme-options-btn-green"><?php _e('Upgrade Now!', 'baton'); ?> </span> </a> </div> <div class="sds-theme-options-ad"> <a href="<?php echo esc_url('http://conductorplugin.com/slocum-themes/'); ?> " target="_blank" class="sds-theme-options-upgrade-ad sds-theme-options-upgrade-ad-dark-gray"> <h3><?php _e('Introducing Conductor Plugin', 'baton'); ?> </h3> <ul> <li><?php _e('Custom Layouts', 'baton'); ?> </li> <li><?php _e('Custom Content Displays', 'baton'); ?> </li> <li><?php _e('No Code Required!', 'baton'); ?> </li> </ul> <span class="sds-theme-options-btn-yellow"><?php _e('Get Conductor!', 'baton'); ?> </span> </a> </div> <div class="sds-theme-options-ad"> <?php printf(__('Please rate <strong>Baton</strong> <a href="%1$s" target="_blank">★★★★★</a> on <a href="%1$s" target="_blank">WordPress.org</a>.', 'baton'), 'https://wordpress.org/support/view/theme-reviews/baton?filter=5'); ?> </div> <?php }
/** * This function registers various Customizer options for this theme. */ function customize_register($wp_customize) { $wp_customize->add_section('simple_shop_us', array('title' => __('Upgrade Simple Shop', 'simple-shop'), 'priority' => 1)); $wp_customize->add_setting('simple_shop_us', array('default' => false, 'type' => 'simple_shop_us', 'sanitize_callback' => 'sanitize_text_field')); $wp_customize->add_control(new WP_Customize_US_Control($wp_customize, 'simple_shop_us', array('content' => sprintf(__('<strong>Premium support</strong>, more Customizer options, typography adjustments, and more! %s.', 'simple-shop'), sprintf('<a href="%1$s" target="_blank">%2$s</a>', esc_url(sds_get_pro_link('customizer')), __('Upgrade to Pro', 'simple-shop'))), 'section' => 'simple_shop_us'))); /** * General Settings */ if ($this->version_compare('4.0')) { /* * General Settings Panel */ $wp_customize->add_panel('simple_shop_general_design', array('priority' => 10, 'title' => __('General Settings', 'simple-shop'))); /** * Logo/Site Title & Tagline Section */ $title_tagline_section = $wp_customize->get_section('title_tagline'); // Get Section $title_tagline_section->panel = 'simple_shop_general_design'; // Add panel $title_tagline_section->priority = 10; // Adjust Priority /** * Static Front Page Section */ $static_front_page_section = $wp_customize->get_section('static_front_page'); // Get Section $static_front_page_section->panel = 'simple_shop_general_design'; // Add panel $static_front_page_section->priority = 20; // Adjust Priority /** * Nav Section */ $static_front_page_section = $wp_customize->get_section('nav'); // Get Section $static_front_page_section->panel = 'simple_shop_general_design'; // Add panel $static_front_page_section->priority = 30; // Adjust Priority } /** * Background Color & Image Panel */ if ($this->version_compare('4.0')) { /* * Background Color & Image Panel */ $wp_customize->add_panel('simple_shop_colors_and_background', array('priority' => 20, 'title' => __('Colors & Background', 'simple-shop'))); /** * Body Background Section */ $wp_customize->add_section('simple_shop_background_body', array('priority' => 10, 'title' => __('Body', 'simple-shop'), 'panel' => 'simple_shop_colors_and_background')); /** * Background Color */ $background_color_control = $wp_customize->get_control('background_color'); // Get Control $background_color_control->section = 'simple_shop_background_body'; // Adjust Section $background_color_control->priority = 10; // Adjust Priority /** * Background Image */ $background_image_control = $wp_customize->get_control('background_image'); // Get Control $background_image_control->section = 'simple_shop_background_body'; // Adjust Section $background_image_control->priority = 20; // Adjust Priority $wp_customize->remove_section('background_image'); // Remove Section /** * Background Repeat */ $background_repeat_control = $wp_customize->get_control('background_repeat'); // Get Control $background_repeat_control->section = 'simple_shop_background_body'; // Adjust Section $background_repeat_control->priority = 30; // Adjust Priority /** * Background Position X */ $background_position_x_control = $wp_customize->get_control('background_position_x'); // Get Control $background_position_x_control->section = 'simple_shop_background_body'; // Adjust Section $background_position_x_control->priority = 40; // Adjust Priority /** * Background Attachment */ $background_attachment_control = $wp_customize->get_control('background_attachment'); // Get Control $background_attachment_control->section = 'simple_shop_background_body'; // Adjust Section $background_attachment_control->priority = 50; // Adjust Priority } /** * Colors Section */ $colors_section = $wp_customize->get_section('colors'); // Get Section $colors_section->title = __('Primary Theme Color', 'simple-shop'); // Adjust Title $colors_section->panel = 'simple_shop_colors_and_background'; // Adjust Panel $colors_section->priority = 10; // Adjust Priority (Top) /** * Primary Theme Color */ // Setting $wp_customize->add_setting('primary_color', array('default' => apply_filters('theme_mod_primary_color', ''), 'sanitize_callback' => 'sanitize_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color')); // Control $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'primary_color', array('label' => __('Primary Theme Color', 'simple-shop'), 'section' => 'colors', 'settings' => 'primary_color', 'priority' => 10))); /* * Content Color (remove; registered in SDS Core) */ $wp_customize->remove_control('content_color'); // TODO: below 4.0 support }