Make WordPress Themes

Changeset 334689


Ignore:
Timestamp:
06/21/2026 03:03:25 AM (4 months ago)
Author:
themedropbox
Message:

New version of Blogus - 3.0.1

Location:
blogus/3.0.1
Files:
6 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • blogus/3.0.1/css/colors/theme-options-color.php

    r331247 r334689  
    108108                }
    109109        }
     110        $blogus_custom_css .= '@media (max-width: 575px) { [displayON="desktop,tablet"] { display: none !important;} [displayON="tablet"] { display: none !important;}}';
     111
     112        $blogus_custom_css .= '@media (min-width: 576px) { [displayON="mobile"] { display: none !important;}}';
     113
     114        $blogus_custom_css .= '@media (min-width: 992px) { [displayON="tablet,mobile"] { display: none !important;} [displayON="tablet"] { display: none !important;}   }';
     115
     116        $blogus_custom_css .= '@media (max-width: 991px) { [displayON="desktop"] { display: none !important;}}';
     117
     118        $blogus_custom_css .= '@media (max-width: 991px) and (min-width: 576px) { [displayON="desktop,mobile"] { display: none !important;}     }';
    110119       
    111120    if ( ! empty( $blogus_custom_css ) ) {
  • blogus/3.0.1/inc/ansar/custom-control/custom-control.php

    r331247 r334689  
    1111    require_once  get_template_directory() . '/inc/ansar/custom-control/custom_tab_control/custom_tab_control_class.php';
    1212    require_once  get_template_directory() . '/inc/ansar/custom-control/dimension-control/dimension_control_class.php';
     13    require_once  get_template_directory() . '/inc/ansar/custom-control/button-group/button_group_class.php';
    1314
    1415    $wp_customize->register_control_type( 'blogus_Toggle_Control' );
    1516
    1617    $wp_customize->register_control_type( 'Dimension_Custom_Control' );
     18   
     19    $wp_customize->register_control_type( 'Blogus_Button_Group_Control' );
    1720
    1821}
  • blogus/3.0.1/inc/ansar/custom-control/dimension-control/css/dimension.css

    r331247 r334689  
    4545}
    4646.customize-control-dimensions .responsive-switchers button.switch-device .dashicons {
    47     font-size: 13px;
    48     width: 13px;
    49     height: 13px;
     47    font-size: 17px;
     48    width: 17px;
     49    height: 17px;
    5050    line-height: 1;
    51 } 
     51}
    5252.customize-control-dimensions .responsive-switchers button.switch-device:hover,
    5353.customize-control-dimensions .responsive-switchers button.switch-device.active {
    … …  
    6161}
    6262.customize-control-dimensions .unit-wrapper .input-wrapper select.dimension-unit {
    63     font-size: 10px;
     63    font-size: 12px;
    6464    font-weight: 600;
    6565    text-transform: uppercase;
    … …  
    136136    height: auto;
    137137    transition: border-color 0.1s, background 0.1s, box-shadow 0.1s;
     138    line-height: 1;
     139    min-height: 38px;
    138140}
    139141.customize-control-dimensions .blogus-dimension-wrapper .wrapper .control label input[type="number"]:focus {
  • blogus/3.0.1/inc/ansar/customize/customizer-default.php

    r331247 r334689  
    1818
    1919    $defaults = array();
     20
     21    $defaults['blogus_menu_search'] = array( 'desktop', 'tablet', 'mobile' );
     22    $defaults['blogus_menu_subscriber'] = array( 'desktop' );
     23    $defaults['blogus_lite_dark_switcher'] = array( 'desktop' );
    2024
    2125    // Frontpage Section.
  • blogus/3.0.1/inc/ansar/customize/customizer-sanitize.php

    r331247 r334689  
    202202    }
    203203}
     204
     205/**
     206 * Sanitization callback logic for array/comma multi-choose selections.
     207 *
     208 * @param array|string $input Selected choices passed from Customizer engine.
     209 * @return array              Filtered list of verified active keys.
     210 */
     211function blogus_sanitize_multi_choose( $input ) {
     212    if ( is_string( $input ) ) {
     213        $input = explode( ',', $input );
     214    }
     215   
     216    // Whitelist covering all of your breakpoints and alignments across controls
     217    $valid_choices = array( 'desktop', 'tablet', 'mobile' );
     218    $sanitized     = array();
     219
     220    if ( is_array( $input ) ) {
     221        foreach ( $input as $value ) {
     222            $value = sanitize_key( $value );
     223            if ( in_array( $value, $valid_choices, true ) ) {
     224                $sanitized[] = $value;
     225            }
     226        }
     227    }
     228    return $sanitized;
     229}
  • blogus/3.0.1/inc/ansar/customize/customizer.php

    r331247 r334689  
    175175            'render_callback' => 'blogus_customize_blogus_related_post_title',
    176176        ));
    177 
    178         $wp_customize->selective_refresh->add_partial('blogus_menu_search', array(
    179             'selector'        => '.bs-default .desk-header .msearch',
    180             'render_callback' => 'blogus_customize_partial_blogus_menu_search',
    181         ));
    182177       
    183178        $wp_customize->selective_refresh->add_partial('blogus_lite_dark_switcher', array(
    … …  
    192187            'selector'        => '.info-right.right-nav',
    193188            'render_callback' => 'blogus_customize_partial_right_nav',
    194         ));
    195         $wp_customize->selective_refresh->add_partial('blogus_menu_search', array(
    196             'selector'        => '.info-right.right-nav',
    197             'render_callback' => 'blogus_customize_partial_right_nav',
    198         ));
    199         $wp_customize->selective_refresh->add_partial('blogus_menu_subscriber', array(
    200             'selector'        => '.info-right.right-nav',
    201             'render_callback' => 'blogus_customize_partial_right_nav',
    202         ));
    203        
     189        ));       
    204190        $wp_customize->selective_refresh->add_partial('blogus_footer_copyright', array(
    205191            'selector'        => '.bs-footer-copyright p.mb-0 .copyright-text',
    … …  
    355341function blogus_customize_partial_sidebar_menu() {
    356342    return get_theme_mod( 'sidebar_menu' );
    357 }
    358 
    359 function blogus_customize_partial_blogus_menu_subscriber() {
    360     return get_theme_mod( 'blogus_menu_subscriber' );
    361343}
    362344
  • blogus/3.0.1/inc/ansar/customize/header-options.php

    r276933 r334689  
    11<?php
     2$blogus_default = blogus_get_default_theme_options();
    23// Add Header Options Panel.
    34$wp_customize->add_panel('header_option_panel',
    … …  
    123124);
    124125
    125 $wp_customize->add_setting('blogus_menu_search',
    126     array(
    127         'default' => true,
    128         'sanitize_callback' => 'blogus_sanitize_checkbox',
    129         'transport' => 'postMessage',
    130     )
    131 );
    132 $wp_customize->add_control(new Blogus_Toggle_Control( $wp_customize, 'blogus_menu_search',
    133     array(
    134         'label' => esc_html__('Hide / Show Search', 'blogus'),
    135         'type' => 'toggle',
    136         'section' => 'menu_options',
    137     )
    138 ));
    139 
    140 $wp_customize->add_setting('blogus_menu_subscriber',
    141     array(
    142         'default' => true,
    143         'sanitize_callback' => 'blogus_sanitize_checkbox',
    144         'transport' => 'postMessage',
    145     )
    146 );
    147 $wp_customize->add_control(new Blogus_Toggle_Control( $wp_customize, 'blogus_menu_subscriber',
    148     array(
    149         'label' => esc_html__('Hide / Show Subscribe Button', 'blogus'),
    150         'type' => 'toggle',
    151         'section' => 'menu_options',
    152     )
    153 ));
    154 
     126$wp_customize->add_setting( 'blogus_menu_search', array(
     127    'default'           => $blogus_default['blogus_menu_search'],
     128    'sanitize_callback' => 'blogus_sanitize_multi_choose',
     129    'transport'         => 'postMessage',
     130) );
     131
     132$wp_customize->add_control( new Blogus_Button_Group_Control( $wp_customize, 'blogus_menu_search', array(
     133    'label'       => __( 'Search', 'blogus' ),
     134    'section'     => 'menu_options',
     135    'choices'     => array(
     136        'desktop' => array(
     137            'title' => __( 'On Desktop', 'blogus' ),
     138            'icon'  => 'dashicons dashicons-desktop',
     139        ),
     140        'tablet' => array(
     141            'title' => __( 'On Tablet', 'blogus' ),
     142            'icon'  => 'dashicons dashicons-tablet',
     143        ),
     144        'mobile' => array(
     145            'title' => __( 'On Mobile', 'blogus' ),
     146            'icon'  => 'dashicons dashicons-smartphone',
     147        ),
     148    ),
     149) ) );
     150
     151$wp_customize->add_setting( 'blogus_menu_subscriber', array(
     152    'default'           => $blogus_default['blogus_menu_subscriber'],
     153    'sanitize_callback' => 'blogus_sanitize_multi_choose',
     154    'transport'         => 'postMessage',
     155) );
     156
     157$wp_customize->add_control( new Blogus_Button_Group_Control( $wp_customize, 'blogus_menu_subscriber', array(
     158    'label'       => __( 'Subscribe Button', 'blogus' ),
     159    'section'     => 'menu_options',
     160    'choices'     => array(
     161        'desktop' => array(
     162            'title' => __( 'On Desktop', 'blogus' ),
     163            'icon'  => 'dashicons dashicons-desktop',
     164        ),
     165        'tablet' => array(
     166            'title' => __( 'On Tablet', 'blogus' ),
     167            'icon'  => 'dashicons dashicons-tablet',
     168        ),
     169        'mobile' => array(
     170            'title' => __( 'On Mobile', 'blogus' ),
     171            'icon'  => 'dashicons dashicons-smartphone',
     172        ),
     173    ),
     174) ) );
    155175$wp_customize->add_setting('blogus_subsc_link',
    156176    array(
    … …  
    183203    )
    184204));
    185 
    186 $wp_customize->add_setting('blogus_lite_dark_switcher',
    187     array(
    188         'default' => true,
    189         'sanitize_callback' => 'blogus_sanitize_checkbox',
    190         'transport' => 'postMessage',
    191     )
    192 );
    193 $wp_customize->add_control(new Blogus_Toggle_Control( $wp_customize, 'blogus_lite_dark_switcher',
    194     array(
    195         'label' => esc_html__('Hide / Show Dark and Lite Mode Switcher', 'blogus'),
    196         'type' => 'toggle',
    197         'section' => 'menu_options',
    198     )
    199 )); 
     205$wp_customize->add_setting( 'blogus_lite_dark_switcher', array(
     206    'default'           => $blogus_default['blogus_lite_dark_switcher'],
     207    'sanitize_callback' => 'blogus_sanitize_multi_choose',
     208    'transport'         => 'postMessage',
     209) );
     210$wp_customize->add_control( new Blogus_Button_Group_Control( $wp_customize, 'blogus_lite_dark_switcher', array(
     211    'label'       => __( 'Dark and Lite Mode Switcher', 'blogus' ),
     212    'section'     => 'menu_options',
     213    'choices'     => array(
     214        'desktop' => array(
     215            'title' => __( 'On Desktop', 'blogus' ),
     216            'icon'  => 'dashicons dashicons-desktop',
     217        ),
     218        'tablet' => array(
     219            'title' => __( 'On Tablet', 'blogus' ),
     220            'icon'  => 'dashicons dashicons-tablet',
     221        ),
     222        'mobile' => array(
     223            'title' => __( 'On Mobile', 'blogus' ),
     224            'icon'  => 'dashicons dashicons-smartphone',
     225        ),
     226    ),
     227) ) );
  • blogus/3.0.1/inc/ansar/hooks/blocks/header/header-one.php

    r276933 r334689  
    2929              <div class="col-md-3">
    3030                <div class="info-right right-nav d-flex align-items-center justify-content-center justify-content-md-end">
    31                  <?php blogus_menu_btns(); ?>             
     31                 <?php blogus_menu_btns(); ?>
    3232                </div>
    3333              </div>
    … …  
    6161                </div>
    6262                <div class="right-nav">
    63                   <!-- /navbar-toggle -->
    64                   <?php $blogus_menu_search  = get_theme_mod('blogus_menu_search','true');
    65                   if($blogus_menu_search == true) { ?>
    66                     <a class="msearch ml-auto" href="#" data-bs-target="#exampleModal" data-bs-toggle="modal"> <i class="fa fa-search"></i> </a>
    67                   <?php } ?>
     63                 <?php blogus_menu_btns(); ?>
    6864                </div>
    6965            </div>
  • blogus/3.0.1/inc/ansar/template-functions.php

    r331247 r334689  
    400400
    401401if ( ! function_exists( 'blogus_dimension_css' ) ) {
    402 
    403402    function blogus_dimension_css( $selector, $default_value, $output_value, $property ) {
    404403
    … …  
    410409            $output_value = json_decode( $output_value, true );
    411410        }
     411
    412412        if ( ! is_array( $default_value ) ) {
    413413            $default_value = json_decode( $default_value, true );
    … …  
    426426            $device_value   = isset( $output_value[ $device ] ) && is_array( $output_value[ $device ] ) ? $output_value[ $device ] : array();
    427427            $device_default = isset( $default_value[ $device ] ) && is_array( $default_value[ $device ] ) ? $default_value[ $device ] : array();
    428             $values         = wp_parse_args( $device_value, $device_default );
    429 
    430             $t = isset( $values['top'] )    && $values['top']    !== '' ? esc_attr( $values['top'] )    : '';
    431             $r = isset( $values['right'] )  && $values['right']  !== '' ? esc_attr( $values['right'] )  : '';
    432             $b = isset( $values['bottom'] ) && $values['bottom'] !== '' ? esc_attr( $values['bottom'] ) : '';
    433             $l = isset( $values['left'] )   && $values['left']   !== '' ? esc_attr( $values['left'] )   : '';
     428
     429            $values = wp_parse_args( $device_value, $device_default );
     430
     431            $t = isset( $values['top'] ) ? trim( $values['top'] ) : '';
     432            $r = isset( $values['right'] ) ? trim( $values['right'] ) : '';
     433            $b = isset( $values['bottom'] ) ? trim( $values['bottom'] ) : '';
     434            $l = isset( $values['left'] ) ? trim( $values['left'] ) : '';
    434435
    435436            if ( $t === '' && $r === '' && $b === '' && $l === '' ) {
    … …  
    437438            }
    438439
    439             $unit = isset( $values['unit'] ) && $values['unit'] !== '' ? $values['unit'] : 'px';
    440 
    441             if ( $t === $r && $r === $b && $b === $l ) {
    442                 $shorthand = $t . $unit;
    443             } elseif ( $t === $b && $r === $l ) {
    444                 $shorthand = $t . $unit . ' ' . $r . $unit;
    445             } elseif ( $r === $l ) {
    446                 $shorthand = $t . $unit . ' ' . $r . $unit . ' ' . $b . $unit;
     440            $unit = isset( $values['unit'] ) && ! empty( $values['unit'] ) ? $values['unit'] : 'px';
     441
     442            $rule = '';
     443
     444            // All values are present → use shorthand.
     445            if ( $t !== '' && $r !== '' && $b !== '' && $l !== '' ) {
     446
     447                if ( $t === $r && $r === $b && $b === $l ) {
     448                    $shorthand = $t . $unit;
     449                } elseif ( $t === $b && $r === $l ) {
     450                    $shorthand = $t . $unit . ' ' . $r . $unit;
     451                } elseif ( $r === $l ) {
     452                    $shorthand = $t . $unit . ' ' . $r . $unit . ' ' . $b . $unit;
     453                } else {
     454                    $shorthand = $t . $unit . ' ' . $r . $unit . ' ' . $b . $unit . ' ' . $l . $unit;
     455                }
     456
     457                $rule = $selector . ' { ' . $property . ': ' . $shorthand . ' !important; }';
     458
    447459            } else {
    448                 $shorthand = $t . $unit . ' ' . $r . $unit . ' ' . $b . $unit . ' ' . $l . $unit;
    449             }
    450 
    451             $rule = $selector . ' { ' . $property . ': ' . $shorthand . ' !important; }';
     460
     461                // Partial values → use individual properties.
     462                $properties = '';
     463
     464                if ( $t !== '' ) {
     465                    $properties .= $property . '-top:' . $t . $unit . ' !important;';
     466                }
     467
     468                if ( $r !== '' ) {
     469                    $properties .= $property . '-right:' . $r . $unit . ' !important;';
     470                }
     471
     472                if ( $b !== '' ) {
     473                    $properties .= $property . '-bottom:' . $b . $unit . ' !important;';
     474                }
     475
     476                if ( $l !== '' ) {
     477                    $properties .= $property . '-left:' . $l . $unit . ' !important;';
     478                }
     479
     480                $rule = $selector . ' { ' . $properties . ' }';
     481            }
    452482
    453483            if ( ! empty( $media_query ) ) {
    … …  
    462492}
    463493
     494function blogus_get_multi_choices( $setting_id ) {
     495    // 1. Grab value/default directly using your custom function
     496    $saved_value = blogus_get_option( $setting_id );
     497
     498    // 2. If it's an array, flatten it to a comma-separated string
     499    if ( is_array( $saved_value ) ) {
     500        return implode( ',', array_filter( $saved_value ) );
     501    }
     502
     503    // 3. If it's already a string, clean up extra spaces or handle json/array strings
     504    if ( is_string( $saved_value ) ) {
     505        $saved_value = trim( $saved_value );
     506       
     507        // Safety Check: If it's a JSON stringified array from the Customizer engine, decode it
     508        if ( strpos( $saved_value, '[' ) === 0 || strpos( $saved_value, '{' ) === 0 ) {
     509            $decoded = json_decode( $saved_value, true );
     510            if ( is_array( $decoded ) ) {
     511                return implode( ',', array_filter( $decoded ) );
     512            }
     513        }
     514       
     515        return $saved_value;
     516    }
     517
     518    return '';
     519}
    464520
    465521if ( class_exists( 'WooCommerce' ) ) {
  • blogus/3.0.1/inc/ansar/template-tags.php

    r334352 r334689  
    8080
    8181if (!function_exists('blogus_menu_search')) :
    82     function blogus_menu_search() { $blogus_menu_search  = get_theme_mod('blogus_menu_search','true');
    83         if($blogus_menu_search == true) { ?>
    84             <a class="msearch ml-auto"  data-bs-target="#exampleModal"  href="#" data-bs-toggle="modal">
     82    function blogus_menu_search() {
     83        $visibility = blogus_get_multi_choices( 'blogus_menu_search' );
     84        if(!empty($visibility)) { ?>
     85            <a class="msearch ml-auto" data-bs-target="#exampleModal"  href="#" data-bs-toggle="modal" displayON="<?php echo esc_attr($visibility)?>">
    8586                <i class="fa fa-search"></i>
    8687            </a>
    87         <?php } 
     88        <?php }
    8889    }
    8990endif;
    9091
    9192if (!function_exists('blogus_menu_subscriber')) :
    92     function blogus_menu_subscriber() {
    93         $blogus_menu_subscriber  = get_theme_mod('blogus_menu_subscriber','true');
     93    function blogus_menu_subscriber() {
    9494        $blogus_subsc_link = get_theme_mod('blogus_subsc_link', '#');
    9595        $blogus_subsc_open_in_new  = get_theme_mod('blogus_subsc_open_in_new', true);
    96 
    97         if($blogus_menu_subscriber == true) { ?>
    98           <a class="subscribe-btn" href="<?php echo esc_url($blogus_subsc_link); ?>" <?php if($blogus_subsc_open_in_new) { ?> target="_blank" <?php } ?>  ><i class="fas fa-bell"></i></a>
     96        $visibility = blogus_get_multi_choices( 'blogus_menu_subscriber' );
     97        if(!empty($visibility)) { ?>
     98          <a class="subscribe-btn" href="<?php echo esc_url($blogus_subsc_link); ?>" <?php if($blogus_subsc_open_in_new) { ?> target="_blank" <?php } ?> displayON="<?php echo esc_attr($visibility)?>"><i class="fas fa-bell"></i></a>
    9999        <?php }
    100100    }
    … …  
    102102
    103103if (!function_exists('blogus_lite_dark_switcher')) :
    104     function blogus_lite_dark_switcher() { $blogus_lite_dark_switcher = get_theme_mod('blogus_lite_dark_switcher', true);
    105         if($blogus_lite_dark_switcher == true){ 
     104    function blogus_lite_dark_switcher() {
     105        $visibility = blogus_get_multi_choices( 'blogus_lite_dark_switcher' );
     106        if(!empty($visibility)) {
    106107            if ( isset( $_COOKIE["blogus-site-mode-cookie"] ) ) {
    107108                $blogus_skin_mode = $_COOKIE["blogus-site-mode-cookie"];
    … …  
    109110                $blogus_skin_mode = get_theme_mod( 'blogus_skin_mode', 'defaultcolor' );
    110111            } ?>         
    111             <label class="switch" for="switch">
     112            <label class="switch" for="switch" displayON="<?php echo esc_attr($visibility)?>">
    112113                <input type="checkbox" name="theme" id="switch" class="<?php echo esc_attr( $blogus_skin_mode ); ?>" data-skin-mode="<?php echo esc_attr( $blogus_skin_mode ); ?>">
    113114                <span class="slider"></span>
  • blogus/3.0.1/js/customizer.js

    r331247 r334689  
    386386    blogus_dimension_preview( 'blogus_logo_margin', '.bs-default .site-logo a.navbar-brand', 'margin' );
    387387
     388
     389        // Multi Choose
     390        function blogusMultiChoosePreview(settingId, selector, attribute) {
     391        attribute = attribute || 'displayON';
     392
     393        wp.customize(settingId, function(value) {
     394            value.bind(function(newVal) {
     395                var attrValue = '';
     396
     397                if (Array.isArray(newVal)) {
     398                    attrValue = newVal.join(',');
     399                } else if (typeof newVal === 'string') {
     400                    attrValue = newVal.trim();
     401                }
     402
     403                $(selector).attr(attribute, attrValue);
     404            });
     405        });
     406    }
     407    blogusMultiChoosePreview('blogus_menu_search', '.right-nav .msearch');
     408    blogusMultiChoosePreview('blogus_menu_subscriber', '.right-nav .subscribe-btn');
     409    blogusMultiChoosePreview('blogus_lite_dark_switcher', '.right-nav .switch');
     410
    388411} )( jQuery );
  • blogus/3.0.1/readme.txt

    r334352 r334689  
    55Requires at least: 6.7
    66Tested up to: 7.0
    7 Stable tag: 3.0.0
    8 Version: 3.0.0
     7Stable tag: 3.0.1
     8Version: 3.0.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    749749* Added Customizer options to disable breadcrumbs on archive, single, page, and search views.
    750750* Update Screenshot.
     751
     752= Version 3.0.1
     753* Added Visibility Option For Header Right Nav.
  • blogus/3.0.1/style-rtl.css

    r334352 r334689  
    55Author URI: https://themeansar.com
    66Description: Blogus is a fast, clean, modern-looking Best Responsive News Magazine WordPress theme. The theme is fully widgetized, so users can manage the content by using easy to use widgets. Blogus is suitable for dynamic news, newspapers, magazine, publishers, blogs, editors, online and gaming magazines, newsportals,personal blogs, newspaper, publishing or review siteand any creative website. Blogus is SEO friendly, WPML,Gutenberg, translation and RTL ready. Live preview : https://demos.themeansar.com/blogus-demos/ and documentation at https://docs.themeansar.com/docs/blogus/
    7 Version: 3.0.0
     7Version: 3.0.1
    88Tested up to: 7.0
    99Requires PHP: 7.4
  • blogus/3.0.1/style.css

    r334352 r334689  
    55Author URI: https://themeansar.com
    66Description: Blogus is a fast, clean, modern-looking Best Responsive News Magazine WordPress theme. The theme is fully widgetized, so users can manage the content by using easy to use widgets. Blogus is suitable for dynamic news, newspapers, magazine, publishers, blogs, editors, online and gaming magazines, newsportals,personal blogs, newspaper, publishing or review siteand any creative website. Blogus is SEO friendly, WPML,Gutenberg, translation and RTL ready. Live preview : https://demos.themeansar.com/blogus-demos/ and documentation at https://docs.themeansar.com/docs/blogus/
    7 Version: 3.0.0
     7Version: 3.0.1
    88Tested up to: 7.0
    99Requires PHP: 7.4
    … …  
    35673567                height: auto;
    35683568        }
     3569        .right-nav{
     3570                display: flex;
     3571                gap: 10px;
     3572        }
    35693573        .right-nav a.msearch {
    35703574                margin: 0;
Note: See TracChangeset for help on using the changeset viewer.