Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/walla3t.corals.io/wp-content/themes/apper/inc/theme-config/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/walla3t.corals.io/wp-content/themes/apper/inc/theme-config/theme-config.php
<?php
/*
 * Apper Theme configurations
 * @author    AcmeeDesign
 * @link      https://acmeedesign.com
 * @since     1.0
 */

function apper_label_to_slug( $label ) {
  if( !empty( $label ) ) {
    $label = preg_replace("/[\s-]/", "_", $label);
    $label = preg_replace('/[^a-zA-Z0-9_]/', '', $label);
    return strtolower( $label );
  }
}

/**
 * Hooks With WPMetabox and registers a new metabox
 *
 * @param $meta_boxes
 *
 * @return array
 */
if( ! function_exists( 'apper_page_settings' ) ) {

  function apper_page_settings( $meta_boxes ) {
  	$meta_boxes[] = array(
  		'title'       => esc_html__( 'Apper page settings', 'apper' ),
  		'id'          => 'apper-page-settings',
  		'post_types'  => array( 'page' ),
  		'context'     => 'after_editor',
  		'priority'    => 'low',
  		'tabs'        => array(
          'header' => array(
              'label' => 'Header',
              'icon'  => 'dashicons-table-row-after', // Dashicon
          ),
          'footer'  => array(
              'label' => 'Footer',
              'icon'  => 'dashicons-table-row-before', // Dashicon
          ),
       ),
  		'tab_style'   => 'default',
  		'tab_wrapper' => true,
  		'fields'      => array(
        array(
          'name' => esc_html__( 'Enable main header background color', 'apper' ),
          'id'   => 'show_header_bg',
          'type'            => 'select',
          'options'         => array(
              'default'       => esc_html__( 'Default to Theme options', 'apper' ),
              'show' => esc_html__( 'Show', 'apper' ),
              'hide' => esc_html__( 'Hide', 'apper' ),
          ),
          'tab'  => 'header',
        ),
        array(
          'name'          => esc_html__( 'Main header background color', 'apper' ),
          'id'            => 'indv_header_bg_color',
          'type'          => 'color',
          'alpha_channel' => true,
          'js_options'    => array(
             'palettes' => array( '#ffffff', '#3e3f66', '#32236f', '#121823', '#FF6B6B', '#1d2530' )
          ),
          'hidden' => array( 'show_header_bg', '!=', 'show' ),
          'std' => '#ffffff',
          'tab'  => 'header',
       ),
       array(
        'name' => esc_html__( 'Header menu style', 'apper' ),
        'id'   => 'indv_page_header_menu_style',
        'type'            => 'select',
        'options'         => array(
            ''       => esc_html__( 'Default to Theme options', 'apper' ),
            'menu-light' => esc_html__( 'Menu light', 'apper' ),
            'menu-dark' => esc_html__( 'Menu dark', 'apper' ),
        ),
        'tab'  => 'header',
      ),
       array(
          'name' => esc_html__( 'Show page header', 'apper' ),
          'id'   => 'show_page_header',
          'type'            => 'select',
          'options'         => array(
              'default'       => esc_html__( 'Default to Theme options', 'apper' ),
              'show' => esc_html__( 'Show', 'apper' ),
              'hide' => esc_html__( 'Hide', 'apper' ),
          ),
          'tab'  => 'header',
        ),
        array(
          'name'          => esc_html__( 'Page header background color', 'apper' ),
          'id'            => 'indv_page_header_bg_color',
          'type'          => 'color',
          'alpha_channel' => true,
          'js_options'    => array(
             'palettes' => array( '#E1DDF4', '#3e3f66', '#32236f', '#ffffff', '#FF6B6B', '#1d2530' )
          ),
          'visible' => [ 'show_page_header', '=', 'show' ],
          'std' => '#E1DDF4',
          'tab'  => 'header',
        ),
          array(
              'name' => esc_html__( 'Header banner style', 'apper' ),
              'id'   => 'indv_page_banner_style',
              'type'            => 'select',
              'options'         => array(
                  ''       => esc_html__( 'Default to Theme options', 'apper' ),
                  'hero_wave_light' => esc_html__( 'Hero wave light', 'apper' ),
                  'hero_wave_dark' => esc_html__( 'Hero wave dark', 'apper' ),
                  'hero_wave_small' => esc_html__( 'Hero wave small', 'apper' ),
                  'cross_shade' => esc_html__( 'Cross shade', 'apper' ),
                  'simple_plain_header' => esc_html__('Simple plain background', 'apper'),
              ),
              'visible' => [ 'show_page_header', '=', 'show' ],
              'tab'  => 'header',
          ),
          array(
              'name' => esc_html__( 'Show breadcrumb', 'apper' ),
              'id'   => 'show_page_breadcrumb',
              'type'            => 'select',
              'options'         => array(
                  'default'       => esc_html__( 'Default to Theme options', 'apper' ),
                  'show' => esc_html__( 'Show', 'apper' ),
                  'hide' => esc_html__( 'Hide', 'apper' ),
              ),
              'visible' => [ 'show_page_header', '=', 'show' ],
              'tab'  => 'header',
          ),
          array(
  				    'name'          => esc_html__( 'Page heading text color', 'apper' ),
  				    'id'            => 'indv_page_heading_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#32236F', '#32236f', '#121823', '#FF6B6B', '#1d2530' )
  				    ),
              'std' => '#ffffff',
              'visible' => array('indv_page_banner_style', 'in', ['hero_wave_light', 'hero_wave_dark', 'hero_wave_small', 'cross_shade', 'simple_plain_header', 'custom']),
  						'tab'  => 'header',
  				),
  				array(
  				    'name'          => esc_html__( 'Header breadcrumb color', 'apper' ),
  				    'id'            => 'indv_page_breadcrumb_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#32236F', '#32236f', '#121823', '#FF6B6B', '#1d2530' )
  				    ),
              'visible' => [ 'show_page_header', '=', 'show' ],
              'std' => '#ffffff',
  						'tab'  => 'header',
  				),
          array(
              'name' => esc_html__( 'Enable custom footer colors', 'apper' ),
              'id'   => 'indv_page_footer_colors',
              'type' => 'checkbox',
              'std'  => 0,
              'tab'  => 'footer',
          ),
  				array(
  				    'name'          => esc_html__( 'Footer top background', 'apper' ),
  				    'id'            => 'page_footer_top_bg',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    // Color picker options. See here: https://automattic.github.io/Iris/.
  				    'js_options'    => array(
  				       'palettes' => array( '#293132', '#474044', '#4F5165', '#DFF8EB', '#7692FF', '#EFE9E7' )
  				    ),
              'std' => '#121823',
  						'tab'  => 'footer',
  				),
  				array(
  				    'name'          => esc_html__( 'Footer top heading color', 'apper' ),
  				    'id'            => 'page_footer_top_heading_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#00A5E0', '#262626', '#CA3CFF', '#FF6B6B', '#58355E' )
  				    ),
              'std' => '#ffffff',
  						'tab'  => 'footer',
  				),
  				array(
  				    'name'          => esc_html__( 'Footer top text color', 'apper' ),
  				    'id'            => 'page_footer_top_text_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#00A5E0', '#262626', '#CA3CFF', '#FF6B6B', '#58355E' )
  				    ),
              'std' => '#cbcfd6',
  						'tab'  => 'footer',
  				),
  				array(
  				    'name'          => esc_html__( 'Footer top link color', 'apper' ),
  				    'id'            => 'page_footer_top_link_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#00A5E0', '#262626', '#CA3CFF', '#FF6B6B', '#58355E' )
  				    ),
              'std' => '#cbcfd6',
  						'tab'  => 'footer',
  				),
  				array(
  				    'name'          => esc_html__( 'Footer bottom background', 'apper' ),
  				    'id'            => 'page_footer_btm_bg',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#3C1642', '#0A0908', '#4F5165', '#DFF8EB', '#7692FF', '#EFE9E7' )
  				    ),
  						'tab'  => 'footer',
  				),
  				array(
  				    'name'          => esc_html__( 'Footer bottom text color', 'apper' ),
  				    'id'            => 'page_footer_btm_text_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#00A5E0', '#262626', '#CA3CFF', '#FF6B6B', '#58355E' )
  				    ),
              'std' => '#1d2530',
  						'tab'  => 'footer',
  				),
  				array(
  				    'name'          => esc_html__( 'Footer bottom link color', 'apper' ),
  				    'id'            => 'page_footer_btm_link_color',
  				    'type'          => 'color',
  				    'alpha_channel' => true,
  				    'js_options'    => array(
  				       'palettes' => array( '#ffffff', '#00A5E0', '#262626', '#CA3CFF', '#FF6B6B', '#58355E' )
  				    ),
              'std' => '#ffffff',
  						'tab'  => 'footer',
  				),
          array(
            'name'          => esc_html__( 'Show subscribe form template', 'apper' ),
            'desc'          => esc_html__( 'Enter saved elementor template ID', 'apper' ),
            'id'            => 'page_subscribe_form_temp_id',
            'type'          => 'text',
            'size'          => '',
            'tab'  => 'footer',
        ),
      ),
  	);

  	return $meta_boxes;

  }
  add_filter( 'rwmb_meta_boxes', 'apper_page_settings' );

}

add_action( 'rwmb_meta_boxes', 'apper_user_fields' );
function apper_user_fields( $meta_boxes ) {
    $meta_boxes[] = array(
        'title' => esc_html__( 'Social links', 'apper' ),
        'type'  => 'user',

        'fields' => array(
          array(
              'name' => esc_html__( 'Facebook', 'apper' ),
              'id'   => 'facebook',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Twitter', 'apper' ),
              'id'   => 'twitter',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Instagram', 'apper' ),
              'id'   => 'instagram',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'LinkedIn', 'apper' ),
              'id'   => 'linkedin',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'YouTube', 'apper' ),
              'id'   => 'youtube',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Pinterest', 'apper' ),
              'id'   => 'pinterest',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Dribbble', 'apper' ),
              'id'   => 'dribbble',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Stumbleupon', 'apper' ),
              'id'   => 'stumbleupon',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Tumbler', 'apper' ),
              'id'   => 'tumbler',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'RSS', 'apper' ),
              'id'   => 'rss',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Soundcloud', 'apper' ),
              'id'   => 'soundcloud',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Vimeo', 'apper' ),
              'id'   => 'vimeo',
              'type' => 'text',
          ),
          array(
              'name' => esc_html__( 'Yelp', 'apper' ),
              'id'   => 'yelp',
              'type' => 'text',
          ),
        ),
    );

    return $meta_boxes;
}

/**
 * Hooks With WPMetabox and registers a new metabox
 *
 * @param $meta_boxes
 *
 * @return array
 */
if ( ! function_exists( 'apper_post_settings' ) ) {

  function apper_post_settings( $meta_boxes ) {
  	$meta_boxes[] = array(
  		'title'       => esc_html__( 'Apper post settings', 'apper' ),
  		'id'          => 'bkc-post-settings',
  		'post_types'  => array( 'post' ),
  		'context'     => 'after_editor',
  		'priority'    => 'low',
  		'tabs'        => array(
          'layout' => array(
              'label' => 'Layout',
              'icon'  => 'dashicons-table-row-after', // Dashicon
          ),
       ),
  		'tab_style'   => 'default',
  		'tab_wrapper' => true,
  		'fields'      => array(
          array(
              'name' => esc_html__( 'Post layout', 'apper' ),
              'id'   => 'this_post_layout',
              'type'            => 'select',
              'options'         => array(
                ''       => esc_html__( 'Default to theme options', 'apper' ),
                'fullwidth'       => esc_html__( 'Full width', 'apper' ),
                'left' => esc_html__( 'Left sidebar', 'apper' ),
                'right' => esc_html__( 'Right sidebar', 'apper' ),
              ),
              'tab'  => 'layout',
          ),
          array(
              'name' => esc_html__( 'Text content side padding (Desktop and Tab Landscape)', 'apper' ),
              'id'   => 'post_content_padding',
              'type' => 'slider',
              'prefix' => '',
              'suffix' => ' px',
              'js_options' => array(
                  'min'   => 0,
                  'max'   => 250,
                  'step'  => 5,
              ),
              'std' => 0,
              'tab'  => 'layout',
          ),
          array(
              'name' => esc_html__( 'Content side padding (Tab Portrait)', 'apper' ),
              'id'   => 'post_content_padding_tab',
              'type' => 'slider',
              'prefix' => '',
              'suffix' => ' px',
              'js_options' => array(
                  'min'   => 0,
                  'max'   => 250,
                  'step'  => 5,
              ),
              'std' => 0,
              'tab'  => 'layout',
          ),
      ),
  	);

  	return $meta_boxes;

  }
  add_filter( 'rwmb_meta_boxes', 'apper_post_settings' );

}

/**
 * show author biography in single page
 *
 * @return html
 */
 if( ! function_exists( 'apper_author_biography' ) ) {
   function apper_author_biography() {
     //get theme settings
     $settings = acmthemes_settings();

     //author social networks
     $social_accounts = acmthemes_get_social_links();

     if( !empty( $settings['show_author_bio'] ) ) {
       $author_id = get_the_author_meta('ID');
       $author_name = get_the_author_meta('first_name');
       if( !empty($author_name) ) {
           $author_dis_name = get_the_author_meta('first_name') . " " . get_the_author_meta('last_name');
       }
       else {
           $author_dis_name = get_the_author_meta('display_name') ;
       }
       ?>
     <div class="author-bio border-top">
       <div class="acm-row acm_align-center clr">
           <div class="acm-col-md-1 acm-col-sm-2 acm-col-xs-3">
               <?php echo get_avatar( $author_id, 100, '', $author_dis_name ); ?>
           </div>
           <div class="acm-col-md-6 acm-col-sm-5 acm-col-xs-9">
               <h3 class="author-name">
                 <a href="<?php echo esc_url( get_author_posts_url( $author_id ) ); ?>">
                   <?php echo esc_html( $author_dis_name ); ?>
                 </a>
               </h3>
               <?php echo get_the_date(); ?>
           </div>
           <div class="acm-col-md-5 acm-col-sm-5 acm-col-xs-12">
             <?php if( isset( $settings['show_author_socials'] ) && 1 == $settings['show_author_socials'] ) { ?>
             <div class="social_media">
                <ul>
                <?php foreach ( $social_accounts as $social ) {
                  $social_link = get_user_meta( $author_id, $social['id'], true );
                  if( ! empty( $social_link ) ) {
                  ?>
                  <li>
                    <a href="<?php echo esc_url( $social_link ); ?>">
                      <i class="fab fa-<?php echo esc_attr( $social['id'] ) ?>"></i>
                    </a>
                  </li>
                <?php
                  }
                }
              ?>
                </ul>
              </div>
            <?php } ?>
           </div>
       </div>
     </div>

 <?php }
  }
  add_action( 'after_single_article', 'apper_author_biography', 0 );
}

/**
 * show post tags in single page
 *
 * @return html
 */
 if( ! function_exists( 'apper_single_post_tags' ) ) {
   function apper_single_post_tags() {
     ?>
    <div class="single-post-tags border-top">

    <?php if( has_tag() ){ ?>
     <span class="tags"><i class="fa fa-tag"></i> <?php the_tags( '', ', ' ); ?></span>
    <?php } ?>

     </div>
  <?php
   }
}
add_action( 'after_single_article', 'apper_single_post_tags', 5 );

//change wcwl buttons to custom location
function apper_yith_single_positions() {

	$wishlist_position = get_option( 'yith_wcwl_button_position' );
	if(!empty($wishlist_position) && 'shortcode' != $wishlist_position)
		update_option('yith_wcwl_button_position', 'shortcode');

	$compare_position = get_option( 'yith_woocompare_compare_button_in_product_page' );
	if(empty($compare_position) || 0 == $compare_position)
		update_option('yith_woocompare_compare_button_in_product_page', '0');
}
add_action('after_setup_theme', 'apper_yith_single_positions');

/**
 * Show YITH buttons before gallery images
 */
 function apper_show_yith_buttons_singlepage() {
	 global $product;

	 echo '<div class="yith-buttons">';
	 /*
	 ** show yith compare button
	 */
	 if( shortcode_exists( 'yith_compare_button' ) ) {
		 echo '<div class="yith_compare_btn">';
		 echo '<span class="info-balloon">'. esc_html__('Compare', 'apper') . '</span>';
		 echo '<a href="'. get_site_url() .'?action=yith-woocompare-add-product&id='. $product->get_id() .'"
		 class="compare" data-product_id="'. $product->get_id() .'" rel="nofollow"></a>';
		 echo '</div>';
	 }
	 ?>

	 <?php
	 /*
	 ** show yith wishlist button
	 */
	 if(shortcode_exists( 'yith_wcwl_add_to_wishlist' ) ) {
		 echo '<div class="yith-wish-list">';
		 echo '<span class="info-balloon">'. esc_html__('Add to Wishlist', 'apper') . '</span>';
		 echo do_shortcode('[yith_wcwl_add_to_wishlist]');
		 echo '</div>';
		}

		echo '</div>';
 }
 add_action('woocommerce_before_single_product_summary', 'apper_show_yith_buttons_singlepage', 5);

 add_filter( 'acmthemes_breadcrumb_separator', 'apper_breadcrumb_separator' );
 function apper_breadcrumb_separator() {
	 return '';
 }

//functions for customization
//add round brackets to category count
add_filter('wp_list_categories', 'apper_add_span_cat_count');
if ( ! function_exists( 'apper_add_span_cat_count' ) ) {
    function apper_add_span_cat_count($links) {
        $links = str_replace('</a> (', '</a> <span class="post-count">(', $links);
        $links = str_replace(')', ')</span>', $links);
        return $links;
    }
}

//add purple backdrop
add_action( 'before_close_main', 'apper_purple_overlay', 99 );
function apper_purple_overlay() {
  ?>
  <div class="purple_backdrop"></div>
  <?php
}

Spamworldpro Mini