Пример #1
0
 function set_fields()
 {
     $getSocial = builtpress_get_socials();
     $social_opts = array();
     foreach ($getSocial as $k => $v) {
         $social_opts[$k] = $v[1];
     }
     $fields['title'] = array('type' => 'text', 'label' => esc_html__('Title', 'builtpress'));
     $fields['social_show'] = array('type' => 'checkbox', 'label' => esc_html__('Social Icon?', 'builtpress'), 'options' => $social_opts);
     $this->fields = $fields;
 }
 function builtpress_theme_socials($socials = '')
 {
     $getSocial = builtpress_get_socials();
     $social_url = builtpress_opt('social_url');
     $social_show = !empty($socials) ? $socials : builtpress_opt('header_social_show');
     echo '<div class="st-social">';
     echo '<ul class="list-inline">';
     foreach ($getSocial as $k => $v) {
         if (isset($social_show[$k]) && $social_show[$k] == 1) {
             printf('<li><a class="fa fa-%s" href="%s" title="%s" target="_blank"></a></li>', $v[0], esc_url($social_url[$k]), $v[1]);
         }
     }
     echo '</ul>';
     echo '</div>';
 }
Пример #3
0
 * All the possible arguments for Redux.
 * For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments
 * */
$theme = wp_get_theme();
// For use with some settings. Not necessary.
$args = array('opt_name' => $opt_name, 'display_name' => $theme->get('Name'), 'display_version' => $theme->get('Version'), 'menu_type' => 'submenu', 'allow_sub_menu' => true, 'menu_title' => esc_html__('Theme Options', 'builtpress'), 'page_title' => esc_html__('Theme Options', 'builtpress'), 'google_api_key' => '', 'google_update_weekly' => false, 'async_typography' => true, 'admin_bar' => true, 'admin_bar_icon' => 'dashicons-portfolio', 'admin_bar_priority' => 50, 'global_variable' => 'get_theme_opt', 'dev_mode' => false, 'forced_dev_mode_off' => true, 'update_notice' => false, 'customizer' => true, 'page_priority' => null, 'page_parent' => 'themes.php', 'page_permissions' => 'manage_options', 'menu_icon' => '', 'last_tab' => '', 'page_icon' => 'icon-themes', 'page_slug' => '', 'save_defaults' => true, 'default_show' => false, 'default_mark' => '', 'show_import_export' => true, 'transient_time' => 60 * MINUTE_IN_SECONDS, 'output' => true, 'output_tag' => true, 'footer_credit' => ' ', 'database' => '', 'use_cdn' => true, 'hints' => array('icon' => 'el el-question-sign', 'icon_position' => 'right', 'icon_color' => 'lightgray', 'icon_size' => 'normal', 'tip_style' => array('color' => 'red', 'shadow' => true, 'rounded' => false, 'style' => ''), 'tip_position' => array('my' => 'top left', 'at' => 'bottom right'), 'tip_effect' => array('show' => array('effect' => 'slide', 'duration' => '500', 'event' => 'mouseover'), 'hide' => array('effect' => 'slide', 'duration' => '500', 'event' => 'click mouseleave'))));
Redux::setArgs($opt_name, $args);
/*
 * ---> END ARGUMENTS
 */
/*
 *
 * ---> START Helpers
 *
 */
$getSocial = builtpress_get_socials();
$social_opts = array();
$social_vals = array();
foreach ($getSocial as $k => $v) {
    $social_opts[$k] = esc_attr($v[1]);
    $social_vals[$k] = '#';
}
// -> START Basic Fields
// -> START General
Redux::setSection($opt_name, array('title' => esc_html__('General', 'builtpress'), 'id' => 'general-options', 'desc' => '', 'icon' => 'el el-cog', 'fields' => array(array('id' => 'site_favicon', 'type' => 'media', 'url' => false, 'default' => '', 'title' => esc_html__('Custom Favicon', 'builtpress'), 'subtitle' => esc_html__('Upload your favicon file here.', 'builtpress')), array('id' => 'site_logo', 'type' => 'media', 'url' => false, 'default' => '', 'title' => esc_html__('Custom Logo', 'builtpress'), 'subtitle' => esc_html__('Upload your logo file here.', 'builtpress')), array('id' => 'site_logo_transparent', 'type' => 'media', 'url' => false, 'default' => '', 'title' => esc_html__('Custom Logo Transparent', 'builtpress'), 'subtitle' => esc_html__('Upload your logo file here.', 'builtpress')), array('id' => 'site_layout', 'type' => 'button_set', 'options' => array('wide' => 'Full Width', 'boxed' => 'Boxed'), 'default' => 'wide', 'title' => esc_html__('Layout Theme', 'builtpress'), 'subtitle' => esc_html__('Only available for header style "horizontal".', 'builtpress')))));
// -> START Header
Redux::setSection($opt_name, array('title' => esc_html__('Header', 'builtpress'), 'id' => 'header-options', 'icon' => 'el el-file'));
Redux::setSection($opt_name, array('title' => esc_html__('Header Area', 'builtpress'), 'id' => 'header-area', 'subsection' => true, 'fields' => array(array('id' => 'header_style', 'type' => 'select', 'options' => array('v1' => 'Default', 'v2' => 'Centered'), 'default' => 'v1', 'title' => esc_html__('Header Style', 'builtpress'), 'subtitle' => ''), array('id' => 'header_transparent', 'type' => 'switch', 'required' => array('header_style', '=', 'v1'), 'default' => false, 'title' => esc_html__('Header Transparent', 'builtpress'), 'subtitle' => esc_html__('Only available on header style "default".', 'builtpress')), array('id' => 'header_sticky', 'type' => 'switch', 'default' => true, 'title' => esc_html__('Header Sticky', 'builtpress'), 'subtitle' => ''), array('id' => 'divider-' . uniqid(), 'type' => 'divide'), array('id' => 'header_info', 'type' => 'text', 'options' => array('label_1' => 'Info #1 Label', 'value_1' => 'Info #1 Value', 'label_2' => 'Info #2 Label', 'value_2' => 'Info #2 Value'), 'default' => array('label_1' => '', 'value_1' => '', 'label_2' => '', 'value_2' => ''), 'title' => esc_html__('Header Info', 'builtpress'), 'subtitle' => ''), array('id' => 'header_button_link', 'type' => 'select', 'data' => 'pages', 'default' => '', 'title' => esc_html__('Header Button Link', 'builtpress')), array('id' => 'header_button_value', 'type' => 'text', 'default' => '', 'title' => esc_html__('Header Button Value', 'builtpress'), 'subtitle' => ''), array('id' => 'header_search', 'type' => 'switch', 'default' => true, 'title' => esc_html__('Search Form', 'builtpress'), 'subtitle' => esc_html__('Enable / disable search form.', 'builtpress')))));
// -> START Top Bar
Redux::setSection($opt_name, array('title' => esc_html__('Top Bar Area', 'builtpress'), 'id' => 'topbar-area', 'subsection' => true, 'fields' => array(array('id' => 'topbar_enable', 'type' => 'switch', 'default' => true, 'title' => esc_html__('Top Bar', 'builtpress'), 'subtitle' => esc_html__('Enable / disable top bar area.', 'builtpress')), array('id' => 'topbar_info', 'type' => 'text', 'options' => array('label_1' => 'Info #1 Label', 'value_1' => 'Info #1 Value', 'label_2' => 'Info #2 Label', 'value_2' => 'Info #2 Value'), 'default' => array('label_1' => '', 'value_1' => '', 'label_2' => '', 'value_2' => ''), 'title' => esc_html__('Top Bar Info', 'builtpress'), 'subtitle' => ''), array('id' => 'topbar_social', 'type' => 'switch', 'default' => true, 'title' => esc_html__('Social Icons', 'builtpress'), 'subtitle' => esc_html__('Enable / disable social icon.', 'builtpress')), array('id' => 'topbar_social_show', 'type' => 'checkbox', 'required' => array('topbar_social', '=', true), 'options' => $social_opts, 'title' => esc_html__('Social Icon?', 'builtpress'), 'subtitle' => esc_html__('Which icon should display? the social icon url will be take from Social Media setting tab.', 'builtpress')))));
// -> START Title