@@ -9,21 +9,21 @@ |
||
| 9 | 9 | <?php |
| 10 | 10 | $show_on_front = get_option('show_on_front'); |
| 11 | 11 | |
| 12 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 13 | - if('posts' == $show_on_front && is_home()){ |
|
| 12 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 13 | + if ('posts' == $show_on_front && is_home()) { |
|
| 14 | 14 | $sidebar = 'home'; |
| 15 | - }else{ |
|
| 15 | + } else { |
|
| 16 | 16 | $sidebar = 'sidebar-1'; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if ( '1c' !== $layout ) : ?> |
|
| 19 | + if ('1c' !== $layout) : ?> |
|
| 20 | 20 | |
| 21 | 21 | <?php lsx_sidebars_before(); ?> |
| 22 | 22 | |
| 23 | 23 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 24 | 24 | |
| 25 | 25 | <?php lsx_sidebar_top(); ?> |
| 26 | - <h2><?php esc_attr_e( 'Categories', 'lsx' ); ?></h2> |
|
| 26 | + <h2><?php esc_attr_e('Categories', 'lsx'); ?></h2> |
|
| 27 | 27 | <aside id="categories" class="widget widget_categories"> |
| 28 | 28 | <?php echo wp_tag_cloud(array('taxonomy'=>'category')); ?> |
| 29 | 29 | </aside> |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Allow Plugins and themes to disable the sidebar incase of very customized layouts. |
| 9 | -$sidebar_enabled = apply_filters('lsx_sidebar_enable',true); |
|
| 10 | -if(true !== $sidebar_enabled){return true;} |
|
| 9 | +$sidebar_enabled = apply_filters('lsx_sidebar_enable', true); |
|
| 10 | +if (true !== $sidebar_enabled) {return true; } |
|
| 11 | 11 | ?> |
| 12 | 12 | <?php |
| 13 | 13 | $show_on_front = get_option('show_on_front'); |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | $sidebar = 'home'; |
| 18 | 18 | } else { |
| 19 | 19 | |
| 20 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 21 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 20 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 21 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 22 | 22 | |
| 23 | - if('posts' == $show_on_front && is_home()){ |
|
| 23 | + if ('posts' == $show_on_front && is_home()) { |
|
| 24 | 24 | $sidebar = 'home'; |
| 25 | - }else{ |
|
| 25 | + } else { |
|
| 26 | 26 | $sidebar = 'sidebar-1'; |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | - if ( '1c' !== $layout ) : ?> |
|
| 29 | + if ('1c' !== $layout) : ?> |
|
| 30 | 30 | |
| 31 | 31 | <?php lsx_sidebars_before(); ?> |
| 32 | 32 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_home_sidebar_class()); ?>" role="complementary"> |
| 36 | 36 | |
| 37 | - <?php elseif ( is_page_template('page-templates/template-blog.php') ) : ?> |
|
| 37 | + <?php elseif (is_page_template('page-templates/template-blog.php')) : ?> |
|
| 38 | 38 | |
| 39 | 39 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 40 | 40 | |
@@ -42,25 +42,25 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | <div id="secondary" class="widget-area <?php echo esc_attr(lsx_sidebar_class()); ?>" role="complementary"> |
| 44 | 44 | |
| 45 | - <?php endif ; ?> |
|
| 45 | + <?php endif; ?> |
|
| 46 | 46 | |
| 47 | 47 | <?php lsx_sidebar_top(); ?> |
| 48 | 48 | |
| 49 | - <?php if ( ! dynamic_sidebar( $sidebar ) ) : ?> |
|
| 49 | + <?php if ( ! dynamic_sidebar($sidebar)) : ?> |
|
| 50 | 50 | |
| 51 | 51 | <aside id="search" class="widget widget_search"> |
| 52 | 52 | <?php get_search_form(); ?> |
| 53 | 53 | </aside> |
| 54 | 54 | |
| 55 | 55 | <aside id="archives" class="widget"> |
| 56 | - <h1 class="widget-title"><?php esc_attr_e( 'Archives', 'lsx' ); ?></h1> |
|
| 56 | + <h1 class="widget-title"><?php esc_attr_e('Archives', 'lsx'); ?></h1> |
|
| 57 | 57 | <ul> |
| 58 | - <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> |
|
| 58 | + <?php wp_get_archives(array('type' => 'monthly')); ?> |
|
| 59 | 59 | </ul> |
| 60 | 60 | </aside> |
| 61 | 61 | |
| 62 | 62 | <aside id="meta" class="widget"> |
| 63 | - <h1 class="widget-title"><?php esc_attr_e( 'Meta', 'lsx' ); ?></h1> |
|
| 63 | + <h1 class="widget-title"><?php esc_attr_e('Meta', 'lsx'); ?></h1> |
|
| 64 | 64 | <ul> |
| 65 | 65 | <?php wp_register(); ?> |
| 66 | 66 | <li><?php wp_loginout(); ?></li> |
@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | - if ( isset( $GLOBALS['comment_depth'] ) ) { |
|
| 3 | - $depth = intval( $GLOBALS['comment_depth'] ); |
|
| 2 | + if (isset($GLOBALS['comment_depth'])) { |
|
| 3 | + $depth = intval($GLOBALS['comment_depth']); |
|
| 4 | 4 | } else { |
| 5 | 5 | $depth = 1; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - $max_depth = intval( get_option( 'thread_comments_depth' ) ); |
|
| 8 | + $max_depth = intval(get_option('thread_comments_depth')); |
|
| 9 | 9 | ?> |
| 10 | 10 | |
| 11 | 11 | <?php echo get_avatar($comment, '64'); ?> |
| 12 | 12 | <div class="media-body"> |
| 13 | 13 | <h4 class="media-heading"><?php echo get_comment_author_link(); ?></h4> |
| 14 | - <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time> |
|
| 14 | + <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>"><?php printf(esc_html__('%1$s on %2$s', 'lsx'), get_comment_date(), get_comment_time()); ?></a></time> |
|
| 15 | 15 | <?php edit_comment_link(esc_html__('(Edit)', 'lsx'), '', ''); ?> |
| 16 | 16 | |
| 17 | - <?php if ( '0' == $comment->comment_approved ) : ?> |
|
| 17 | + <?php if ('0' == $comment->comment_approved) : ?> |
|
| 18 | 18 | <div class="alert alert-info"> |
| 19 | 19 | <?php esc_html_e('Your comment is awaiting moderation.', 'lsx'); ?> |
| 20 | 20 | </div> |
| 21 | 21 | <?php endif; ?> |
| 22 | 22 | |
| 23 | 23 | <?php comment_text(); ?> |
| 24 | -<?php comment_reply_link( array( 'depth' => $depth, 'max_depth' => $max_depth ) ); |
|
| 25 | 24 | \ No newline at end of file |
| 25 | +<?php comment_reply_link(array('depth' => $depth, 'max_depth' => $max_depth)); |
|
| 26 | 26 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; |
|
| 2 | +if ( ! defined('ABSPATH')) return; |
|
| 3 | 3 | |
| 4 | 4 | /* |
| 5 | 5 | * LSX Lazy Load Images Class |
@@ -25,143 +25,143 @@ discard block |
||
| 25 | 25 | protected static $noscripts = array(); |
| 26 | 26 | |
| 27 | 27 | static function init() { |
| 28 | - if ( is_admin() ) |
|
| 28 | + if (is_admin()) |
|
| 29 | 29 | return; |
| 30 | 30 | |
| 31 | - if ( get_theme_mod( 'lsx_lazyload_status', '1' ) === false ) { |
|
| 31 | + if (get_theme_mod('lsx_lazyload_status', '1') === false) { |
|
| 32 | 32 | self::$enabled = false; |
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if ( ! apply_filters( 'lsx_lazyload_is_enabled', true ) ) { |
|
| 36 | + if ( ! apply_filters('lsx_lazyload_is_enabled', true)) { |
|
| 37 | 37 | self::$enabled = false; |
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - add_action( 'wp_enqueue_scripts', array( __CLASS__, 'add_scripts' ) ); |
|
| 42 | - add_action( 'wp_head', array( __CLASS__, 'setup_filters' ), 9999 ); |
|
| 43 | - add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'kses_allowed_html' ), 10, 2 ); |
|
| 44 | - add_filter( 'kses_allowed_protocols', array( __CLASS__, 'kses_allowed_protocols' ) ); |
|
| 41 | + add_action('wp_enqueue_scripts', array(__CLASS__, 'add_scripts')); |
|
| 42 | + add_action('wp_head', array(__CLASS__, 'setup_filters'), 9999); |
|
| 43 | + add_filter('wp_kses_allowed_html', array(__CLASS__, 'kses_allowed_html'), 10, 2); |
|
| 44 | + add_filter('kses_allowed_protocols', array(__CLASS__, 'kses_allowed_protocols')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static function setup_filters() { |
| 48 | 48 | // WordPress |
| 49 | - add_filter( 'the_content', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 50 | - add_filter( 'widget_text', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 51 | - add_filter( 'post_thumbnail_html', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 52 | - add_filter( 'get_avatar', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 49 | + add_filter('the_content', array(__CLASS__, 'filter_images'), 200); |
|
| 50 | + add_filter('widget_text', array(__CLASS__, 'filter_images'), 200); |
|
| 51 | + add_filter('post_thumbnail_html', array(__CLASS__, 'filter_images'), 200); |
|
| 52 | + add_filter('get_avatar', array(__CLASS__, 'filter_images'), 200); |
|
| 53 | 53 | |
| 54 | 54 | // LSX |
| 55 | - add_filter( 'lsx_lazyload_filter_images', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 55 | + add_filter('lsx_lazyload_filter_images', array(__CLASS__, 'filter_images'), 200); |
|
| 56 | 56 | |
| 57 | 57 | // Envira Gallery |
| 58 | - add_filter( 'envira_gallery_output_image', array( __CLASS__, 'filter_images' ), 200 ); |
|
| 58 | + add_filter('envira_gallery_output_image', array(__CLASS__, 'filter_images'), 200); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static function add_scripts() { |
| 62 | - wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/lazysizes.min.js', array( 'jquery' ), null, true ); |
|
| 62 | + wp_enqueue_script('lazysizes', get_template_directory_uri() . '/js/vendor/lazysizes.min.js', array('jquery'), null, true); |
|
| 63 | 63 | // Plugin that enables use lazysizes in brackground images |
| 64 | 64 | //wp_enqueue_script( 'lazysizes', get_template_directory_uri() .'/js/vendor/ls.unveilhooks.min.js', array( 'jquery', 'lazysizes' ), null, true ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - static function filter_images( $content ) { |
|
| 68 | - if ( ! self::is_enabled() ) { |
|
| 67 | + static function filter_images($content) { |
|
| 68 | + if ( ! self::is_enabled()) { |
|
| 69 | 69 | return $content; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $http_user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); |
|
| 73 | - $http_user_agent = ! empty( $http_user_agent ) ? $http_user_agent : ''; |
|
| 72 | + $http_user_agent = sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])); |
|
| 73 | + $http_user_agent = ! empty($http_user_agent) ? $http_user_agent : ''; |
|
| 74 | 74 | |
| 75 | - if ( is_feed() |
|
| 75 | + if (is_feed() |
|
| 76 | 76 | || is_preview() |
| 77 | - || intval( get_query_var( 'print' ) ) == 1 |
|
| 78 | - || intval( get_query_var( 'printpage' ) ) == 1 |
|
| 79 | - || strpos( $http_user_agent, 'Opera Mini' ) !== false |
|
| 77 | + || intval(get_query_var('print')) == 1 |
|
| 78 | + || intval(get_query_var('printpage')) == 1 |
|
| 79 | + || strpos($http_user_agent, 'Opera Mini') !== false |
|
| 80 | 80 | ) { |
| 81 | 81 | return $content; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $skip_images_regex = '/class=".*(lazyload|disable-lazyload).*"/'; |
| 85 | - $placeholder_image = apply_filters( 'lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' ); |
|
| 85 | + $placeholder_image = apply_filters('lsx_lazyload_placeholder_image', 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='); |
|
| 86 | 86 | |
| 87 | 87 | $matches = array(); |
| 88 | 88 | $search = array(); |
| 89 | 89 | $replace = array(); |
| 90 | 90 | |
| 91 | - $content = preg_replace_callback( '~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content ); |
|
| 92 | - preg_match_all( '/<img[^>]*>/', $content, $matches ); |
|
| 91 | + $content = preg_replace_callback('~<noscript.+?</noscript>~s', 'self::noscripts_remove', $content); |
|
| 92 | + preg_match_all('/<img[^>]*>/', $content, $matches); |
|
| 93 | 93 | |
| 94 | - foreach ( $matches[0] as $img_html ) { |
|
| 95 | - if ( ! ( preg_match( $skip_images_regex, $img_html ) ) ) { |
|
| 94 | + foreach ($matches[0] as $img_html) { |
|
| 95 | + if ( ! (preg_match($skip_images_regex, $img_html))) { |
|
| 96 | 96 | $add_class = false; |
| 97 | 97 | |
| 98 | - if ( ! preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) && preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 99 | - $replace_html = preg_replace( '/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html ); |
|
| 98 | + if ( ! preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html) && preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 99 | + $replace_html = preg_replace('/<img(.*?)srcset=/i', '<img$1srcset="' . $placeholder_image . '" data-srcset=', $img_html); |
|
| 100 | 100 | |
| 101 | - if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 102 | - $replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html ); |
|
| 101 | + if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 102 | + $replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html); |
|
| 103 | 103 | } else { |
| 104 | - $replace_html = preg_replace( '/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html ); |
|
| 104 | + $replace_html = preg_replace('/data-srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | $add_class = true; |
| 108 | - } elseif ( preg_match( '/src=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 109 | - $replace_html = preg_replace( '/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html ); |
|
| 108 | + } elseif (preg_match('/src=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 109 | + $replace_html = preg_replace('/<img(.*?)src=/i', '<img$1src="' . $placeholder_image . '" data-src=', $img_html); |
|
| 110 | 110 | |
| 111 | - if ( preg_match( '/srcset=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 112 | - if ( preg_match( '/sizes=[\'"]([^\'"]+)[\'"]/', $img_html ) ) { |
|
| 113 | - $replace_html = preg_replace( '/srcset=/i', 'data-srcset=', $replace_html ); |
|
| 114 | - $replace_html = preg_replace( '/sizes=/i', 'data-sizes=', $replace_html ); |
|
| 111 | + if (preg_match('/srcset=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 112 | + if (preg_match('/sizes=[\'"]([^\'"]+)[\'"]/', $img_html)) { |
|
| 113 | + $replace_html = preg_replace('/srcset=/i', 'data-srcset=', $replace_html); |
|
| 114 | + $replace_html = preg_replace('/sizes=/i', 'data-sizes=', $replace_html); |
|
| 115 | 115 | } else { |
| 116 | - $replace_html = preg_replace( '/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html ); |
|
| 116 | + $replace_html = preg_replace('/srcset=/i', 'data-sizes="auto" data-srcset=', $replace_html); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $add_class = true; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if ( $add_class ) { |
|
| 124 | - $replace_html = self::add_class( $replace_html, 'lazyload' ); |
|
| 123 | + if ($add_class) { |
|
| 124 | + $replace_html = self::add_class($replace_html, 'lazyload'); |
|
| 125 | 125 | $replace_html .= '<noscript>' . $img_html . '</noscript>'; |
| 126 | 126 | |
| 127 | - array_push( $search, $img_html ); |
|
| 128 | - array_push( $replace, $replace_html ); |
|
| 127 | + array_push($search, $img_html); |
|
| 128 | + array_push($replace, $replace_html); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $content = str_replace( $search, $replace, $content ); |
|
| 134 | - $content = preg_replace_callback( '~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content ); |
|
| 133 | + $content = str_replace($search, $replace, $content); |
|
| 134 | + $content = preg_replace_callback('~' . chr(20) . '([0-9]+)' . chr(20) . '~', 'self::noscripts_restore', $content); |
|
| 135 | 135 | return $content; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - static function noscripts_remove( $match ) { |
|
| 138 | + static function noscripts_remove($match) { |
|
| 139 | 139 | self::$noscript_id++; |
| 140 | 140 | self::$noscripts[self::$noscript_id] = $match[0]; |
| 141 | 141 | return chr(20) . self::$noscript_id . chr(20); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - static function noscripts_restore( $match ) { |
|
| 144 | + static function noscripts_restore($match) { |
|
| 145 | 145 | return self::$noscripts[(int) $match[1]]; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - static function add_class( $html_string = '', $new_class ) { |
|
| 148 | + static function add_class($html_string = '', $new_class) { |
|
| 149 | 149 | $pattern = '/class=[\'"]([^\'"]*)[\'"]/'; |
| 150 | 150 | |
| 151 | - if ( preg_match( $pattern, $html_string, $matches ) ) { |
|
| 152 | - $defined_classes = explode( ' ', $matches[1] ); |
|
| 151 | + if (preg_match($pattern, $html_string, $matches)) { |
|
| 152 | + $defined_classes = explode(' ', $matches[1]); |
|
| 153 | 153 | |
| 154 | - if ( ! in_array( $new_class, $defined_classes ) ) { |
|
| 154 | + if ( ! in_array($new_class, $defined_classes)) { |
|
| 155 | 155 | $defined_classes[] = $new_class; |
| 156 | 156 | |
| 157 | 157 | $html_string = str_replace( |
| 158 | 158 | $matches[0], |
| 159 | - sprintf( 'class="%s"', implode( ' ', $defined_classes ) ), |
|
| 159 | + sprintf('class="%s"', implode(' ', $defined_classes)), |
|
| 160 | 160 | $html_string |
| 161 | 161 | ); |
| 162 | 162 | } |
| 163 | 163 | } else { |
| 164 | - $html_string = preg_replace( '/(\<.+\s)/', sprintf( '$1class="%s" ', $new_class ), $html_string ); |
|
| 164 | + $html_string = preg_replace('/(\<.+\s)/', sprintf('$1class="%s" ', $new_class), $html_string); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $html_string; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | return self::$enabled; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - static function kses_allowed_html( $allowedtags, $context ) { |
|
| 174 | + static function kses_allowed_html($allowedtags, $context) { |
|
| 175 | 175 | $allowedtags['noscript'] = array(); |
| 176 | 176 | |
| 177 | 177 | $allowedtags['img']['data-src'] = true; |
@@ -181,10 +181,10 @@ discard block |
||
| 181 | 181 | return $allowedtags; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - static function kses_allowed_protocols( $allowedprotocols ) { |
|
| 184 | + static function kses_allowed_protocols($allowedprotocols) { |
|
| 185 | 185 | $allowedprotocols[] = 'data'; |
| 186 | 186 | return $allowedprotocols; |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | -add_action( 'init', array( 'LSX_LazyLoadImages', 'init' ) ); |
|
| 190 | +add_action('init', array('LSX_LazyLoadImages', 'init')); |
|
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | function lsx_allowed_related_post_types($allowed_post_types) { |
| 21 | 21 | $allowed_post_types[] = 'jetpack-portfolio'; |
| 22 | - foreach($allowed_post_types as $key => $value){ |
|
| 23 | - if('page' == $value){ |
|
| 22 | + foreach ($allowed_post_types as $key => $value) { |
|
| 23 | + if ('page' == $value) { |
|
| 24 | 24 | unset($allowed_post_types[$key]); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | * @category site-logo |
| 36 | 36 | */ |
| 37 | 37 | |
| 38 | -function lsx_site_logo_title_tag( $html) { |
|
| 38 | +function lsx_site_logo_title_tag($html) { |
|
| 39 | 39 | |
| 40 | - $html = str_replace('<a', '<a title="'.get_bloginfo('name').'" ', $html); |
|
| 40 | + $html = str_replace('<a', '<a title="' . get_bloginfo('name') . '" ', $html); |
|
| 41 | 41 | return $html; |
| 42 | 42 | } |
| 43 | -add_filter( 'jetpack_the_site_logo', 'lsx_site_logo_title_tag'); |
|
| 43 | +add_filter('jetpack_the_site_logo', 'lsx_site_logo_title_tag'); |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | /* |
@@ -54,19 +54,19 @@ discard block |
||
| 54 | 54 | * @subpackage jetpack |
| 55 | 55 | * @category portfolio |
| 56 | 56 | */ |
| 57 | -function lsx_portfolio_infinite_scroll(){ |
|
| 58 | - global $_wp_theme_features,$wp_query; |
|
| 57 | +function lsx_portfolio_infinite_scroll() { |
|
| 58 | + global $_wp_theme_features, $wp_query; |
|
| 59 | 59 | |
| 60 | - if(is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')){ |
|
| 60 | + if (is_post_type_archive('jetpack-portfolio') || is_tax('jetpack-portfolio-type') || is_tax('jetpack-portfolio-tag')) { |
|
| 61 | 61 | |
| 62 | - if(class_exists('The_Neverending_Home_Page')){ |
|
| 62 | + if (class_exists('The_Neverending_Home_Page')) { |
|
| 63 | 63 | $_wp_theme_features['infinite-scroll'][0]['container'] = 'portfolio-infinite-scroll-wrapper'; |
| 64 | 64 | $_wp_theme_features['infinite-scroll'][0]['posts_per_page'] = 99; |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | } |
| 69 | -add_action('wp_head','lsx_portfolio_infinite_scroll',1000); |
|
| 69 | +add_action('wp_head', 'lsx_portfolio_infinite_scroll', 1000); |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Disables the infinite scroll on the portfolio archive |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | * @subpackage jetpack |
| 76 | 76 | * @category portfolio |
| 77 | 77 | */ |
| 78 | -function lsx_portfolio_infinite_scroll_disable($supported){ |
|
| 79 | - if(is_post_type_archive('jetpack-portfolio')){ |
|
| 78 | +function lsx_portfolio_infinite_scroll_disable($supported) { |
|
| 79 | + if (is_post_type_archive('jetpack-portfolio')) { |
|
| 80 | 80 | $supported = false; |
| 81 | 81 | } |
| 82 | 82 | return $supported; |
| 83 | 83 | } |
| 84 | -add_filter( 'infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10 ); |
|
| 84 | +add_filter('infinite_scroll_archive_supported', 'lsx_portfolio_infinite_scroll_disable', 1, 10); |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Set the Portfolio to 9 posts per page |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | * @subpackage jetpack |
| 91 | 91 | * @category portfolio |
| 92 | 92 | */ |
| 93 | -function lsx_portfolio_archive_pagination( $query ) { |
|
| 94 | - if(!is_admin()){ |
|
| 95 | - if ( $query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) { |
|
| 96 | - $query->set( 'posts_per_page', -1 ); |
|
| 93 | +function lsx_portfolio_archive_pagination($query) { |
|
| 94 | + if ( ! is_admin()) { |
|
| 95 | + if ($query->is_post_type_archive(array('jetpack-portfolio')) && $query->is_main_query() && class_exists('The_Neverending_Home_Page')) { |
|
| 96 | + $query->set('posts_per_page', -1); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | -add_action( 'pre_get_posts', 'lsx_portfolio_archive_pagination' , 100 ); |
|
| 100 | +add_action('pre_get_posts', 'lsx_portfolio_archive_pagination', 100); |
|
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * Remove the related posts from below the content area. |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | * @category portfolio |
| 108 | 108 | */ |
| 109 | 109 | function lsx_remove_portfolio_related_posts() { |
| 110 | - if ( is_single() && 'jetpack-portfolio' == get_post_type() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 110 | + if (is_single() && 'jetpack-portfolio' == get_post_type() && class_exists('Jetpack_RelatedPosts')) { |
|
| 111 | 111 | $jprp = Jetpack_RelatedPosts::init(); |
| 112 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
| 113 | - remove_filter( 'the_content', $callback, 40 ); |
|
| 112 | + $callback = array($jprp, 'filter_add_target_to_dom'); |
|
| 113 | + remove_filter('the_content', $callback, 40); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | -add_filter( 'wp', 'lsx_remove_portfolio_related_posts', 20 ); |
|
| 116 | +add_filter('wp', 'lsx_remove_portfolio_related_posts', 20); |
|
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | 119 | * Remove the related posts from below the content area. |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | * @category portfolio |
| 124 | 124 | */ |
| 125 | 125 | function lsx_remove_single_related_posts() { |
| 126 | - if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 126 | + if (is_single() && class_exists('Jetpack_RelatedPosts')) { |
|
| 127 | 127 | $jprp = Jetpack_RelatedPosts::init(); |
| 128 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
| 129 | - remove_filter( 'the_content', $callback, 40 ); |
|
| 128 | + $callback = array($jprp, 'filter_add_target_to_dom'); |
|
| 129 | + remove_filter('the_content', $callback, 40); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | -add_filter( 'wp', 'lsx_remove_single_related_posts', 20 ); |
|
| 132 | +add_filter('wp', 'lsx_remove_single_related_posts', 20); |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * A template tag to call the Portfolios Related posts |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | * @subpackage jetpack |
| 139 | 139 | * @category portfolio |
| 140 | 140 | */ |
| 141 | -function lsx_portfolio_related_posts(){ |
|
| 142 | - if(class_exists('Jetpack_RelatedPosts')){ ?> |
|
| 141 | +function lsx_portfolio_related_posts() { |
|
| 142 | + if (class_exists('Jetpack_RelatedPosts')) { ?> |
|
| 143 | 143 | <div class="row"> |
| 144 | 144 | <div class="col-md-12"> |
| 145 | 145 | <?php echo do_shortcode('[jetpack-related-posts]'); ?> |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | * @category portfolio |
| 157 | 157 | */ |
| 158 | 158 | function lsx_portfolio_remove_share() { |
| 159 | - if ( ( is_single() && 'jetpack-portfolio' == get_post_type() ) || is_page_template( 'page-templates/template-portfolio.php' ) ) { |
|
| 160 | - remove_filter( 'the_content', 'sharing_display',19 ); |
|
| 161 | - remove_filter( 'the_excerpt', 'sharing_display',19 ); |
|
| 159 | + if ((is_single() && 'jetpack-portfolio' == get_post_type()) || is_page_template('page-templates/template-portfolio.php')) { |
|
| 160 | + remove_filter('the_content', 'sharing_display', 19); |
|
| 161 | + remove_filter('the_excerpt', 'sharing_display', 19); |
|
| 162 | 162 | |
| 163 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 164 | - remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); |
|
| 163 | + if (class_exists('Jetpack_Likes')) { |
|
| 164 | + remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | -add_action( 'loop_start', 'lsx_portfolio_remove_share' ); |
|
| 168 | +add_action('loop_start', 'lsx_portfolio_remove_share'); |
|
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | 171 | * Remove the sharing from single |
@@ -175,16 +175,16 @@ discard block |
||
| 175 | 175 | * @category post |
| 176 | 176 | */ |
| 177 | 177 | function lsx_single_remove_share() { |
| 178 | - if ( is_single() ) { |
|
| 179 | - remove_filter( 'the_content', 'sharing_display',19 ); |
|
| 180 | - remove_filter( 'the_excerpt', 'sharing_display',19 ); |
|
| 178 | + if (is_single()) { |
|
| 179 | + remove_filter('the_content', 'sharing_display', 19); |
|
| 180 | + remove_filter('the_excerpt', 'sharing_display', 19); |
|
| 181 | 181 | |
| 182 | - if ( class_exists( 'Jetpack_Likes' ) ) { |
|
| 183 | - remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); |
|
| 182 | + if (class_exists('Jetpack_Likes')) { |
|
| 183 | + remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1); |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | -add_action( 'loop_start', 'lsx_single_remove_share' ); |
|
| 187 | +add_action('loop_start', 'lsx_single_remove_share'); |
|
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | 190 | * Redirect the template archive to our one |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | * @subpackage jetpack |
| 194 | 194 | * @category portfolio |
| 195 | 195 | */ |
| 196 | -function lsx_portfolio_taxonomy_template( $template ) { |
|
| 196 | +function lsx_portfolio_taxonomy_template($template) { |
|
| 197 | 197 | |
| 198 | - if ( is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) ) { |
|
| 199 | - $new_template = locate_template( array( 'archive-jetpack-portfolio.php' ) ); |
|
| 200 | - if ( '' != $new_template ) { |
|
| 201 | - return $new_template ; |
|
| 198 | + if (is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag'))) { |
|
| 199 | + $new_template = locate_template(array('archive-jetpack-portfolio.php')); |
|
| 200 | + if ('' != $new_template) { |
|
| 201 | + return $new_template; |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | return $template; |
| 206 | 206 | } |
| 207 | -add_filter( 'template_include', 'lsx_portfolio_taxonomy_template', 99 ); |
|
| 207 | +add_filter('template_include', 'lsx_portfolio_taxonomy_template', 99); |
|
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | /** |
@@ -214,43 +214,43 @@ discard block |
||
| 214 | 214 | * @subpackage jetpack |
| 215 | 215 | * @category portfolio |
| 216 | 216 | */ |
| 217 | -add_action( 'add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes' ); |
|
| 218 | -add_action( 'save_post', 'lsx_save_portfolio_post_meta', 100, 2 ); |
|
| 217 | +add_action('add_meta_boxes', 'lsx_add_portfolio_post_meta_boxes'); |
|
| 218 | +add_action('save_post', 'lsx_save_portfolio_post_meta', 100, 2); |
|
| 219 | 219 | |
| 220 | -function lsx_save_portfolio_post_meta( $post_id, $post ) { |
|
| 221 | - if ( 'jetpack-portfolio' != $post->post_type ) { |
|
| 220 | +function lsx_save_portfolio_post_meta($post_id, $post) { |
|
| 221 | + if ('jetpack-portfolio' != $post->post_type) { |
|
| 222 | 222 | return; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - if ( ! isset( $_POST['lsx-website'] ) && ! isset( $_POST['lsx-client'] ) ) { |
|
| 225 | + if ( ! isset($_POST['lsx-website']) && ! isset($_POST['lsx-client'])) { |
|
| 226 | 226 | return; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - $post_type = get_post_type_object( $post->post_type ); |
|
| 229 | + $post_type = get_post_type_object($post->post_type); |
|
| 230 | 230 | |
| 231 | - if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) { |
|
| 231 | + if ( ! current_user_can($post_type->cap->edit_post, $post_id)) { |
|
| 232 | 232 | return; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - check_admin_referer( 'lsx_save_portfolio', '_lsx_client_nonce' ); |
|
| 236 | - check_admin_referer( 'lsx_save_portfolio', '_lsx_website_nonce' ); |
|
| 235 | + check_admin_referer('lsx_save_portfolio', '_lsx_client_nonce'); |
|
| 236 | + check_admin_referer('lsx_save_portfolio', '_lsx_website_nonce'); |
|
| 237 | 237 | |
| 238 | - $meta_keys = array('lsx-website','lsx-client'); |
|
| 238 | + $meta_keys = array('lsx-website', 'lsx-client'); |
|
| 239 | 239 | |
| 240 | - foreach($meta_keys as $meta_key){ |
|
| 241 | - $new_meta_value = sanitize_text_field( wp_unslash( $_POST[$meta_key] ) ); |
|
| 242 | - $new_meta_value = ! empty( $new_meta_value ) ? $new_meta_value : ''; |
|
| 240 | + foreach ($meta_keys as $meta_key) { |
|
| 241 | + $new_meta_value = sanitize_text_field(wp_unslash($_POST[$meta_key])); |
|
| 242 | + $new_meta_value = ! empty($new_meta_value) ? $new_meta_value : ''; |
|
| 243 | 243 | |
| 244 | - $meta_value = get_post_meta( $post_id, $meta_key, true ); |
|
| 244 | + $meta_value = get_post_meta($post_id, $meta_key, true); |
|
| 245 | 245 | |
| 246 | - if ( $new_meta_value && '' == $meta_value ) |
|
| 247 | - add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
| 246 | + if ($new_meta_value && '' == $meta_value) |
|
| 247 | + add_post_meta($post_id, $meta_key, $new_meta_value, true); |
|
| 248 | 248 | |
| 249 | - elseif ( $new_meta_value && $new_meta_value != $meta_value ) |
|
| 250 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
| 249 | + elseif ($new_meta_value && $new_meta_value != $meta_value) |
|
| 250 | + update_post_meta($post_id, $meta_key, $new_meta_value); |
|
| 251 | 251 | |
| 252 | - elseif ( '' == $new_meta_value && $meta_value ) |
|
| 253 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
| 252 | + elseif ('' == $new_meta_value && $meta_value) |
|
| 253 | + delete_post_meta($post_id, $meta_key, $meta_value); |
|
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | add_meta_box( |
| 260 | 260 | 'lsx_client_meta_box', |
| 261 | - esc_html__( 'Client', 'lsx' ), |
|
| 261 | + esc_html__('Client', 'lsx'), |
|
| 262 | 262 | 'lsx_client_meta_box', |
| 263 | 263 | 'jetpack-portfolio', |
| 264 | 264 | 'side', |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | add_meta_box( |
| 269 | 269 | 'lsx_website_meta_box', |
| 270 | - esc_html__( 'Website', 'lsx' ), |
|
| 270 | + esc_html__('Website', 'lsx'), |
|
| 271 | 271 | 'lsx_website_meta_box', |
| 272 | 272 | 'jetpack-portfolio', |
| 273 | 273 | 'side', |
@@ -275,25 +275,25 @@ discard block |
||
| 275 | 275 | ); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | -function lsx_client_meta_box( $object, $box ) { ?> |
|
| 278 | +function lsx_client_meta_box($object, $box) { ?> |
|
| 279 | 279 | |
| 280 | - <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_client_nonce' ); ?> |
|
| 280 | + <?php wp_nonce_field('lsx_save_portfolio', '_lsx_client_nonce'); ?> |
|
| 281 | 281 | |
| 282 | 282 | <p> |
| 283 | - <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-client', true ) ); ?>" size="30" /> |
|
| 283 | + <input class="widefat" type="text" name="lsx-client" id="lsx-client" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-client', true)); ?>" size="30" /> |
|
| 284 | 284 | <br /><br /> |
| 285 | - <label for="lsx-client"><?php esc_html_e( 'Enter the name of the project client', 'lsx' ); ?></label> |
|
| 285 | + <label for="lsx-client"><?php esc_html_e('Enter the name of the project client', 'lsx'); ?></label> |
|
| 286 | 286 | </p> |
| 287 | 287 | <?php } |
| 288 | 288 | |
| 289 | -function lsx_website_meta_box( $object, $box ) { ?> |
|
| 289 | +function lsx_website_meta_box($object, $box) { ?> |
|
| 290 | 290 | |
| 291 | - <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_website_nonce' ); ?> |
|
| 291 | + <?php wp_nonce_field('lsx_save_portfolio', '_lsx_website_nonce'); ?> |
|
| 292 | 292 | |
| 293 | 293 | <p> |
| 294 | - <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr( get_post_meta( $object->ID, 'lsx-website', true ) ); ?>" size="30" /> |
|
| 294 | + <input class="widefat" type="text" name="lsx-website" id="lsx-website" value="<?php echo esc_attr(get_post_meta($object->ID, 'lsx-website', true)); ?>" size="30" /> |
|
| 295 | 295 | <br /><br /> |
| 296 | - <label for="lsx-website"><?php esc_html_e( 'Enter the URL of the project website', 'lsx' ); ?></label> |
|
| 296 | + <label for="lsx-website"><?php esc_html_e('Enter the URL of the project website', 'lsx'); ?></label> |
|
| 297 | 297 | </p> |
| 298 | 298 | <?php } |
| 299 | 299 | |
@@ -306,18 +306,18 @@ discard block |
||
| 306 | 306 | * @category portfolio |
| 307 | 307 | */ |
| 308 | 308 | |
| 309 | -function lsx_portfolio_sorter(){ ?> |
|
| 309 | +function lsx_portfolio_sorter() { ?> |
|
| 310 | 310 | <ul id="filterNav" class="clearfix"> |
| 311 | - <li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e( 'All', 'lsx' ); ?></a></li> |
|
| 311 | + <li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e('All', 'lsx'); ?></a></li> |
|
| 312 | 312 | <?php |
| 313 | 313 | $types = get_terms('jetpack-portfolio-type'); |
| 314 | 314 | |
| 315 | - if(is_array($types)){ |
|
| 315 | + if (is_array($types)) { |
|
| 316 | 316 | foreach ($types as $type) { |
| 317 | - $content = '<li><a href="#" data-filter=".'.$type->slug.'">'; |
|
| 317 | + $content = '<li><a href="#" data-filter=".' . $type->slug . '">'; |
|
| 318 | 318 | $content .= $type->name; |
| 319 | 319 | $content .= '</a></li>'; |
| 320 | - echo wp_kses_post( $content ); |
|
| 320 | + echo wp_kses_post($content); |
|
| 321 | 321 | echo "\n"; |
| 322 | 322 | } |
| 323 | 323 | }?> |
@@ -332,18 +332,18 @@ discard block |
||
| 332 | 332 | * @category portfolio |
| 333 | 333 | */ |
| 334 | 334 | |
| 335 | -function lsx_portfolio_naviagtion_labels($labels){ |
|
| 335 | +function lsx_portfolio_naviagtion_labels($labels) { |
|
| 336 | 336 | |
| 337 | - if(is_post_type_archive('jetpack-portfolio')){ |
|
| 337 | + if (is_post_type_archive('jetpack-portfolio')) { |
|
| 338 | 338 | $labels = array( |
| 339 | - 'next' => '<span class="meta-nav">←</span> '.__( 'Older', 'lsx' ), |
|
| 340 | - 'previous' => __( 'Newer', 'lsx' ).' <span class="meta-nav">→</span>', |
|
| 341 | - 'title' => __( 'Portfolio navigation', 'lsx' ) |
|
| 339 | + 'next' => '<span class="meta-nav">←</span> ' . __('Older', 'lsx'), |
|
| 340 | + 'previous' => __('Newer', 'lsx') . ' <span class="meta-nav">→</span>', |
|
| 341 | + 'title' => __('Portfolio navigation', 'lsx') |
|
| 342 | 342 | ); |
| 343 | 343 | } |
| 344 | 344 | return $labels; |
| 345 | 345 | } |
| 346 | -add_filter('lsx_post_navigation_labels','lsx_portfolio_naviagtion_labels',1,10); |
|
| 346 | +add_filter('lsx_post_navigation_labels', 'lsx_portfolio_naviagtion_labels', 1, 10); |
|
| 347 | 347 | |
| 348 | 348 | |
| 349 | 349 | /* |
@@ -357,11 +357,11 @@ discard block |
||
| 357 | 357 | * @subpackage jetpack |
| 358 | 358 | * @category related-posts |
| 359 | 359 | */ |
| 360 | -function lsx_remove_related_post_context(){ |
|
| 361 | - add_filter( 'jetpack_relatedposts_filter_post_context', '__return_empty_string' ); |
|
| 362 | - add_filter( 'rest_api_allowed_post_types', 'lsx_allowed_related_post_types' ); |
|
| 360 | +function lsx_remove_related_post_context() { |
|
| 361 | + add_filter('jetpack_relatedposts_filter_post_context', '__return_empty_string'); |
|
| 362 | + add_filter('rest_api_allowed_post_types', 'lsx_allowed_related_post_types'); |
|
| 363 | 363 | } |
| 364 | -add_action('init','lsx_remove_related_post_context',20); |
|
| 364 | +add_action('init', 'lsx_remove_related_post_context', 20); |
|
| 365 | 365 | |
| 366 | 366 | |
| 367 | 367 | /* |
@@ -378,13 +378,13 @@ discard block |
||
| 378 | 378 | $infinite_scroll_args = array( |
| 379 | 379 | 'container' => 'main', |
| 380 | 380 | 'type' => 'click', |
| 381 | - 'posts_per_page' => get_option('posts_per_page',10), |
|
| 381 | + 'posts_per_page' => get_option('posts_per_page', 10), |
|
| 382 | 382 | 'render' => 'lsx_infinite_scroll_render' |
| 383 | 383 | ); |
| 384 | 384 | |
| 385 | - add_theme_support( 'infinite-scroll', $infinite_scroll_args ); |
|
| 385 | + add_theme_support('infinite-scroll', $infinite_scroll_args); |
|
| 386 | 386 | } |
| 387 | -add_action( 'after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup' ); |
|
| 387 | +add_action('after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup'); |
|
| 388 | 388 | |
| 389 | 389 | /** |
| 390 | 390 | * Set the code to be rendered on for calling posts, |
@@ -397,13 +397,13 @@ discard block |
||
| 397 | 397 | function lsx_infinite_scroll_render() { |
| 398 | 398 | global $wp_query; |
| 399 | 399 | |
| 400 | - while(have_posts()){ |
|
| 400 | + while (have_posts()) { |
|
| 401 | 401 | the_post(); |
| 402 | 402 | |
| 403 | - if('jetpack-portfolio' == get_post_type()){ |
|
| 404 | - get_template_part( 'content', 'portfolio' ); |
|
| 405 | - }else{ |
|
| 406 | - get_template_part( 'content', get_post_type() ); |
|
| 403 | + if ('jetpack-portfolio' == get_post_type()) { |
|
| 404 | + get_template_part('content', 'portfolio'); |
|
| 405 | + } else { |
|
| 406 | + get_template_part('content', get_post_type()); |
|
| 407 | 407 | } |
| 408 | 408 | } |
| 409 | 409 | } |
@@ -415,8 +415,8 @@ discard block |
||
| 415 | 415 | * @subpackage jetpack |
| 416 | 416 | * @category related posts |
| 417 | 417 | */ |
| 418 | -function lsx_related_posts_headline( $headline ) { |
|
| 419 | - $headline = sprintf( '<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html( 'Related Posts' ) ); |
|
| 418 | +function lsx_related_posts_headline($headline) { |
|
| 419 | + $headline = sprintf('<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html('Related Posts')); |
|
| 420 | 420 | return $headline; |
| 421 | 421 | } |
| 422 | -add_filter( 'jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline' ); |
|
| 422 | +add_filter('jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline'); |
|
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * |
| 5 | 5 | * @package lsx |
| 6 | 6 | */ |
| 7 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 7 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 8 | 8 | |
| 9 | 9 | define('LSX_VERSION', '1.8.0'); |
| 10 | 10 | |
@@ -21,22 +21,22 @@ discard block |
||
| 21 | 21 | require get_template_directory() . '/inc/comment-walker.php'; |
| 22 | 22 | require get_template_directory() . '/inc/jetpack.php'; |
| 23 | 23 | require get_template_directory() . '/inc/lazyload.php'; |
| 24 | -if(class_exists('BuddyPress')){ |
|
| 24 | +if (class_exists('BuddyPress')) { |
|
| 25 | 25 | require get_template_directory() . '/inc/buddypress.php'; |
| 26 | 26 | } |
| 27 | -if(class_exists('WooCommerce')){ |
|
| 27 | +if (class_exists('WooCommerce')) { |
|
| 28 | 28 | require get_template_directory() . '/inc/woocommerce.php'; |
| 29 | 29 | } |
| 30 | -if(class_exists('WP_Job_Manager')){ |
|
| 30 | +if (class_exists('WP_Job_Manager')) { |
|
| 31 | 31 | require get_template_directory() . '/inc/wp-job-manager.php'; |
| 32 | 32 | } |
| 33 | -if(class_exists('Tribe__Events__Main')){ |
|
| 33 | +if (class_exists('Tribe__Events__Main')) { |
|
| 34 | 34 | require get_template_directory() . '/inc/the-events-calendar.php'; |
| 35 | 35 | } |
| 36 | 36 | require get_template_directory() . '/inc/template-tags.php'; |
| 37 | 37 | require get_template_directory() . '/inc/extras.php'; |
| 38 | 38 | require get_template_directory() . '/inc/wp-bootstrap-navwalker.php'; |
| 39 | -if(class_exists('Sensei_WC')){ |
|
| 39 | +if (class_exists('Sensei_WC')) { |
|
| 40 | 40 | require get_template_directory() . '/inc/sensei.php'; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | * @category customizer |
| 49 | 49 | * @return $lsx_controls array() |
| 50 | 50 | */ |
| 51 | -function lsx_customizer_core_controls( $lsx_controls ) { |
|
| 51 | +function lsx_customizer_core_controls($lsx_controls) { |
|
| 52 | 52 | $lsx_controls['sections']['lsx-core'] = array( |
| 53 | - 'title' => esc_html__( 'Core Settings', 'lsx' ), |
|
| 54 | - 'description' => __( 'Change the core settings.', 'lsx' ), |
|
| 53 | + 'title' => esc_html__('Core Settings', 'lsx'), |
|
| 54 | + 'description' => __('Change the core settings.', 'lsx'), |
|
| 55 | 55 | 'priority' => 21 |
| 56 | 56 | ); |
| 57 | 57 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | $lsx_controls['fields']['lsx_lazyload_status'] = array( |
| 65 | - 'label' => __( 'Lazy Loading Images', 'lsx' ), |
|
| 65 | + 'label' => __('Lazy Loading Images', 'lsx'), |
|
| 66 | 66 | 'section' => 'lsx-core', |
| 67 | 67 | 'type' => 'checkbox', |
| 68 | 68 | ); |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | $lsx_controls['fields']['lsx_preloader_content_status'] = array( |
| 77 | - 'label' => __( 'Preloader Content', 'lsx' ), |
|
| 77 | + 'label' => __('Preloader Content', 'lsx'), |
|
| 78 | 78 | 'section' => 'lsx-core', |
| 79 | 79 | 'type' => 'checkbox', |
| 80 | 80 | ); |
| 81 | 81 | |
| 82 | 82 | return $lsx_controls; |
| 83 | 83 | } |
| 84 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_core_controls' ); |
|
| 84 | +add_filter('lsx_customizer_controls', 'lsx_customizer_core_controls'); |
|
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Returns an array of the colour scheme picker. |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @category customizer |
| 92 | 92 | * @return $lsx_controls array() |
| 93 | 93 | */ |
| 94 | -function lsx_customizer_colour_scheme_controls( $lsx_controls ) { |
|
| 94 | +function lsx_customizer_colour_scheme_controls($lsx_controls) { |
|
| 95 | 95 | global $customizer_colour_names; |
| 96 | 96 | global $customizer_colour_choices; |
| 97 | 97 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | 104 | $lsx_controls['fields']['color_scheme'] = array( |
| 105 | - 'label' => esc_html__( 'Base Color Scheme', 'lsx' ), |
|
| 105 | + 'label' => esc_html__('Base Color Scheme', 'lsx'), |
|
| 106 | 106 | 'section' => 'colors', |
| 107 | 107 | 'type' => 'select', |
| 108 | 108 | 'priority' => 1, |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | 'choices' => $customizer_colour_choices |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - foreach ( $customizer_colour_names as $key => $value ) { |
|
| 113 | + foreach ($customizer_colour_names as $key => $value) { |
|
| 114 | 114 | $sanitize_callback = 'sanitize_hex_color'; |
| 115 | 115 | |
| 116 | - if ( 'background_color' === $key ) { |
|
| 116 | + if ('background_color' === $key) { |
|
| 117 | 117 | $sanitize_callback = 'sanitize_hex_color_no_hash'; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | return $lsx_controls; |
| 135 | 135 | } |
| 136 | -add_filter( 'lsx_customizer_controls', 'lsx_customizer_colour_scheme_controls' ); |
|
| 136 | +add_filter('lsx_customizer_controls', 'lsx_customizer_colour_scheme_controls'); |
|
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * Returns an array of the layout panel. |
@@ -144,56 +144,56 @@ discard block |
||
| 144 | 144 | * @return $lsx_controls array() |
| 145 | 145 | */ |
| 146 | 146 | function lsx_customizer_layout_controls($lsx_controls) { |
| 147 | - $lsx_controls['settings']['lsx_header_layout'] = array( |
|
| 147 | + $lsx_controls['settings']['lsx_header_layout'] = array( |
|
| 148 | 148 | 'default' => 'inline', //Default setting/value to save |
| 149 | 149 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 150 | 150 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 151 | 151 | ); |
| 152 | 152 | $lsx_controls['fields']['lsx_header_layout'] = array( |
| 153 | - 'label' => __('Header','lsx'), |
|
| 153 | + 'label' => __('Header', 'lsx'), |
|
| 154 | 154 | 'section' => 'lsx-layout', |
| 155 | 155 | 'control' => 'LSX_Customize_Header_Layout_Control', |
| 156 | - 'choices' => array('central','expanded','inline') |
|
| 156 | + 'choices' => array('central', 'expanded', 'inline') |
|
| 157 | 157 | ); |
| 158 | 158 | $lsx_controls['sections']['lsx-layout'] = array( |
| 159 | - 'title' => esc_html__( 'Layout', 'lsx' ), |
|
| 160 | - 'description' => __( 'Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx' ), |
|
| 159 | + 'title' => esc_html__('Layout', 'lsx'), |
|
| 160 | + 'description' => __('Change the layout sitewide. If your homepage is set to use a page with a template, the following will not apply to it.', 'lsx'), |
|
| 161 | 161 | 'priority' => 22 |
| 162 | 162 | ); |
| 163 | - $lsx_controls['settings']['lsx_layout'] = array( |
|
| 163 | + $lsx_controls['settings']['lsx_layout'] = array( |
|
| 164 | 164 | 'default' => '2cr', //Default setting/value to save |
| 165 | 165 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 166 | 166 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 167 | 167 | ); |
| 168 | - $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
| 168 | + $lsx_controls['settings']['lsx_header_fixed'] = array( |
|
| 169 | 169 | 'default' => false, //Default setting/value to save |
| 170 | 170 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
| 171 | 171 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 172 | 172 | ); |
| 173 | 173 | $lsx_controls['fields']['lsx_header_fixed'] = array( |
| 174 | - 'label' => __('Fixed Header','lsx'), |
|
| 174 | + 'label' => __('Fixed Header', 'lsx'), |
|
| 175 | 175 | 'section' => 'lsx-layout', |
| 176 | 176 | 'type' => 'checkbox', |
| 177 | 177 | ); |
| 178 | - $lsx_controls['settings']['lsx_header_search'] = array( |
|
| 178 | + $lsx_controls['settings']['lsx_header_search'] = array( |
|
| 179 | 179 | 'default' => false, //Default setting/value to save |
| 180 | 180 | 'sanitize_callback' => 'lsx_sanitize_checkbox', |
| 181 | 181 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 182 | 182 | ); |
| 183 | 183 | $lsx_controls['fields']['lsx_header_search'] = array( |
| 184 | - 'label' => __('Search Box in Header','lsx'), |
|
| 184 | + 'label' => __('Search Box in Header', 'lsx'), |
|
| 185 | 185 | 'section' => 'lsx-layout', |
| 186 | 186 | 'type' => 'checkbox', |
| 187 | 187 | ); |
| 188 | 188 | $lsx_controls['fields']['lsx_layout'] = array( |
| 189 | - 'label' => __('Body','lsx'), |
|
| 189 | + 'label' => __('Body', 'lsx'), |
|
| 190 | 190 | 'section' => 'lsx-layout', |
| 191 | 191 | 'control' => 'LSX_Customize_Layout_Control', |
| 192 | - 'choices' => array('1c','2cr','2cl') |
|
| 192 | + 'choices' => array('1c', '2cr', '2cl') |
|
| 193 | 193 | ); |
| 194 | 194 | return $lsx_controls; |
| 195 | 195 | } |
| 196 | -add_filter('lsx_customizer_controls','lsx_customizer_layout_controls'); |
|
| 196 | +add_filter('lsx_customizer_controls', 'lsx_customizer_layout_controls'); |
|
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * Returns an array of the font controls. |
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | function lsx_customizer_font_controls($lsx_controls) { |
| 207 | 207 | $lsx_controls['sections']['lsx-font'] = array( |
| 208 | - 'title' => __( 'Font', 'lsx' ), |
|
| 208 | + 'title' => __('Font', 'lsx'), |
|
| 209 | 209 | 'description' => 'Change the fonts sitewide.', |
| 210 | 210 | 'priority' => 41 |
| 211 | 211 | ); |
| 212 | - $lsx_controls['settings']['lsx_font'] = array( |
|
| 212 | + $lsx_controls['settings']['lsx_font'] = array( |
|
| 213 | 213 | 'default' => 'raleway_open_sans', //Default setting/value to save |
| 214 | 214 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 215 | 215 | 'transport' => 'refresh', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | 'choices' => array( |
| 224 | 224 | 'raleway_open_sans' => array( |
| 225 | 225 | 'header' => array( |
| 226 | - "title" => __( 'Raleway', 'lsx' ), |
|
| 226 | + "title" => __('Raleway', 'lsx'), |
|
| 227 | 227 | "location" => "Raleway", |
| 228 | 228 | "cssDeclaration" => "'Raleway', sans-serif", |
| 229 | 229 | "cssClass" => "raleway", |
| 230 | 230 | ), |
| 231 | 231 | 'body' => array( |
| 232 | - "title" => __( 'Open Sans', 'lsx' ), |
|
| 232 | + "title" => __('Open Sans', 'lsx'), |
|
| 233 | 233 | "location" => "Open+Sans", |
| 234 | 234 | "cssDeclaration" => "'Open Sans', sans-serif", |
| 235 | 235 | "cssClass" => "openSans" |
@@ -237,13 +237,13 @@ discard block |
||
| 237 | 237 | ), |
| 238 | 238 | 'noto_serif_noto_sans' => array( |
| 239 | 239 | 'header' => array( |
| 240 | - "title" => __( 'Noto Serif', 'lsx' ), |
|
| 240 | + "title" => __('Noto Serif', 'lsx'), |
|
| 241 | 241 | "location" => "Noto+Serif", |
| 242 | 242 | "cssDeclaration" => "'Noto Serif', serif", |
| 243 | 243 | "cssClass" => "notoSerif", |
| 244 | 244 | ), |
| 245 | 245 | 'body' => array( |
| 246 | - "title" => __( 'Noto Sans', 'lsx' ), |
|
| 246 | + "title" => __('Noto Sans', 'lsx'), |
|
| 247 | 247 | "location" => "Noto+Sans", |
| 248 | 248 | "cssDeclaration" => "'Noto Sans', sans-serif", |
| 249 | 249 | "cssClass" => "notoSans", |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | ), |
| 252 | 252 | 'noto_sans_noto_sans' => array( |
| 253 | 253 | 'header' => array( |
| 254 | - "title" => __( 'Noto Sans', 'lsx' ), |
|
| 254 | + "title" => __('Noto Sans', 'lsx'), |
|
| 255 | 255 | "location" => "Noto+Sans", |
| 256 | 256 | "cssDeclaration" => "'Noto Sans', sans-serif", |
| 257 | 257 | "cssClass" => "notoSans", |
| 258 | 258 | ), |
| 259 | 259 | 'body' => array( |
| 260 | - "title" => __( 'Noto Sans', 'lsx' ), |
|
| 260 | + "title" => __('Noto Sans', 'lsx'), |
|
| 261 | 261 | "location" => "Noto+Sans", |
| 262 | 262 | "cssDeclaration" => "'Noto Sans', sans-serif", |
| 263 | 263 | "cssClass" => "notoSans", |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | ), |
| 266 | 266 | 'alegreya_open_sans' => array( |
| 267 | 267 | 'header' => array( |
| 268 | - "title" => __( 'Alegreya', 'lsx' ), |
|
| 268 | + "title" => __('Alegreya', 'lsx'), |
|
| 269 | 269 | "location" => "Alegreya", |
| 270 | 270 | "cssDeclaration" => "'Alegreya', serif", |
| 271 | 271 | "cssClass" => "alegreya", |
| 272 | 272 | ), |
| 273 | 273 | 'body' => array( |
| 274 | - "title" => __( 'Open Sans', 'lsx' ), |
|
| 274 | + "title" => __('Open Sans', 'lsx'), |
|
| 275 | 275 | "location" => "Open+Sans", |
| 276 | 276 | "cssDeclaration" => "'Open Sans', sans-serif", |
| 277 | 277 | "cssClass" => "openSans" |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | ); |
| 283 | 283 | return $lsx_controls; |
| 284 | 284 | } |
| 285 | -add_filter('lsx_customizer_controls','lsx_customizer_font_controls'); |
|
| 285 | +add_filter('lsx_customizer_controls', 'lsx_customizer_font_controls'); |
|
| 286 | 286 | |
| 287 | 287 | /** |
| 288 | 288 | * Returns an array of $controls for the customizer class to generate. |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | * @category customizer |
| 293 | 293 | * @return $lsx_controls array() |
| 294 | 294 | */ |
| 295 | -function lsx_get_customizer_controls(){ |
|
| 295 | +function lsx_get_customizer_controls() { |
|
| 296 | 296 | $lsx_controls = array(); |
| 297 | 297 | $lsx_controls = apply_filters('lsx_customizer_controls', $lsx_controls); |
| 298 | 298 | return $lsx_controls; |
| 299 | 299 | } |
| 300 | -$lsx_customizer = new LSX_Theme_Customizer( lsx_get_customizer_controls() ); |
|
| 300 | +$lsx_customizer = new LSX_Theme_Customizer(lsx_get_customizer_controls()); |
|
| 301 | 301 | |
| 302 | -add_image_size( 'lsx-thumbnail-wide', 350, 230, true ); |
|
| 303 | -add_image_size( 'lsx-thumbnail-single', 750, 350, true ); |
|
| 304 | 302 | \ No newline at end of file |
| 303 | +add_image_size('lsx-thumbnail-wide', 350, 230, true); |
|
| 304 | +add_image_size('lsx-thumbnail-single', 750, 350, true); |
|
| 305 | 305 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Customizer Configuration File |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @author [email protected] <lsdev.biz> |
| 10 | 10 | * |
| 11 | 11 | */ |
| 12 | -if ( ! class_exists( 'LSX_Theme_Customizer' ) ) { |
|
| 12 | +if ( ! class_exists('LSX_Theme_Customizer')) { |
|
| 13 | 13 | |
| 14 | 14 | class LSX_Theme_Customizer { |
| 15 | 15 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @since 1.0.0 |
| 31 | 31 | */ |
| 32 | - public function __construct( $controls ) { |
|
| 32 | + public function __construct($controls) { |
|
| 33 | 33 | require get_template_directory() . '/inc/google-font.php'; |
| 34 | 34 | require get_template_directory() . '/inc/google-font-collection.php'; |
| 35 | 35 | require get_template_directory() . '/inc/customizer-core.php'; |
@@ -40,19 +40,19 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->controls = $controls; |
| 42 | 42 | |
| 43 | - add_action( 'customize_preview_init', array($this,'customize_preview_js' ),20); |
|
| 44 | - add_action( 'customize_register', array($this,'customizer'), 11 ); |
|
| 43 | + add_action('customize_preview_init', array($this, 'customize_preview_js'), 20); |
|
| 44 | + add_action('customize_register', array($this, 'customizer'), 11); |
|
| 45 | 45 | |
| 46 | - add_action( 'wp_ajax_customizer_site_title', array($this,'ajax_site_title') ); |
|
| 47 | - add_action( 'wp_ajax_nopriv_customizer_site_title', array($this,'ajax_site_title') ); |
|
| 46 | + add_action('wp_ajax_customizer_site_title', array($this, 'ajax_site_title')); |
|
| 47 | + add_action('wp_ajax_nopriv_customizer_site_title', array($this, 'ajax_site_title')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. |
| 52 | 52 | */ |
| 53 | 53 | function customize_preview_js() { |
| 54 | - wp_enqueue_script( 'lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ) , wp_get_theme()->Version, true ); |
|
| 55 | - wp_localize_script( 'lsx_customizer', 'lsx_customizer_params', array( 'template_directory' => get_template_directory_uri() ) ); |
|
| 54 | + wp_enqueue_script('lsx_customizer', get_template_directory_uri() . '/js/customizer.js', array('customize-preview'), wp_get_theme()->Version, true); |
|
| 55 | + wp_localize_script('lsx_customizer', 'lsx_customizer_params', array('template_directory' => get_template_directory_uri())); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -60,38 +60,38 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @since 1.0.0 |
| 62 | 62 | */ |
| 63 | - public function customizer( $wp_customize ) { |
|
| 63 | + public function customizer($wp_customize) { |
|
| 64 | 64 | // start panels |
| 65 | - if( !empty( $this->controls['panels'] ) ){ |
|
| 66 | - foreach( $this->controls['panels'] as $panel_slug => $args ){ |
|
| 67 | - $this->add_panel( $panel_slug, $args, $wp_customize ); |
|
| 65 | + if ( ! empty($this->controls['panels'])) { |
|
| 66 | + foreach ($this->controls['panels'] as $panel_slug => $args) { |
|
| 67 | + $this->add_panel($panel_slug, $args, $wp_customize); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // start sections |
| 72 | - if( !empty( $this->controls['sections'] ) ){ |
|
| 73 | - foreach( $this->controls['sections'] as $section_slug => $args ){ |
|
| 74 | - $this->add_section( $section_slug, $args, $wp_customize ); |
|
| 72 | + if ( ! empty($this->controls['sections'])) { |
|
| 73 | + foreach ($this->controls['sections'] as $section_slug => $args) { |
|
| 74 | + $this->add_section($section_slug, $args, $wp_customize); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | // start settings |
| 79 | - if( !empty( $this->controls['settings'] ) ){ |
|
| 80 | - foreach( $this->controls['settings'] as $settings_slug => $args ){ |
|
| 81 | - $this->add_setting( $settings_slug, $args, $wp_customize ); |
|
| 79 | + if ( ! empty($this->controls['settings'])) { |
|
| 80 | + foreach ($this->controls['settings'] as $settings_slug => $args) { |
|
| 81 | + $this->add_setting($settings_slug, $args, $wp_customize); |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // start fields |
| 86 | - if( !empty( $this->controls['fields'] ) ){ |
|
| 87 | - foreach( $this->controls['fields'] as $field_slug => $args ){ |
|
| 88 | - $this->add_control( $field_slug, $args, $wp_customize ); |
|
| 86 | + if ( ! empty($this->controls['fields'])) { |
|
| 87 | + foreach ($this->controls['fields'] as $field_slug => $args) { |
|
| 88 | + $this->add_control($field_slug, $args, $wp_customize); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; |
|
| 93 | - $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; |
|
| 94 | - $wp_customize->get_setting( 'background_color' )->transport = 'postMessage'; |
|
| 92 | + $wp_customize->get_setting('blogname')->transport = 'postMessage'; |
|
| 93 | + $wp_customize->get_setting('blogdescription')->transport = 'postMessage'; |
|
| 94 | + $wp_customize->get_setting('background_color')->transport = 'postMessage'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @since 1.0.0 |
| 101 | 101 | */ |
| 102 | - private function add_panel( $slug, $args, $wp_customize ) { |
|
| 102 | + private function add_panel($slug, $args, $wp_customize) { |
|
| 103 | 103 | $default_args = array( |
| 104 | 104 | 'title' => null, |
| 105 | 105 | 'description' => null, |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $wp_customize->add_panel( |
| 109 | 109 | $slug, |
| 110 | - array_merge( $default_args, $args ) |
|
| 110 | + array_merge($default_args, $args) |
|
| 111 | 111 | ); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -116,14 +116,14 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @since 1.0.0 |
| 118 | 118 | */ |
| 119 | - private function add_section( $slug, $args, $wp_customize ) { |
|
| 119 | + private function add_section($slug, $args, $wp_customize) { |
|
| 120 | 120 | $default_args = array( |
| 121 | 121 | 'capability' => 'edit_theme_options', //Capability needed to tweak |
| 122 | 122 | 'description' => null, //Descriptive tooltip |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $wp_customize->add_section( $slug, |
|
| 126 | - array_merge( $default_args, $args ) |
|
| 125 | + $wp_customize->add_section($slug, |
|
| 126 | + array_merge($default_args, $args) |
|
| 127 | 127 | ); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | * |
| 133 | 133 | * @since 1.0.0 |
| 134 | 134 | */ |
| 135 | - private function add_setting( $slug, $args, $wp_customize ) { |
|
| 136 | - $wp_customize->add_setting( $slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
| 137 | - array_merge( array( |
|
| 135 | + private function add_setting($slug, $args, $wp_customize) { |
|
| 136 | + $wp_customize->add_setting($slug, //No need to use a SERIALIZED name, as `theme_mod` settings already live under one db record |
|
| 137 | + array_merge(array( |
|
| 138 | 138 | 'default' => null, //Default setting/value to save |
| 139 | 139 | 'type' => 'theme_mod', //Is this an 'option' or a 'theme_mod'? |
| 140 | 140 | 'capability' => 'edit_theme_options', //Optional. Special permissions for accessing this setting. |
| 141 | 141 | 'transport' => 'postMessage', //What triggers a refresh of the setting? 'refresh' or 'postMessage' (instant)? |
| 142 | 142 | 'sanitize_callback' => 'lsx_sanitize_choices' |
| 143 | - ), $args ) |
|
| 143 | + ), $args) |
|
| 144 | 144 | ); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,28 +149,28 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @since 1.0.0 |
| 151 | 151 | */ |
| 152 | - private function add_control( $slug, $args, $wp_customize ) { |
|
| 152 | + private function add_control($slug, $args, $wp_customize) { |
|
| 153 | 153 | $default_args = array( |
| 154 | 154 | |
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | - if( isset( $args['control'] ) && class_exists( $args['control'] )){ |
|
| 157 | + if (isset($args['control']) && class_exists($args['control'])) { |
|
| 158 | 158 | |
| 159 | 159 | $control_class = $args['control']; |
| 160 | - unset( $args['control'] ); |
|
| 160 | + unset($args['control']); |
|
| 161 | 161 | |
| 162 | - $control = new $control_class( $wp_customize, $slug, array_merge( $default_args, $args ) ); |
|
| 163 | - $wp_customize->add_control( $control ); |
|
| 162 | + $control = new $control_class($wp_customize, $slug, array_merge($default_args, $args)); |
|
| 163 | + $wp_customize->add_control($control); |
|
| 164 | 164 | |
| 165 | - }else{ |
|
| 165 | + } else { |
|
| 166 | 166 | |
| 167 | - if( isset( $args['control'] ) ){ |
|
| 168 | - unset( $args['control'] ); |
|
| 167 | + if (isset($args['control'])) { |
|
| 168 | + unset($args['control']); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $wp_customize->add_control( |
| 172 | 172 | $slug, |
| 173 | - array_merge( $default_args, $args ) |
|
| 173 | + array_merge($default_args, $args) |
|
| 174 | 174 | ); |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Theme Configuration File |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * @package lsx |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( ! function_exists( 'lsx_setup' ) ) : |
|
| 11 | +if ( ! function_exists('lsx_setup')) : |
|
| 12 | 12 | /** |
| 13 | 13 | * Sets up theme defaults and registers support for various WordPress features. |
| 14 | 14 | * |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | function lsx_setup() { |
| 20 | 20 | global $content_width; |
| 21 | 21 | |
| 22 | - load_theme_textdomain( 'lsx', get_template_directory() . '/languages' ); |
|
| 22 | + load_theme_textdomain('lsx', get_template_directory() . '/languages'); |
|
| 23 | 23 | |
| 24 | 24 | $args = array( |
| 25 | 25 | 'header-text' => array( |
@@ -28,51 +28,51 @@ discard block |
||
| 28 | 28 | ), |
| 29 | 29 | 'size' => 'medium', |
| 30 | 30 | ); |
| 31 | - add_theme_support( 'site-logo', $args ); |
|
| 31 | + add_theme_support('site-logo', $args); |
|
| 32 | 32 | |
| 33 | - add_theme_support( 'custom-logo', array( |
|
| 33 | + add_theme_support('custom-logo', array( |
|
| 34 | 34 | 'height' => 50, |
| 35 | 35 | 'width' => 150, |
| 36 | 36 | 'flex-width' => true, |
| 37 | 37 | 'flex-height' => true, |
| 38 | - ) ); |
|
| 38 | + )); |
|
| 39 | 39 | |
| 40 | - add_theme_support( 'custom-background' ); |
|
| 41 | - add_theme_support( 'automatic-feed-links' ); |
|
| 42 | - add_theme_support( 'title-tag' ); |
|
| 43 | - add_theme_support( 'post-thumbnails' ); |
|
| 44 | - add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') ); |
|
| 40 | + add_theme_support('custom-background'); |
|
| 41 | + add_theme_support('automatic-feed-links'); |
|
| 42 | + add_theme_support('title-tag'); |
|
| 43 | + add_theme_support('post-thumbnails'); |
|
| 44 | + add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside')); |
|
| 45 | 45 | |
| 46 | 46 | // This theme uses wp_nav_menu() in one location. |
| 47 | - register_nav_menus( array( |
|
| 48 | - 'primary' => __( 'Primary Menu', 'lsx' ), |
|
| 49 | - 'top-menu'=> __( 'Top Menu' , 'lsx' ), |
|
| 50 | - 'social'=> __( 'Social Menu' , 'lsx' ), |
|
| 51 | - 'footer'=> __( 'Footer Menu' , 'lsx' ) |
|
| 52 | - ) ); |
|
| 47 | + register_nav_menus(array( |
|
| 48 | + 'primary' => __('Primary Menu', 'lsx'), |
|
| 49 | + 'top-menu'=> __('Top Menu', 'lsx'), |
|
| 50 | + 'social'=> __('Social Menu', 'lsx'), |
|
| 51 | + 'footer'=> __('Footer Menu', 'lsx') |
|
| 52 | + )); |
|
| 53 | 53 | |
| 54 | 54 | //Set the content width |
| 55 | 55 | $content_width = 1140; |
| 56 | 56 | |
| 57 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
| 58 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
| 57 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
| 58 | + add_theme_support('html5', array('caption')); |
|
| 59 | 59 | |
| 60 | - add_theme_support( 'woocommerce' ); |
|
| 61 | - add_theme_support( 'sensei' ); |
|
| 60 | + add_theme_support('woocommerce'); |
|
| 61 | + add_theme_support('sensei'); |
|
| 62 | 62 | } |
| 63 | 63 | endif; // lsx_setup |
| 64 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
| 64 | +add_action('after_setup_theme', 'lsx_setup'); |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Removes the "Custom Fields" meta box. |
| 68 | 68 | */ |
| 69 | 69 | function lsx_remove_meta_boxes() { |
| 70 | 70 | $post_types = get_post_types(); |
| 71 | - foreach($post_types as $post_type){ |
|
| 72 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
| 71 | + foreach ($post_types as $post_type) { |
|
| 72 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
| 75 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -84,33 +84,33 @@ discard block |
||
| 84 | 84 | function lsx_process_content_width() { |
| 85 | 85 | global $content_width; |
| 86 | 86 | |
| 87 | - if( |
|
| 87 | + if ( |
|
| 88 | 88 | is_page_template('page-templates/template-portfolio.php') || |
| 89 | 89 | is_page_template('page-templates/template-front-page.php') || |
| 90 | 90 | is_page_template('page-templates/template-full-width.php') || |
| 91 | 91 | is_post_type_archive('jetpack-portfolio') || |
| 92 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
| 92 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
| 93 | 93 | is_singular('jetpack-portfolio') |
| 94 | - ){ |
|
| 94 | + ) { |
|
| 95 | 95 | $content_width = 1140; |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | -add_action('wp_head','lsx_process_content_width'); |
|
| 98 | +add_action('wp_head', 'lsx_process_content_width'); |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * Disable the comments form by default for the page post type. |
| 102 | 102 | * @package lsx |
| 103 | 103 | * @subpackage config |
| 104 | 104 | */ |
| 105 | -function lsx_page_comments_off( $data ) { |
|
| 106 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
| 105 | +function lsx_page_comments_off($data) { |
|
| 106 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
| 107 | 107 | $data['comment_status'] = 0; |
| 108 | 108 | $data['ping_status'] = 0; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $data; |
| 112 | 112 | } |
| 113 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
| 113 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * Disable the comments form by default for the page post type. |
@@ -118,14 +118,14 @@ discard block |
||
| 118 | 118 | * @subpackage config |
| 119 | 119 | */ |
| 120 | 120 | function lsx_is_legacy($data) { |
| 121 | - if ( 'page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__( 'Auto Draft', 'lsx' ) == $data['post_title'] ) { |
|
| 121 | + if ('page' == $data['post_type'] && 'auto-draft' == $data['post_status'] && esc_html__('Auto Draft', 'lsx') == $data['post_title']) { |
|
| 122 | 122 | $data['comment_status'] = 0; |
| 123 | 123 | $data['ping_status'] = 0; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | return $data; |
| 127 | 127 | } |
| 128 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
| 128 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * Run the init command |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | * @subpackage config |
| 134 | 134 | */ |
| 135 | 135 | function lsx_init() { |
| 136 | - if(class_exists('WooCommerce')){ |
|
| 137 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
| 136 | + if (class_exists('WooCommerce')) { |
|
| 137 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | -add_action( 'init', 'lsx_init',100 ); |
|
| 140 | +add_action('init', 'lsx_init', 100); |
|
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | 143 | * Run on the wp_head |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | function lsx_wp_head() { |
| 148 | 148 | |
| 149 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 150 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 149 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 150 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 151 | 151 | |
| 152 | - if('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post','page','jetpack-portfolio')) && !is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format')) ){ |
|
| 153 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
| 152 | + if ('1c' === $layout && (is_author() || is_search() || (is_post_type_archive(array('post', 'page', 'jetpack-portfolio')) && ! is_post_type_archive('tribe_events')) || is_tag() || is_category() || is_date() || is_tax('post_format'))) { |
|
| 153 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
| 156 | +add_action('wp_head', 'lsx_wp_head', 100); |
|
@@ -1,70 +1,70 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) return; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) return; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | global $customizer_colour_names; |
| 5 | 5 | global $customizer_colour_choices; |
| 6 | 6 | |
| 7 | -$customizer_colour_names = apply_filters( 'lsx_customizer_colour_names', array( |
|
| 8 | - 'button_background_color' => esc_html__( 'BUTTON: Background', 'lsx' ), |
|
| 9 | - 'button_background_hover_color' => esc_html__( 'BUTTON: Background (hover)', 'lsx' ), |
|
| 10 | - 'button_text_color' => esc_html__( 'BUTTON: Text', 'lsx' ), |
|
| 11 | - 'button_text_color_hover' => esc_html__( 'BUTTON: Text (hover)', 'lsx' ), |
|
| 12 | - |
|
| 13 | - 'button_cta_background_color' => esc_html__( 'BUTTON CTA: Background', 'lsx' ), |
|
| 14 | - 'button_cta_background_hover_color' => esc_html__( 'BUTTON CTA: Background (hover)', 'lsx' ), |
|
| 15 | - 'button_cta_text_color' => esc_html__( 'BUTTON CTA: Text', 'lsx' ), |
|
| 16 | - 'button_cta_text_color_hover' => esc_html__( 'BUTTON CTA: Text (hover)', 'lsx' ), |
|
| 17 | - |
|
| 18 | - 'top_menu_background_color' => esc_html__( 'TOP MENU: Background', 'lsx' ), |
|
| 19 | - 'top_menu_text_color' => esc_html__( 'TOP MENU: Text', 'lsx' ), |
|
| 20 | - 'top_menu_text_hover_color' => esc_html__( 'TOP MENU: Text (hover)', 'lsx' ), |
|
| 21 | - |
|
| 22 | - 'header_background_color' => esc_html__( 'HEADER: Background', 'lsx' ), |
|
| 23 | - 'header_title_color' => esc_html__( 'HEADER: Title', 'lsx' ), |
|
| 24 | - 'header_title_hover_color' => esc_html__( 'HEADER: Title (hover)', 'lsx' ), |
|
| 25 | - 'header_description_color' => esc_html__( 'HEADER: Description', 'lsx' ), |
|
| 26 | - |
|
| 27 | - 'main_menu_background_hover1_color' => esc_html__( 'MENU: Background (L1 hover)', 'lsx' ), |
|
| 28 | - 'main_menu_background_hover2_color' => esc_html__( 'MENU: Background (L2 hover)', 'lsx' ), |
|
| 29 | - 'main_menu_text_color' => esc_html__( 'MENU: Text (L1)', 'lsx' ), |
|
| 30 | - 'main_menu_text_hover1_color' => esc_html__( 'MENU: Text (L1 hover)', 'lsx' ), |
|
| 31 | - 'main_menu_text_hover2_color' => esc_html__( 'MENU: Text (L2 hover)', 'lsx' ), |
|
| 32 | - |
|
| 33 | - 'banner_background_color' => esc_html__( 'BANNER: Background', 'lsx' ), |
|
| 34 | - 'banner_text_color' => esc_html__( 'BANNER: Text', 'lsx' ), |
|
| 35 | - 'banner_text_image_color' => esc_html__( 'BANNER: Text (over image)', 'lsx' ), |
|
| 36 | - |
|
| 37 | - 'background_color' => esc_html__( 'BODY: Background', 'lsx' ), |
|
| 38 | - 'body_line_color' => esc_html__( 'BODY: Line', 'lsx' ), |
|
| 39 | - 'body_text_heading_color' => esc_html__( 'BODY: Text (heading)', 'lsx' ), |
|
| 40 | - 'body_text_color' => esc_html__( 'BODY: Text', 'lsx' ), |
|
| 41 | - 'body_link_color' => esc_html__( 'BODY: Link', 'lsx' ), |
|
| 42 | - 'body_link_hover_color' => esc_html__( 'BODY: Link (hover)', 'lsx' ), |
|
| 43 | - 'body_section_full_background_color' => esc_html__( 'BODY: Section full (background)', 'lsx' ), |
|
| 44 | - 'body_section_full_text_color' => esc_html__( 'BODY: Section full (text)', 'lsx' ), |
|
| 45 | - 'body_section_full_cta_background_color' => esc_html__( 'BODY: Section full CTA (background)', 'lsx' ), |
|
| 46 | - 'body_section_full_cta_text_color' => esc_html__( 'BODY: Section full CTA (text)', 'lsx' ), |
|
| 47 | - |
|
| 48 | - 'footer_cta_background_color' => esc_html__( 'FOOTER CTA: Background', 'lsx' ), |
|
| 49 | - 'footer_cta_text_color' => esc_html__( 'FOOTER CTA: Text', 'lsx' ), |
|
| 50 | - 'footer_cta_link_color' => esc_html__( 'FOOTER CTA: Link', 'lsx' ), |
|
| 51 | - 'footer_cta_link_hover_color' => esc_html__( 'FOOTER CTA: Link (hover)', 'lsx' ), |
|
| 52 | - |
|
| 53 | - 'footer_widgets_background_color' => esc_html__( 'FOOTER WIDGETS: Background', 'lsx' ), |
|
| 54 | - 'footer_widgets_text_color' => esc_html__( 'FOOTER WIDGETS: Text', 'lsx' ), |
|
| 55 | - 'footer_widgets_link_color' => esc_html__( 'FOOTER WIDGETS: Link', 'lsx' ), |
|
| 56 | - 'footer_widgets_link_hover_color' => esc_html__( 'FOOTER WIDGETS: Link (hover)', 'lsx' ), |
|
| 57 | - |
|
| 58 | - 'footer_background_color' => esc_html__( 'FOOTER: Background', 'lsx' ), |
|
| 59 | - 'footer_text_color' => esc_html__( 'FOOTER: Text', 'lsx' ), |
|
| 60 | - 'footer_link_color' => esc_html__( 'FOOTER: Link', 'lsx' ), |
|
| 61 | - 'footer_link_hover_color' => esc_html__( 'FOOTER: Link (hover)', 'lsx' ), |
|
| 62 | -) ); |
|
| 63 | - |
|
| 64 | -$customizer_colour_choices = apply_filters( 'lsx_customizer_colour_choices', array( |
|
| 7 | +$customizer_colour_names = apply_filters('lsx_customizer_colour_names', array( |
|
| 8 | + 'button_background_color' => esc_html__('BUTTON: Background', 'lsx'), |
|
| 9 | + 'button_background_hover_color' => esc_html__('BUTTON: Background (hover)', 'lsx'), |
|
| 10 | + 'button_text_color' => esc_html__('BUTTON: Text', 'lsx'), |
|
| 11 | + 'button_text_color_hover' => esc_html__('BUTTON: Text (hover)', 'lsx'), |
|
| 12 | + |
|
| 13 | + 'button_cta_background_color' => esc_html__('BUTTON CTA: Background', 'lsx'), |
|
| 14 | + 'button_cta_background_hover_color' => esc_html__('BUTTON CTA: Background (hover)', 'lsx'), |
|
| 15 | + 'button_cta_text_color' => esc_html__('BUTTON CTA: Text', 'lsx'), |
|
| 16 | + 'button_cta_text_color_hover' => esc_html__('BUTTON CTA: Text (hover)', 'lsx'), |
|
| 17 | + |
|
| 18 | + 'top_menu_background_color' => esc_html__('TOP MENU: Background', 'lsx'), |
|
| 19 | + 'top_menu_text_color' => esc_html__('TOP MENU: Text', 'lsx'), |
|
| 20 | + 'top_menu_text_hover_color' => esc_html__('TOP MENU: Text (hover)', 'lsx'), |
|
| 21 | + |
|
| 22 | + 'header_background_color' => esc_html__('HEADER: Background', 'lsx'), |
|
| 23 | + 'header_title_color' => esc_html__('HEADER: Title', 'lsx'), |
|
| 24 | + 'header_title_hover_color' => esc_html__('HEADER: Title (hover)', 'lsx'), |
|
| 25 | + 'header_description_color' => esc_html__('HEADER: Description', 'lsx'), |
|
| 26 | + |
|
| 27 | + 'main_menu_background_hover1_color' => esc_html__('MENU: Background (L1 hover)', 'lsx'), |
|
| 28 | + 'main_menu_background_hover2_color' => esc_html__('MENU: Background (L2 hover)', 'lsx'), |
|
| 29 | + 'main_menu_text_color' => esc_html__('MENU: Text (L1)', 'lsx'), |
|
| 30 | + 'main_menu_text_hover1_color' => esc_html__('MENU: Text (L1 hover)', 'lsx'), |
|
| 31 | + 'main_menu_text_hover2_color' => esc_html__('MENU: Text (L2 hover)', 'lsx'), |
|
| 32 | + |
|
| 33 | + 'banner_background_color' => esc_html__('BANNER: Background', 'lsx'), |
|
| 34 | + 'banner_text_color' => esc_html__('BANNER: Text', 'lsx'), |
|
| 35 | + 'banner_text_image_color' => esc_html__('BANNER: Text (over image)', 'lsx'), |
|
| 36 | + |
|
| 37 | + 'background_color' => esc_html__('BODY: Background', 'lsx'), |
|
| 38 | + 'body_line_color' => esc_html__('BODY: Line', 'lsx'), |
|
| 39 | + 'body_text_heading_color' => esc_html__('BODY: Text (heading)', 'lsx'), |
|
| 40 | + 'body_text_color' => esc_html__('BODY: Text', 'lsx'), |
|
| 41 | + 'body_link_color' => esc_html__('BODY: Link', 'lsx'), |
|
| 42 | + 'body_link_hover_color' => esc_html__('BODY: Link (hover)', 'lsx'), |
|
| 43 | + 'body_section_full_background_color' => esc_html__('BODY: Section full (background)', 'lsx'), |
|
| 44 | + 'body_section_full_text_color' => esc_html__('BODY: Section full (text)', 'lsx'), |
|
| 45 | + 'body_section_full_cta_background_color' => esc_html__('BODY: Section full CTA (background)', 'lsx'), |
|
| 46 | + 'body_section_full_cta_text_color' => esc_html__('BODY: Section full CTA (text)', 'lsx'), |
|
| 47 | + |
|
| 48 | + 'footer_cta_background_color' => esc_html__('FOOTER CTA: Background', 'lsx'), |
|
| 49 | + 'footer_cta_text_color' => esc_html__('FOOTER CTA: Text', 'lsx'), |
|
| 50 | + 'footer_cta_link_color' => esc_html__('FOOTER CTA: Link', 'lsx'), |
|
| 51 | + 'footer_cta_link_hover_color' => esc_html__('FOOTER CTA: Link (hover)', 'lsx'), |
|
| 52 | + |
|
| 53 | + 'footer_widgets_background_color' => esc_html__('FOOTER WIDGETS: Background', 'lsx'), |
|
| 54 | + 'footer_widgets_text_color' => esc_html__('FOOTER WIDGETS: Text', 'lsx'), |
|
| 55 | + 'footer_widgets_link_color' => esc_html__('FOOTER WIDGETS: Link', 'lsx'), |
|
| 56 | + 'footer_widgets_link_hover_color' => esc_html__('FOOTER WIDGETS: Link (hover)', 'lsx'), |
|
| 57 | + |
|
| 58 | + 'footer_background_color' => esc_html__('FOOTER: Background', 'lsx'), |
|
| 59 | + 'footer_text_color' => esc_html__('FOOTER: Text', 'lsx'), |
|
| 60 | + 'footer_link_color' => esc_html__('FOOTER: Link', 'lsx'), |
|
| 61 | + 'footer_link_hover_color' => esc_html__('FOOTER: Link (hover)', 'lsx'), |
|
| 62 | +)); |
|
| 63 | + |
|
| 64 | +$customizer_colour_choices = apply_filters('lsx_customizer_colour_choices', array( |
|
| 65 | 65 | 'default' => array( |
| 66 | - 'label' => __( 'Default', 'lsx' ), |
|
| 67 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_default', array( |
|
| 66 | + 'label' => __('Default', 'lsx'), |
|
| 67 | + 'colors' => apply_filters('lsx_customizer_colour_choices_default', array( |
|
| 68 | 68 | 'button_background_color' => '#428bca', |
| 69 | 69 | 'button_background_hover_color' => '#2a6496', |
| 70 | 70 | 'button_text_color' => '#ffffff', |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | 'footer_text_color' => '#ffffff', |
| 120 | 120 | 'footer_link_color' => '#337ab7', |
| 121 | 121 | 'footer_link_hover_color' => '#969696', |
| 122 | - ) ) |
|
| 122 | + )) |
|
| 123 | 123 | ), |
| 124 | 124 | 'red' => array( |
| 125 | - 'label' => __( 'Red', 'lsx' ), |
|
| 126 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_red', array( |
|
| 125 | + 'label' => __('Red', 'lsx'), |
|
| 126 | + 'colors' => apply_filters('lsx_customizer_colour_choices_red', array( |
|
| 127 | 127 | 'button_background_color' => '#b64d3f', |
| 128 | 128 | 'button_background_hover_color' => '#87291c', |
| 129 | 129 | 'button_text_color' => '#ffffff', |
@@ -178,11 +178,11 @@ discard block |
||
| 178 | 178 | 'footer_text_color' => '#ffffff', |
| 179 | 179 | 'footer_link_color' => '#b64d3f', |
| 180 | 180 | 'footer_link_hover_color' => '#969696', |
| 181 | - ) ) |
|
| 181 | + )) |
|
| 182 | 182 | ), |
| 183 | 183 | 'orange' => array( |
| 184 | - 'label' => __( 'Orange', 'lsx' ), |
|
| 185 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_orange', array( |
|
| 184 | + 'label' => __('Orange', 'lsx'), |
|
| 185 | + 'colors' => apply_filters('lsx_customizer_colour_choices_orange', array( |
|
| 186 | 186 | 'button_background_color' => '#fbaf3f', |
| 187 | 187 | 'button_background_hover_color' => '#e49435', |
| 188 | 188 | 'button_text_color' => '#260e03', |
@@ -237,11 +237,11 @@ discard block |
||
| 237 | 237 | 'footer_text_color' => '#ffffff', |
| 238 | 238 | 'footer_link_color' => '#e4701e', |
| 239 | 239 | 'footer_link_hover_color' => '#969696', |
| 240 | - ) ) |
|
| 240 | + )) |
|
| 241 | 241 | ), |
| 242 | 242 | 'green' => array( |
| 243 | - 'label' => __( 'Green', 'lsx' ), |
|
| 244 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_green', array( |
|
| 243 | + 'label' => __('Green', 'lsx'), |
|
| 244 | + 'colors' => apply_filters('lsx_customizer_colour_choices_green', array( |
|
| 245 | 245 | 'button_background_color' => '#596b46', |
| 246 | 246 | 'button_background_hover_color' => '#3d4a30', |
| 247 | 247 | 'button_text_color' => '#ffffff', |
@@ -296,11 +296,11 @@ discard block |
||
| 296 | 296 | 'footer_text_color' => '#ffffff', |
| 297 | 297 | 'footer_link_color' => '#596b46', |
| 298 | 298 | 'footer_link_hover_color' => '#969696', |
| 299 | - ) ) |
|
| 299 | + )) |
|
| 300 | 300 | ), |
| 301 | 301 | 'brown' => array( |
| 302 | - 'label' => __( 'Brown', 'lsx' ), |
|
| 303 | - 'colors' => apply_filters( 'lsx_customizer_colour_choices_brown', array( |
|
| 302 | + 'label' => __('Brown', 'lsx'), |
|
| 303 | + 'colors' => apply_filters('lsx_customizer_colour_choices_brown', array( |
|
| 304 | 304 | 'button_background_color' => '#8c6a45', |
| 305 | 305 | 'button_background_hover_color' => '#5b452e', |
| 306 | 306 | 'button_text_color' => '#ffffff', |
@@ -355,6 +355,6 @@ discard block |
||
| 355 | 355 | 'footer_text_color' => '#ffffff', |
| 356 | 356 | 'footer_link_color' => '#8c6a45', |
| 357 | 357 | 'footer_link_hover_color' => '#969696', |
| 358 | - ) ) |
|
| 358 | + )) |
|
| 359 | 359 | ) |
| 360 | -) ); |
|
| 360 | +)); |
|