Company Name © Copyright 2017'; // Colors $defaults['colors_footer_bg'] = '#f8fafc'; $defaults['colors_footer_bottom_bg'] = '#eff1fa'; $defaults['color_hover'] = '#3a89cf'; $defaults['color_main'] = '#373d54'; $defaults['color_text'] = '#616161'; return $defaults; } } // Lightens/darkens a given color function allstore_color_luminance( $hex, $percent ) { // validate hex string $hex = preg_replace( '/[^0-9a-f]/i', '', $hex ); $new_hex = '#'; if ( strlen( $hex ) < 6 ) { $hex = $hex[0] + $hex[0] + $hex[1] + $hex[1] + $hex[2] + $hex[2]; } // convert to decimal and change luminosity for ($i = 0; $i < 3; $i++) { $dec = hexdec( substr( $hex, $i*2, 2 ) ); $dec = min( max( 0, $dec + $dec * $percent ), 255 ); $new_hex .= str_pad( dechex( $dec ) , 2, 0, STR_PAD_LEFT ); } return esc_html($new_hex); } /* * Select/radio santitization */ if ( ! function_exists( 'allstore_sanitize_select' ) ) : function allstore_sanitize_select( $input, $setting ) { // Ensure input is clean. $input = sanitize_text_field( $input ); // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } endif; /* * Checkbox santitization */ if ( ! function_exists( 'allstore_sanitize_checkbox' ) ) : function allstore_sanitize_checkbox( $checked ) { return ( ( isset( $checked ) && true === $checked ) ? true : false ); } endif; /* * Positive santitization */ if ( ! function_exists( 'allstore_sanitize_positive_integer' ) ) : /** * Sanitize positive integer. */ function allstore_sanitize_positive_integer( $input, $setting ) { $input = absint( $input ); // If the input is an absolute integer, return it. // otherwise, return the default. return ( $input ? $input : $setting->default ); } endif; // Excerpt More from "[...]" to "..." function allstore_excerpt_more () { return "..."; } add_filter("excerpt_more", "allstore_excerpt_more"); // New Excerpt Length function allstore_new_excerpt_length($length) { global $post; if ($post->post_type == 'post') { return 20; } return 55; } add_filter('excerpt_length', 'allstore_new_excerpt_length'); // Comment Template function allstore_comment($comment, $args, $depth){ //$GLOBALS['comment'] = $comment; $comment_class = array('reviews-i'); $ava_exist = allstore_validate_gravatar($comment->comment_author_email); if ($ava_exist) { $comment_class[] = 'existimg'; } ?>
  • id="li-comment-">
    comment_approved == '0') : ?>

    $depth, 'max_depth' => $args['max_depth']))) ?>