@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | * @subpackage template-tags |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -if ( ! function_exists( 'lsx_breadcrumbs' ) ) : |
|
| 13 | +if ( ! function_exists('lsx_breadcrumbs')) : |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Breadcrumbs. |
@@ -19,44 +19,44 @@ discard block |
||
| 19 | 19 | * @subpackage template-tags |
| 20 | 20 | */ |
| 21 | 21 | function lsx_breadcrumbs() { |
| 22 | - if ( ! function_exists( 'yoast_breadcrumb' ) && ! function_exists( 'woocommerce_breadcrumb' ) ) { |
|
| 22 | + if ( ! function_exists('yoast_breadcrumb') && ! function_exists('woocommerce_breadcrumb')) { |
|
| 23 | 23 | return null; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - $show_on_front = get_option( 'show_on_front' ); |
|
| 26 | + $show_on_front = get_option('show_on_front'); |
|
| 27 | 27 | |
| 28 | - if ( ( 'posts' === $show_on_front && is_home() ) || ( 'page' === $show_on_front && is_front_page() ) ) { |
|
| 28 | + if (('posts' === $show_on_front && is_home()) || ('page' === $show_on_front && is_front_page())) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if ( function_exists( 'woocommerce_breadcrumb' ) ) { |
|
| 32 | + if (function_exists('woocommerce_breadcrumb')) { |
|
| 33 | 33 | ob_start(); |
| 34 | 34 | |
| 35 | - woocommerce_breadcrumb( array( |
|
| 35 | + woocommerce_breadcrumb(array( |
|
| 36 | 36 | 'wrap_before' => '<div class="breadcrumbs-container breadcrumbs-woocommerce"><div class="container"><div class="row"><div class="col-xs-12">', |
| 37 | 37 | 'wrap_after' => '</div></div></div></div>', |
| 38 | 38 | 'before' => '<span>', |
| 39 | 39 | 'after' => '</span>', |
| 40 | - ) ); |
|
| 40 | + )); |
|
| 41 | 41 | |
| 42 | 42 | $output = ob_get_clean(); |
| 43 | - } elseif ( function_exists( 'yoast_breadcrumb' ) ) { |
|
| 44 | - $output = yoast_breadcrumb( null, null, false ); |
|
| 43 | + } elseif (function_exists('yoast_breadcrumb')) { |
|
| 44 | + $output = yoast_breadcrumb(null, null, false); |
|
| 45 | 45 | $output = '<div class="breadcrumbs-container breadcrumbs-yoast"><div class="container"><div class="row"><div class="col-xs-12">' . $output . '</div></div></div></div>'; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - $output = apply_filters( 'lsx_breadcrumbs', $output ); |
|
| 48 | + $output = apply_filters('lsx_breadcrumbs', $output); |
|
| 49 | 49 | |
| 50 | - echo wp_kses_post( $output ); |
|
| 50 | + echo wp_kses_post($output); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | endif; |
| 54 | 54 | |
| 55 | -add_action( 'lsx_banner_inner_top', 'lsx_breadcrumbs', 100 ); |
|
| 55 | +add_action('lsx_banner_inner_top', 'lsx_breadcrumbs', 100); |
|
| 56 | 56 | //add_action( 'lsx_banner_inner_bottom', 'lsx_breadcrumbs', 100 ); |
| 57 | -add_action( 'lsx_global_header_inner_bottom', 'lsx_breadcrumbs', 100 ); |
|
| 57 | +add_action('lsx_global_header_inner_bottom', 'lsx_breadcrumbs', 100); |
|
| 58 | 58 | |
| 59 | -if ( ! function_exists( 'lsx_breadcrumbs_wpseo_seperator_filter' ) ) : |
|
| 59 | +if ( ! function_exists('lsx_breadcrumbs_wpseo_seperator_filter')) : |
|
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * Replaces the seperator. |
@@ -64,16 +64,16 @@ discard block |
||
| 64 | 64 | * @package lsx |
| 65 | 65 | * @subpackage template-tags |
| 66 | 66 | */ |
| 67 | - function lsx_breadcrumbs_wpseo_seperator_filter( $seperator ) { |
|
| 67 | + function lsx_breadcrumbs_wpseo_seperator_filter($seperator) { |
|
| 68 | 68 | $seperator = '<i class="fa fa-angle-right" aria-hidden="true"></i>'; |
| 69 | 69 | return $seperator; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | endif; |
| 73 | 73 | |
| 74 | -add_filter( 'wpseo_breadcrumb_separator', 'lsx_breadcrumbs_wpseo_seperator_filter' ); |
|
| 74 | +add_filter('wpseo_breadcrumb_separator', 'lsx_breadcrumbs_wpseo_seperator_filter'); |
|
| 75 | 75 | |
| 76 | -if ( ! function_exists( 'lsx_breadcrumbs_woocommerce_seperator_filter' ) ) : |
|
| 76 | +if ( ! function_exists('lsx_breadcrumbs_woocommerce_seperator_filter')) : |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Replaces the seperator. |
@@ -81,16 +81,16 @@ discard block |
||
| 81 | 81 | * @package lsx |
| 82 | 82 | * @subpackage template-tags |
| 83 | 83 | */ |
| 84 | - function lsx_breadcrumbs_woocommerce_seperator_filter( $defaults ) { |
|
| 84 | + function lsx_breadcrumbs_woocommerce_seperator_filter($defaults) { |
|
| 85 | 85 | $defaults['delimiter'] = '<i class="fa fa-angle-right" aria-hidden="true"></i>'; |
| 86 | 86 | return $defaults; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | endif; |
| 90 | 90 | |
| 91 | -add_filter( 'woocommerce_breadcrumb_defaults', 'lsx_breadcrumbs_woocommerce_seperator_filter' ); |
|
| 91 | +add_filter('woocommerce_breadcrumb_defaults', 'lsx_breadcrumbs_woocommerce_seperator_filter'); |
|
| 92 | 92 | |
| 93 | -if ( ! function_exists( 'lsx_site_title' ) ) : |
|
| 93 | +if ( ! function_exists('lsx_site_title')) : |
|
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * Displays logo when applicable. |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | function lsx_site_title() { |
| 102 | 102 | ?> |
| 103 | 103 | <div class="site-branding"> |
| 104 | - <h1 class="site-title"><a title="<?php bloginfo( 'name' ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> |
|
| 105 | - <p class="site-description"><?php bloginfo( 'description' ); ?></p> |
|
| 104 | + <h1 class="site-title"><a title="<?php bloginfo('name'); ?>" href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a></h1> |
|
| 105 | + <p class="site-description"><?php bloginfo('description'); ?></p> |
|
| 106 | 106 | </div> |
| 107 | 107 | <?php |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | endif; |
| 111 | 111 | |
| 112 | -if ( ! function_exists( 'lsx_post_meta_list_top' ) ) : |
|
| 112 | +if ( ! function_exists('lsx_post_meta_list_top')) : |
|
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * Add customisable post meta (post list - above title). |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | endif; |
| 132 | 132 | |
| 133 | -if ( ! function_exists( 'lsx_post_meta_single_top' ) ) : |
|
| 133 | +if ( ! function_exists('lsx_post_meta_single_top')) : |
|
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | 136 | * Add customisable post meta (single post - above title). |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | endif; |
| 153 | 153 | |
| 154 | -if ( ! function_exists( 'lsx_post_meta_single_bottom' ) ) : |
|
| 154 | +if ( ! function_exists('lsx_post_meta_single_bottom')) : |
|
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * Add customisable post meta (single post - below title). |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | endif; |
| 172 | 172 | |
| 173 | -if ( ! function_exists( 'lsx_post_meta_avatar' ) ) : |
|
| 173 | +if ( ! function_exists('lsx_post_meta_avatar')) : |
|
| 174 | 174 | |
| 175 | 175 | /** |
| 176 | 176 | * Add customisable post meta: author's avatar. |
@@ -180,20 +180,20 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | function lsx_post_meta_avatar() { |
| 182 | 182 | $author = get_the_author(); |
| 183 | - $author_id = get_the_author_meta( 'ID' ); |
|
| 184 | - $author_avatar = get_avatar( $author_id, 80 ); |
|
| 185 | - $author_url = get_author_posts_url( $author_id ); |
|
| 183 | + $author_id = get_the_author_meta('ID'); |
|
| 184 | + $author_avatar = get_avatar($author_id, 80); |
|
| 185 | + $author_url = get_author_posts_url($author_id); |
|
| 186 | 186 | |
| 187 | 187 | printf( |
| 188 | 188 | '<a href="%1$s" class="post-meta-avatar">%2$s</a>', |
| 189 | - esc_url( $author_url ), |
|
| 190 | - wp_kses_post( $author_avatar ) |
|
| 189 | + esc_url($author_url), |
|
| 190 | + wp_kses_post($author_avatar) |
|
| 191 | 191 | ); |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | endif; |
| 195 | 195 | |
| 196 | -if ( ! function_exists( 'lsx_post_meta_date' ) ) : |
|
| 196 | +if ( ! function_exists('lsx_post_meta_date')) : |
|
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * Add customisable post meta: post date. |
@@ -204,23 +204,23 @@ discard block |
||
| 204 | 204 | function lsx_post_meta_date() { |
| 205 | 205 | $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; |
| 206 | 206 | |
| 207 | - $time_string = sprintf( $time_string, |
|
| 208 | - esc_attr( get_the_date( 'c' ) ), |
|
| 207 | + $time_string = sprintf($time_string, |
|
| 208 | + esc_attr(get_the_date('c')), |
|
| 209 | 209 | get_the_date(), |
| 210 | - esc_attr( get_the_modified_date( 'c' ) ), |
|
| 210 | + esc_attr(get_the_modified_date('c')), |
|
| 211 | 211 | get_the_modified_date() |
| 212 | 212 | ); |
| 213 | 213 | |
| 214 | 214 | printf( |
| 215 | 215 | '<span class="post-meta-time updated"><a href="%1$s" rel="bookmark">%2$s</a></span>', |
| 216 | - esc_url( get_permalink() ), |
|
| 217 | - wp_kses_post( $time_string ) |
|
| 216 | + esc_url(get_permalink()), |
|
| 217 | + wp_kses_post($time_string) |
|
| 218 | 218 | ); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | endif; |
| 222 | 222 | |
| 223 | -if ( ! function_exists( 'lsx_post_meta_author' ) ) : |
|
| 223 | +if ( ! function_exists('lsx_post_meta_author')) : |
|
| 224 | 224 | |
| 225 | 225 | /** |
| 226 | 226 | * Add customisable post meta: post author. |
@@ -230,27 +230,27 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | function lsx_post_meta_author() { |
| 232 | 232 | $author = get_the_author(); |
| 233 | - $author_url = get_author_posts_url( get_the_author_meta( 'ID' ) ); |
|
| 233 | + $author_url = get_author_posts_url(get_the_author_meta('ID')); |
|
| 234 | 234 | |
| 235 | - if ( empty( $author ) ) { |
|
| 235 | + if (empty($author)) { |
|
| 236 | 236 | global $post; |
| 237 | 237 | |
| 238 | - $author = get_user_by( 'ID', $post->post_author ); |
|
| 238 | + $author = get_user_by('ID', $post->post_author); |
|
| 239 | 239 | $author = $author->display_name; |
| 240 | - $author_url = get_author_posts_url( $post->post_author ); |
|
| 240 | + $author_url = get_author_posts_url($post->post_author); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | printf( |
| 244 | 244 | '<span class="vcard post-meta-author"><span>%1$s</span> <span class="fn"><a href="%2$s">%3$s</a></span></span>', |
| 245 | - esc_html__( 'by', 'lsx' ), |
|
| 246 | - esc_url( $author_url ), |
|
| 247 | - esc_html( $author ) |
|
| 245 | + esc_html__('by', 'lsx'), |
|
| 246 | + esc_url($author_url), |
|
| 247 | + esc_html($author) |
|
| 248 | 248 | ); |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | endif; |
| 252 | 252 | |
| 253 | -if ( ! function_exists( 'lsx_post_meta_category' ) ) : |
|
| 253 | +if ( ! function_exists('lsx_post_meta_category')) : |
|
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | 256 | * Add customisable post meta: post category(ies). |
@@ -259,25 +259,25 @@ discard block |
||
| 259 | 259 | * @subpackage template-tags |
| 260 | 260 | */ |
| 261 | 261 | function lsx_post_meta_category() { |
| 262 | - $post_categories = wp_get_post_categories( get_the_ID() ); |
|
| 262 | + $post_categories = wp_get_post_categories(get_the_ID()); |
|
| 263 | 263 | $cats = array(); |
| 264 | 264 | |
| 265 | - foreach ( $post_categories as $c ) { |
|
| 266 | - $cat = get_category( $c ); |
|
| 265 | + foreach ($post_categories as $c) { |
|
| 266 | + $cat = get_category($c); |
|
| 267 | 267 | /* Translators: %s: category name */ |
| 268 | - $cats[] = '<a href="' . esc_url( get_category_link( $cat->term_id ) ) . '" title="' . sprintf( esc_html__( 'View all posts in %s' , 'lsx' ), $cat->name ) . '">' . $cat->name . '</a>'; |
|
| 268 | + $cats[] = '<a href="' . esc_url(get_category_link($cat->term_id)) . '" title="' . sprintf(esc_html__('View all posts in %s', 'lsx'), $cat->name) . '">' . $cat->name . '</a>'; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - if ( ! empty( $cats ) ) { |
|
| 271 | + if ( ! empty($cats)) { |
|
| 272 | 272 | ?> |
| 273 | - <span class="post-meta-categories"><span><?php esc_html_e( 'Posted in', 'lsx' ); ?></span> <?php echo wp_kses_post( implode( ', ', $cats ) ); ?></span> |
|
| 273 | + <span class="post-meta-categories"><span><?php esc_html_e('Posted in', 'lsx'); ?></span> <?php echo wp_kses_post(implode(', ', $cats)); ?></span> |
|
| 274 | 274 | <?php |
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | endif; |
| 279 | 279 | |
| 280 | -if ( ! function_exists( 'lsx_post_tags' ) ) : |
|
| 280 | +if ( ! function_exists('lsx_post_tags')) : |
|
| 281 | 281 | |
| 282 | 282 | /** |
| 283 | 283 | * Add customisable post meta: post tag(s). |
@@ -286,10 +286,10 @@ discard block |
||
| 286 | 286 | * @subpackage template-tags |
| 287 | 287 | */ |
| 288 | 288 | function lsx_post_tags() { |
| 289 | - if ( has_tag() ) : |
|
| 289 | + if (has_tag()) : |
|
| 290 | 290 | ?> |
| 291 | 291 | <div class="post-tags"> |
| 292 | - <?php echo wp_kses_post( get_the_tag_list( '' ) ); ?> |
|
| 292 | + <?php echo wp_kses_post(get_the_tag_list('')); ?> |
|
| 293 | 293 | </div> |
| 294 | 294 | <?php |
| 295 | 295 | endif; |
@@ -297,9 +297,9 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | endif; |
| 299 | 299 | |
| 300 | -add_action( 'lsx_content_post_tags', 'lsx_post_tags', 10 ); |
|
| 300 | +add_action('lsx_content_post_tags', 'lsx_post_tags', 10); |
|
| 301 | 301 | |
| 302 | -if ( ! function_exists( 'lsx_sharing_output' ) ) : |
|
| 302 | +if ( ! function_exists('lsx_sharing_output')) : |
|
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | 305 | * Display sharing buttons. |
@@ -309,14 +309,14 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | function lsx_sharing_output() { |
| 311 | 311 | global $lsx_sharing; |
| 312 | - echo wp_kses_post( $lsx_sharing->sharing_buttons() ); |
|
| 312 | + echo wp_kses_post($lsx_sharing->sharing_buttons()); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | endif; |
| 316 | 316 | |
| 317 | -add_action( 'lsx_content_sharing', 'lsx_sharing_output', 20 ); |
|
| 317 | +add_action('lsx_content_sharing', 'lsx_sharing_output', 20); |
|
| 318 | 318 | |
| 319 | -if ( ! function_exists( 'lsx_translate_format_to_fontawesome' ) ) : |
|
| 319 | +if ( ! function_exists('lsx_translate_format_to_fontawesome')) : |
|
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | 322 | * Translate post format to Font Awesome class. |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | * @package lsx |
| 325 | 325 | * @subpackage template-tags |
| 326 | 326 | */ |
| 327 | - function lsx_translate_format_to_fontawesome( $format ) { |
|
| 328 | - switch ( $format ) { |
|
| 327 | + function lsx_translate_format_to_fontawesome($format) { |
|
| 328 | + switch ($format) { |
|
| 329 | 329 | case 'image': |
| 330 | 330 | $format = 'camera'; |
| 331 | 331 | break; |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | |
| 358 | 358 | endif; |
| 359 | 359 | |
| 360 | -if ( ! function_exists( 'lsx_paging_nav' ) ) : |
|
| 360 | +if ( ! function_exists('lsx_paging_nav')) : |
|
| 361 | 361 | |
| 362 | 362 | /** |
| 363 | 363 | * Display navigation to next/previous set of posts when applicable. |
@@ -368,37 +368,37 @@ discard block |
||
| 368 | 368 | function lsx_paging_nav() { |
| 369 | 369 | global $wp_query; |
| 370 | 370 | |
| 371 | - if ( $wp_query->max_num_pages < 2 ) { |
|
| 371 | + if ($wp_query->max_num_pages < 2) { |
|
| 372 | 372 | return; |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | - if ( true === apply_filters( 'lsx_paging_nav_disable', false ) ) { |
|
| 375 | + if (true === apply_filters('lsx_paging_nav_disable', false)) { |
|
| 376 | 376 | return true; |
| 377 | - } elseif ( current_theme_supports( 'infinite-scroll' ) && class_exists( 'The_Neverending_Home_Page' ) ) { |
|
| 377 | + } elseif (current_theme_supports('infinite-scroll') && class_exists('The_Neverending_Home_Page')) { |
|
| 378 | 378 | return true; |
| 379 | 379 | } else { |
| 380 | 380 | $html = ''; |
| 381 | 381 | $html .= '<div class="lsx-pagination-wrapper">' . PHP_EOL; |
| 382 | 382 | $html .= '<div class="lsx-breaker"></div>' . PHP_EOL; |
| 383 | 383 | $html .= '<div class="lsx-pagination">' . PHP_EOL; |
| 384 | - $html .= paginate_links( array( |
|
| 385 | - 'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ), |
|
| 384 | + $html .= paginate_links(array( |
|
| 385 | + 'base' => str_replace(999999999, '%#%', esc_url(get_pagenum_link(999999999))), |
|
| 386 | 386 | 'format' => '?paged=%#%', |
| 387 | 387 | 'total' => $wp_query->max_num_pages, |
| 388 | - 'current' => max( 1, intval( get_query_var( 'paged' ) ) ), |
|
| 389 | - 'prev_text' => '<span class="meta-nav">←</span> ' . esc_html__( 'Previous', 'lsx' ), |
|
| 390 | - 'next_text' => esc_html__( 'Next', 'lsx' ) . ' <span class="meta-nav">→</span>', |
|
| 391 | - ) ); |
|
| 388 | + 'current' => max(1, intval(get_query_var('paged'))), |
|
| 389 | + 'prev_text' => '<span class="meta-nav">←</span> ' . esc_html__('Previous', 'lsx'), |
|
| 390 | + 'next_text' => esc_html__('Next', 'lsx') . ' <span class="meta-nav">→</span>', |
|
| 391 | + )); |
|
| 392 | 392 | $html .= '</div>' . PHP_EOL; |
| 393 | 393 | $html .= '</div>' . PHP_EOL; |
| 394 | 394 | |
| 395 | - echo wp_kses_post( $html ); |
|
| 395 | + echo wp_kses_post($html); |
|
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | endif; |
| 400 | 400 | |
| 401 | -if ( ! function_exists( 'lsx_post_nav' ) ) : |
|
| 401 | +if ( ! function_exists('lsx_post_nav')) : |
|
| 402 | 402 | |
| 403 | 403 | /** |
| 404 | 404 | * Display navigation to next/previous post when applicable. |
@@ -407,24 +407,24 @@ discard block |
||
| 407 | 407 | * @subpackage template-tags |
| 408 | 408 | */ |
| 409 | 409 | function lsx_post_nav() { |
| 410 | - $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); |
|
| 411 | - $next = get_adjacent_post( false, '', false ); |
|
| 410 | + $previous = (is_attachment()) ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true); |
|
| 411 | + $next = get_adjacent_post(false, '', false); |
|
| 412 | 412 | |
| 413 | - if ( ! $next && ! $previous ) { |
|
| 413 | + if ( ! $next && ! $previous) { |
|
| 414 | 414 | return; |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | $default_size = 'sm'; |
| 418 | - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); |
|
| 418 | + $size = apply_filters('lsx_bootstrap_column_size', $default_size); |
|
| 419 | 419 | ?> |
| 420 | 420 | <nav class="navigation post-navigation" role="navigation"> |
| 421 | 421 | <div class="lsx-breaker"></div> |
| 422 | 422 | <div class="nav-links pager row"> |
| 423 | - <div class="previous <?php echo 'col-' . esc_attr( $size ) . '-6'; ?>"> |
|
| 424 | - <?php previous_post_link( '%link', '<p class="nav-links-description">' . esc_html_x( 'Previous Post', 'Previous post link', 'lsx' ) . '</p><h3>%title</h3>' ); ?> |
|
| 423 | + <div class="previous <?php echo 'col-' . esc_attr($size) . '-6'; ?>"> |
|
| 424 | + <?php previous_post_link('%link', '<p class="nav-links-description">' . esc_html_x('Previous Post', 'Previous post link', 'lsx') . '</p><h3>%title</h3>'); ?> |
|
| 425 | 425 | </div> |
| 426 | - <div class="next <?php echo 'col-' . esc_attr( $size ) . '-6'; ?>"> |
|
| 427 | - <?php next_post_link( '%link', '<p class="nav-links-description">' . esc_html_x( 'Next Post', 'Next post link', 'lsx' ) . '</p><h3>%title</h3>' ); ?> |
|
| 426 | + <div class="next <?php echo 'col-' . esc_attr($size) . '-6'; ?>"> |
|
| 427 | + <?php next_post_link('%link', '<p class="nav-links-description">' . esc_html_x('Next Post', 'Next post link', 'lsx') . '</p><h3>%title</h3>'); ?> |
|
| 428 | 428 | </div> |
| 429 | 429 | </div><!-- .nav-links --> |
| 430 | 430 | </nav><!-- .navigation --> |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | |
| 434 | 434 | endif; |
| 435 | 435 | |
| 436 | -if ( ! function_exists( 'lsx_site_identity' ) ) : |
|
| 436 | +if ( ! function_exists('lsx_site_identity')) : |
|
| 437 | 437 | |
| 438 | 438 | /** |
| 439 | 439 | * Outputs either the Site Title or the Site Logo. |
@@ -442,10 +442,10 @@ discard block |
||
| 442 | 442 | * @subpackage template-tags |
| 443 | 443 | */ |
| 444 | 444 | function lsx_site_identity() { |
| 445 | - if ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) { |
|
| 445 | + if (function_exists('has_custom_logo') && has_custom_logo()) { |
|
| 446 | 446 | the_custom_logo(); |
| 447 | 447 | } else { |
| 448 | - if ( get_theme_mod( 'site_logo_header_text', 1 ) ) { |
|
| 448 | + if (get_theme_mod('site_logo_header_text', 1)) { |
|
| 449 | 449 | lsx_site_title(); |
| 450 | 450 | } |
| 451 | 451 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | |
| 454 | 454 | endif; |
| 455 | 455 | |
| 456 | -if ( ! function_exists( 'lsx_navbar_header' ) ) : |
|
| 456 | +if ( ! function_exists('lsx_navbar_header')) : |
|
| 457 | 457 | /** |
| 458 | 458 | * Outputs the Nav Menu. |
| 459 | 459 | * |
@@ -464,17 +464,17 @@ discard block |
||
| 464 | 464 | ?> |
| 465 | 465 | <div class="navbar-header" itemscope itemtype="http://schema.org/WebPage"> |
| 466 | 466 | <?php |
| 467 | - if ( has_nav_menu( 'primary' ) ) : |
|
| 467 | + if (has_nav_menu('primary')) : |
|
| 468 | 468 | ?> |
| 469 | 469 | <div class="wrapper-toggle" data-toggle="collapse" data-target=".primary-navbar"> |
| 470 | 470 | <button type="button" class="navbar-toggle"> |
| 471 | - <span class="sr-only"><?php esc_html_e( 'Toggle navigation', 'lsx' ); ?></span> |
|
| 471 | + <span class="sr-only"><?php esc_html_e('Toggle navigation', 'lsx'); ?></span> |
|
| 472 | 472 | <span class="icon-bar"></span> |
| 473 | 473 | <span class="icon-bar"></span> |
| 474 | 474 | <span class="icon-bar"></span> |
| 475 | 475 | <span class="icon-bar"></span> |
| 476 | 476 | </button> |
| 477 | - <span class="mobile-menu-title"><?php esc_html_e( 'Menu', 'lsx' ); ?></span> |
|
| 477 | + <span class="mobile-menu-title"><?php esc_html_e('Menu', 'lsx'); ?></span> |
|
| 478 | 478 | </div> |
| 479 | 479 | <?php |
| 480 | 480 | endif; |
@@ -487,9 +487,9 @@ discard block |
||
| 487 | 487 | |
| 488 | 488 | endif; |
| 489 | 489 | |
| 490 | -add_action( 'lsx_nav_before', 'lsx_navbar_header' ); |
|
| 490 | +add_action('lsx_nav_before', 'lsx_navbar_header'); |
|
| 491 | 491 | |
| 492 | -if ( ! function_exists( 'lsx_nav_menu' ) ) : |
|
| 492 | +if ( ! function_exists('lsx_nav_menu')) : |
|
| 493 | 493 | |
| 494 | 494 | /** |
| 495 | 495 | * Outputs the Nav Menu. |
@@ -498,17 +498,17 @@ discard block |
||
| 498 | 498 | * @subpackage template-tags |
| 499 | 499 | */ |
| 500 | 500 | function lsx_nav_menu() { |
| 501 | - if ( has_nav_menu( 'primary' ) ) : |
|
| 501 | + if (has_nav_menu('primary')) : |
|
| 502 | 502 | ?> |
| 503 | 503 | <nav class="primary-navbar collapse navbar-collapse"> |
| 504 | 504 | <?php |
| 505 | - wp_nav_menu( array( |
|
| 505 | + wp_nav_menu(array( |
|
| 506 | 506 | 'theme_location' => 'primary', |
| 507 | 507 | 'depth' => 3, |
| 508 | 508 | 'container' => false, |
| 509 | 509 | 'menu_class' => 'nav navbar-nav', |
| 510 | 510 | 'walker' => new LSX_Bootstrap_Navwalker(), |
| 511 | - ) ); |
|
| 511 | + )); |
|
| 512 | 512 | ?> |
| 513 | 513 | </nav> |
| 514 | 514 | <?php |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | |
| 518 | 518 | endif; |
| 519 | 519 | |
| 520 | -if ( ! function_exists( 'lsx_sitemap_pages' ) ) : |
|
| 520 | +if ( ! function_exists('lsx_sitemap_pages')) : |
|
| 521 | 521 | |
| 522 | 522 | /** |
| 523 | 523 | * Outputs Pages for the Sitemap Template. |
@@ -533,15 +533,15 @@ discard block |
||
| 533 | 533 | 'post_type' => 'page', |
| 534 | 534 | ); |
| 535 | 535 | |
| 536 | - $pages = new WP_Query( $page_args ); |
|
| 536 | + $pages = new WP_Query($page_args); |
|
| 537 | 537 | |
| 538 | - if ( $pages->have_posts() ) { |
|
| 539 | - echo '<h2>' . esc_html__( 'Pages', 'lsx' ) . '</h2>'; |
|
| 538 | + if ($pages->have_posts()) { |
|
| 539 | + echo '<h2>' . esc_html__('Pages', 'lsx') . '</h2>'; |
|
| 540 | 540 | echo '<ul>'; |
| 541 | 541 | |
| 542 | - while ( $pages->have_posts() ) { |
|
| 542 | + while ($pages->have_posts()) { |
|
| 543 | 543 | $pages->the_post(); |
| 544 | - echo '<li class="page_item page-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 544 | + echo '<li class="page_item page-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | echo '</ul>'; |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | |
| 552 | 552 | endif; |
| 553 | 553 | |
| 554 | -if ( ! function_exists( 'lsx_sitemap_custom_post_type' ) ) : |
|
| 554 | +if ( ! function_exists('lsx_sitemap_custom_post_type')) : |
|
| 555 | 555 | |
| 556 | 556 | /** |
| 557 | 557 | * Outputs a custom post type section. |
@@ -565,9 +565,9 @@ discard block |
||
| 565 | 565 | '_builtin' => false, |
| 566 | 566 | ); |
| 567 | 567 | |
| 568 | - $post_types = get_post_types( $args , 'names' ); |
|
| 568 | + $post_types = get_post_types($args, 'names'); |
|
| 569 | 569 | |
| 570 | - foreach ( $post_types as $post_type ) { |
|
| 570 | + foreach ($post_types as $post_type) { |
|
| 571 | 571 | $post_type_args = array( |
| 572 | 572 | 'post_type' => 'page', |
| 573 | 573 | 'posts_per_page' => 99, |
@@ -575,22 +575,22 @@ discard block |
||
| 575 | 575 | 'post_type' => $post_type, |
| 576 | 576 | ); |
| 577 | 577 | |
| 578 | - $post_type_items = new WP_Query( $post_type_args ); |
|
| 579 | - $post_type_object = get_post_type_object( $post_type ); |
|
| 578 | + $post_type_items = new WP_Query($post_type_args); |
|
| 579 | + $post_type_object = get_post_type_object($post_type); |
|
| 580 | 580 | |
| 581 | - if ( ! empty( $post_type_object ) ) { |
|
| 581 | + if ( ! empty($post_type_object)) { |
|
| 582 | 582 | $title = $post_type_object->labels->name; |
| 583 | 583 | } else { |
| 584 | - $title = ucwords( $post_type ); |
|
| 584 | + $title = ucwords($post_type); |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | - if ( $post_type_items->have_posts() ) { |
|
| 588 | - echo '<h2>' . esc_html( $title ) . '</h2>'; |
|
| 587 | + if ($post_type_items->have_posts()) { |
|
| 588 | + echo '<h2>' . esc_html($title) . '</h2>'; |
|
| 589 | 589 | echo '<ul>'; |
| 590 | 590 | |
| 591 | - while ( $post_type_items->have_posts() ) { |
|
| 591 | + while ($post_type_items->have_posts()) { |
|
| 592 | 592 | $post_type_items->the_post(); |
| 593 | - echo '<li class="' . esc_attr( get_post_type() ) . '_item ' . esc_attr( get_post_type() ) . '-item-' . esc_attr( get_the_ID() ) . '"><a href="' . esc_url( get_permalink() ) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 593 | + echo '<li class="' . esc_attr(get_post_type()) . '_item ' . esc_attr(get_post_type()) . '-item-' . esc_attr(get_the_ID()) . '"><a href="' . esc_url(get_permalink()) . '" title="">' . get_the_title() . '</a></li>'; |
|
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | echo '</ul>'; |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | |
| 602 | 602 | endif; |
| 603 | 603 | |
| 604 | -if ( ! function_exists( 'lsx_sitemap_taxonomy_clouds' ) ) : |
|
| 604 | +if ( ! function_exists('lsx_sitemap_taxonomy_clouds')) : |
|
| 605 | 605 | |
| 606 | 606 | /** |
| 607 | 607 | * Outputs the public taxonomies. |
@@ -615,18 +615,18 @@ discard block |
||
| 615 | 615 | '_builtin' => false, |
| 616 | 616 | ); |
| 617 | 617 | |
| 618 | - $taxonomies = get_taxonomies( $taxonomy_args ); |
|
| 618 | + $taxonomies = get_taxonomies($taxonomy_args); |
|
| 619 | 619 | |
| 620 | - if ( ! empty( $taxonomies ) ) { |
|
| 621 | - foreach ( $taxonomies as $taxonomy_id => $taxonomy ) { |
|
| 622 | - $tag_cloud = wp_tag_cloud( array( |
|
| 620 | + if ( ! empty($taxonomies)) { |
|
| 621 | + foreach ($taxonomies as $taxonomy_id => $taxonomy) { |
|
| 622 | + $tag_cloud = wp_tag_cloud(array( |
|
| 623 | 623 | 'taxonomy' => $taxonomy_id, |
| 624 | 624 | 'echo' => false, |
| 625 | - ) ); |
|
| 625 | + )); |
|
| 626 | 626 | |
| 627 | - if ( ! empty( $tag_cloud ) ) { |
|
| 628 | - echo '<h2>' . esc_html( $taxonomy ) . '</h2>'; |
|
| 629 | - echo '<aside id="' . esc_attr( $taxonomy_id ) . '" class="widget widget_' . esc_attr( $taxonomy_id ) . '">' . esc_html( $tag_cloud ) . '</aside>'; |
|
| 627 | + if ( ! empty($tag_cloud)) { |
|
| 628 | + echo '<h2>' . esc_html($taxonomy) . '</h2>'; |
|
| 629 | + echo '<aside id="' . esc_attr($taxonomy_id) . '" class="widget widget_' . esc_attr($taxonomy_id) . '">' . esc_html($tag_cloud) . '</aside>'; |
|
| 630 | 630 | } |
| 631 | 631 | } |
| 632 | 632 | } |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | |
| 635 | 635 | endif; |
| 636 | 636 | |
| 637 | -if ( ! function_exists( 'lsx_add_top_menu' ) ) : |
|
| 637 | +if ( ! function_exists('lsx_add_top_menu')) : |
|
| 638 | 638 | |
| 639 | 639 | /** |
| 640 | 640 | * Adds our top menu to the theme. |
@@ -643,28 +643,28 @@ discard block |
||
| 643 | 643 | * @subpackage template-tags |
| 644 | 644 | */ |
| 645 | 645 | function lsx_add_top_menu() { |
| 646 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) : |
|
| 646 | + if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) : |
|
| 647 | 647 | ?> |
| 648 | 648 | <div id="top-menu" class="<?php lsx_top_menu_classes(); ?>"> |
| 649 | 649 | <div class="container"> |
| 650 | - <?php if ( has_nav_menu( 'top-menu' ) ) : ?> |
|
| 650 | + <?php if (has_nav_menu('top-menu')) : ?> |
|
| 651 | 651 | <nav class="top-menu"> |
| 652 | 652 | <?php |
| 653 | - wp_nav_menu( array( |
|
| 653 | + wp_nav_menu(array( |
|
| 654 | 654 | 'theme_location' => 'top-menu', |
| 655 | 655 | 'walker' => new LSX_Bootstrap_Navwalker(), |
| 656 | - ) ); |
|
| 656 | + )); |
|
| 657 | 657 | ?> |
| 658 | 658 | </nav> |
| 659 | 659 | <?php endif; ?> |
| 660 | 660 | |
| 661 | - <?php if ( has_nav_menu( 'top-menu-left' ) ) : ?> |
|
| 661 | + <?php if (has_nav_menu('top-menu-left')) : ?> |
|
| 662 | 662 | <nav class="top-menu pull-left"> |
| 663 | 663 | <?php |
| 664 | - wp_nav_menu( array( |
|
| 664 | + wp_nav_menu(array( |
|
| 665 | 665 | 'theme_location' => 'top-menu-left', |
| 666 | 666 | 'walker' => new LSX_Bootstrap_Navwalker(), |
| 667 | - ) ); |
|
| 667 | + )); |
|
| 668 | 668 | ?> |
| 669 | 669 | </nav> |
| 670 | 670 | <?php endif; ?> |
@@ -676,9 +676,9 @@ discard block |
||
| 676 | 676 | |
| 677 | 677 | endif; |
| 678 | 678 | |
| 679 | -add_action( 'lsx_header_before', 'lsx_add_top_menu' ); |
|
| 679 | +add_action('lsx_header_before', 'lsx_add_top_menu'); |
|
| 680 | 680 | |
| 681 | -if ( ! function_exists( 'lsx_get_my_url' ) ) : |
|
| 681 | +if ( ! function_exists('lsx_get_my_url')) : |
|
| 682 | 682 | |
| 683 | 683 | /** |
| 684 | 684 | * Return URL from a link in the content. |
@@ -687,11 +687,11 @@ discard block |
||
| 687 | 687 | * @subpackage template-tags |
| 688 | 688 | */ |
| 689 | 689 | function lsx_get_my_url() { |
| 690 | - if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) ) { |
|
| 690 | + if ( ! preg_match('/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches)) { |
|
| 691 | 691 | return false; |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | - return esc_url_raw( $matches[1] ); |
|
| 694 | + return esc_url_raw($matches[1]); |
|
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | endif; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @subpackage extras |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | * @package lsx |
| 17 | 17 | * @subpackage extras |
| 18 | 18 | */ |
| 19 | -add_filter( 'widget_text', 'shortcode_unautop' ); |
|
| 20 | -add_filter( 'widget_text', 'do_shortcode' ); |
|
| 19 | +add_filter('widget_text', 'shortcode_unautop'); |
|
| 20 | +add_filter('widget_text', 'do_shortcode'); |
|
| 21 | 21 | |
| 22 | -if ( ! function_exists( 'lsx_kses_allowed_html' ) ) : |
|
| 22 | +if ( ! function_exists('lsx_kses_allowed_html')) : |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * Enable extra attributes (srcset, sizes) in img tag. |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @package lsx |
| 28 | 28 | * @subpackage extras |
| 29 | 29 | */ |
| 30 | - function lsx_kses_allowed_html( $allowedtags, $context ) { |
|
| 30 | + function lsx_kses_allowed_html($allowedtags, $context) { |
|
| 31 | 31 | $allowedtags['img']['srcset'] = true; |
| 32 | 32 | $allowedtags['img']['sizes'] = true; |
| 33 | 33 | |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | endif; |
| 44 | 44 | |
| 45 | -add_filter( 'wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2 ); |
|
| 45 | +add_filter('wp_kses_allowed_html', 'lsx_kses_allowed_html', 10, 2); |
|
| 46 | 46 | |
| 47 | -if ( ! function_exists( 'lsx_body_class' ) ) : |
|
| 47 | +if ( ! function_exists('lsx_body_class')) : |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Add and remove body_class() classes. |
@@ -52,44 +52,44 @@ discard block |
||
| 52 | 52 | * @package lsx |
| 53 | 53 | * @subpackage extras |
| 54 | 54 | */ |
| 55 | - function lsx_body_class( $classes ) { |
|
| 55 | + function lsx_body_class($classes) { |
|
| 56 | 56 | global $post; |
| 57 | 57 | |
| 58 | - $header_layout = get_theme_mod( 'lsx_header_layout', 'inline' ); |
|
| 58 | + $header_layout = get_theme_mod('lsx_header_layout', 'inline'); |
|
| 59 | 59 | $classes[] = 'header-' . $header_layout; |
| 60 | 60 | |
| 61 | - if ( isset( $post ) ) { |
|
| 61 | + if (isset($post)) { |
|
| 62 | 62 | $classes[] = $post->post_name; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if ( ! class_exists( 'LSX_Banners' ) || ! empty( apply_filters( 'lsx_banner_plugin_disable', false ) ) ) { |
|
| 66 | - $post_types = array( 'page', 'post' ); |
|
| 67 | - $post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types ); |
|
| 65 | + if ( ! class_exists('LSX_Banners') || ! empty(apply_filters('lsx_banner_plugin_disable', false))) { |
|
| 66 | + $post_types = array('page', 'post'); |
|
| 67 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
| 68 | 68 | |
| 69 | - if ( is_singular( $post_types ) && has_post_thumbnail() ) { |
|
| 69 | + if (is_singular($post_types) && has_post_thumbnail()) { |
|
| 70 | 70 | $classes[] = 'page-has-banner'; |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( has_nav_menu( 'top-menu' ) || has_nav_menu( 'top-menu-left' ) ) { |
|
| 74 | + if (has_nav_menu('top-menu') || has_nav_menu('top-menu-left')) { |
|
| 75 | 75 | $classes[] = 'has-top-menu'; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $fixed_header = get_theme_mod( 'lsx_header_fixed', false ); |
|
| 78 | + $fixed_header = get_theme_mod('lsx_header_fixed', false); |
|
| 79 | 79 | |
| 80 | - if ( false !== $fixed_header ) { |
|
| 80 | + if (false !== $fixed_header) { |
|
| 81 | 81 | $classes[] = 'top-menu-fixed'; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - $search_form = get_theme_mod( 'lsx_header_search', false ); |
|
| 84 | + $search_form = get_theme_mod('lsx_header_search', false); |
|
| 85 | 85 | |
| 86 | - if ( false !== $search_form ) { |
|
| 86 | + if (false !== $search_form) { |
|
| 87 | 87 | $classes[] = 'has-header-search'; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $preloader_content = get_theme_mod( 'lsx_preloader_content_status', false ); |
|
| 90 | + $preloader_content = get_theme_mod('lsx_preloader_content_status', false); |
|
| 91 | 91 | |
| 92 | - if ( false !== $preloader_content ) { |
|
| 92 | + if (false !== $preloader_content) { |
|
| 93 | 93 | $classes[] = 'preloader-content-enable'; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | endif; |
| 100 | 100 | |
| 101 | -add_filter( 'body_class', 'lsx_body_class' ); |
|
| 101 | +add_filter('body_class', 'lsx_body_class'); |
|
| 102 | 102 | |
| 103 | -if ( ! function_exists( 'lsx_embed_wrap' ) ) : |
|
| 103 | +if ( ! function_exists('lsx_embed_wrap')) : |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Wrap embedded media as suggested by Readability. |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | * @link https://gist.github.com/965956 |
| 112 | 112 | * @link http://www.readability.com/publishers/guidelines#publisher |
| 113 | 113 | */ |
| 114 | - function lsx_embed_wrap( $cache, $url, $attr = '', $post_id = '' ) { |
|
| 115 | - if ( false !== strpos( $cache, '<iframe' ) ) { |
|
| 114 | + function lsx_embed_wrap($cache, $url, $attr = '', $post_id = '') { |
|
| 115 | + if (false !== strpos($cache, '<iframe')) { |
|
| 116 | 116 | return '<div class="entry-content-asset">' . $cache . '</div>'; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | endif; |
| 123 | 123 | |
| 124 | -add_filter( 'embed_oembed_html', 'lsx_embed_wrap', 10, 4 ); |
|
| 124 | +add_filter('embed_oembed_html', 'lsx_embed_wrap', 10, 4); |
|
| 125 | 125 | |
| 126 | -if ( ! function_exists( 'lsx_remove_self_closing_tags' ) ) : |
|
| 126 | +if ( ! function_exists('lsx_remove_self_closing_tags')) : |
|
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | 129 | * Remove unnecessary self-closing tags. |
@@ -131,17 +131,17 @@ discard block |
||
| 131 | 131 | * @package lsx |
| 132 | 132 | * @subpackage extras |
| 133 | 133 | */ |
| 134 | - function lsx_remove_self_closing_tags( $input ) { |
|
| 135 | - return str_replace( ' />', '>', $input ); |
|
| 134 | + function lsx_remove_self_closing_tags($input) { |
|
| 135 | + return str_replace(' />', '>', $input); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | endif; |
| 139 | 139 | |
| 140 | -add_filter( 'get_avatar', 'lsx_remove_self_closing_tags' ); // <img /> |
|
| 141 | -add_filter( 'comment_id_fields', 'lsx_remove_self_closing_tags' ); // <input /> |
|
| 142 | -add_filter( 'post_thumbnail_html', 'lsx_remove_self_closing_tags' ); // <img /> |
|
| 140 | +add_filter('get_avatar', 'lsx_remove_self_closing_tags'); // <img /> |
|
| 141 | +add_filter('comment_id_fields', 'lsx_remove_self_closing_tags'); // <input /> |
|
| 142 | +add_filter('post_thumbnail_html', 'lsx_remove_self_closing_tags'); // <img /> |
|
| 143 | 143 | |
| 144 | -if ( ! function_exists( 'lsx_is_element_empty' ) ) : |
|
| 144 | +if ( ! function_exists('lsx_is_element_empty')) : |
|
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * Checks if a Nav $element is empty or not. |
@@ -149,14 +149,14 @@ discard block |
||
| 149 | 149 | * @package lsx |
| 150 | 150 | * @subpackage extras |
| 151 | 151 | */ |
| 152 | - function lsx_is_element_empty( $element ) { |
|
| 153 | - $element = trim( $element ); |
|
| 154 | - return empty( $element ) ? false : true; |
|
| 152 | + function lsx_is_element_empty($element) { |
|
| 153 | + $element = trim($element); |
|
| 154 | + return empty($element) ? false : true; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | endif; |
| 158 | 158 | |
| 159 | -if ( ! function_exists( 'lsx_get_thumbnail' ) ) : |
|
| 159 | +if ( ! function_exists('lsx_get_thumbnail')) : |
|
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | 162 | * return the responsive images. |
@@ -164,44 +164,44 @@ discard block |
||
| 164 | 164 | * @package lsx |
| 165 | 165 | * @subpackage extras |
| 166 | 166 | */ |
| 167 | - function lsx_get_thumbnail( $size, $image_src = false ) { |
|
| 168 | - if ( false === $image_src ) { |
|
| 167 | + function lsx_get_thumbnail($size, $image_src = false) { |
|
| 168 | + if (false === $image_src) { |
|
| 169 | 169 | $post_id = get_the_ID(); |
| 170 | - $post_thumbnail_id = get_post_thumbnail_id( $post_id ); |
|
| 171 | - } elseif ( false !== $image_src ) { |
|
| 172 | - if ( is_numeric( $image_src ) ) { |
|
| 170 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
| 171 | + } elseif (false !== $image_src) { |
|
| 172 | + if (is_numeric($image_src)) { |
|
| 173 | 173 | $post_thumbnail_id = $image_src; |
| 174 | 174 | } else { |
| 175 | - $post_thumbnail_id = lsx_get_attachment_id_from_src( $image_src ); |
|
| 175 | + $post_thumbnail_id = lsx_get_attachment_id_from_src($image_src); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - $size = apply_filters( 'lsx_thumbnail_size', $size ); |
|
| 179 | + $size = apply_filters('lsx_thumbnail_size', $size); |
|
| 180 | 180 | $img = false; |
| 181 | 181 | |
| 182 | - if ( 'lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size ) { |
|
| 182 | + if ('lsx-thumbnail-single' === $size || 'lsx-thumbnail-wide' === $size || 'lsx-thumbnail-square' === $size || 'thumbnail' === $size) { |
|
| 183 | 183 | $srcset = false; |
| 184 | - $img = wp_get_attachment_image_src( $post_thumbnail_id, $size ); |
|
| 184 | + $img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
| 185 | 185 | $img = $img[0]; |
| 186 | 186 | } else { |
| 187 | 187 | $srcset = true; |
| 188 | - $img = wp_get_attachment_image_srcset( $post_thumbnail_id, $size ); |
|
| 188 | + $img = wp_get_attachment_image_srcset($post_thumbnail_id, $size); |
|
| 189 | 189 | |
| 190 | - if ( empty( $img ) ) { |
|
| 190 | + if (empty($img)) { |
|
| 191 | 191 | $srcset = false; |
| 192 | - $img = wp_get_attachment_image_src( $post_thumbnail_id, $size ); |
|
| 192 | + $img = wp_get_attachment_image_src($post_thumbnail_id, $size); |
|
| 193 | 193 | $img = $img[0]; |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - if ( ! empty( $img ) ) { |
|
| 198 | - if ( $srcset ) { |
|
| 199 | - $img = '<img alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . esc_attr( $img ) . '" />'; |
|
| 197 | + if ( ! empty($img)) { |
|
| 198 | + if ($srcset) { |
|
| 199 | + $img = '<img alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" srcset="' . esc_attr($img) . '" />'; |
|
| 200 | 200 | } else { |
| 201 | - $img = '<img alt="' . the_title_attribute( 'echo=0' ) . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url( $img ) . '" />'; |
|
| 201 | + $img = '<img alt="' . the_title_attribute('echo=0') . '" class="attachment-responsive wp-post-image lsx-responsive" src="' . esc_url($img) . '" />'; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - $img = apply_filters( 'lsx_lazyload_filter_images', $img ); |
|
| 204 | + $img = apply_filters('lsx_lazyload_filter_images', $img); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | return $img; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | endif; |
| 211 | 211 | |
| 212 | -if ( ! function_exists( 'lsx_thumbnail' ) ) : |
|
| 212 | +if ( ! function_exists('lsx_thumbnail')) : |
|
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | 215 | * Output the Resonsive Images. |
@@ -217,13 +217,13 @@ discard block |
||
| 217 | 217 | * @package lsx |
| 218 | 218 | * @subpackage extras |
| 219 | 219 | */ |
| 220 | - function lsx_thumbnail( $size = 'thumbnail', $image_src = false ) { |
|
| 221 | - echo wp_kses_post( lsx_get_thumbnail( $size, $image_src ) ); |
|
| 220 | + function lsx_thumbnail($size = 'thumbnail', $image_src = false) { |
|
| 221 | + echo wp_kses_post(lsx_get_thumbnail($size, $image_src)); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | endif; |
| 225 | 225 | |
| 226 | -if ( ! function_exists( 'lsx_get_attachment_id_from_src' ) ) : |
|
| 226 | +if ( ! function_exists('lsx_get_attachment_id_from_src')) : |
|
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | 229 | * Gets the attachments ID from the src. |
@@ -231,13 +231,13 @@ discard block |
||
| 231 | 231 | * @package lsx |
| 232 | 232 | * @subpackage extras |
| 233 | 233 | */ |
| 234 | - function lsx_get_attachment_id_from_src( $image_src ) { |
|
| 235 | - $post_id = wp_cache_get( $image_src, 'lsx_get_attachment_id_from_src' ); |
|
| 234 | + function lsx_get_attachment_id_from_src($image_src) { |
|
| 235 | + $post_id = wp_cache_get($image_src, 'lsx_get_attachment_id_from_src'); |
|
| 236 | 236 | |
| 237 | - if ( false === $post_id ) { |
|
| 237 | + if (false === $post_id) { |
|
| 238 | 238 | global $wpdb; |
| 239 | - $post_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src ) ); |
|
| 240 | - wp_cache_set( $image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600 ); |
|
| 239 | + $post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE guid='%s' LIMIT 1", $image_src)); |
|
| 240 | + wp_cache_set($image_src, $post_id, 'lsx_get_attachment_id_from_src', 3600); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | return $post_id; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | endif; |
| 247 | 247 | |
| 248 | -if ( ! function_exists( 'lsx_page_banner' ) ) : |
|
| 248 | +if ( ! function_exists('lsx_page_banner')) : |
|
| 249 | 249 | |
| 250 | 250 | /** |
| 251 | 251 | * Add Featured Image as Banner on Single Pages. |
@@ -254,28 +254,28 @@ discard block |
||
| 254 | 254 | * @subpackage extras |
| 255 | 255 | */ |
| 256 | 256 | function lsx_page_banner() { |
| 257 | - if ( true === apply_filters( 'lsx_page_banner_disable', false ) ) { |
|
| 257 | + if (true === apply_filters('lsx_page_banner_disable', false)) { |
|
| 258 | 258 | return; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - $post_types = array( 'page', 'post' ); |
|
| 262 | - $post_types = apply_filters( 'lsx_allowed_post_type_banners', $post_types ); |
|
| 261 | + $post_types = array('page', 'post'); |
|
| 262 | + $post_types = apply_filters('lsx_allowed_post_type_banners', $post_types); |
|
| 263 | 263 | |
| 264 | - if ( is_singular( $post_types ) && has_post_thumbnail() ) : |
|
| 264 | + if (is_singular($post_types) && has_post_thumbnail()) : |
|
| 265 | 265 | $bg_image = ''; |
| 266 | 266 | |
| 267 | - if ( has_post_thumbnail() ) { |
|
| 268 | - $bg_image = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' ); |
|
| 267 | + if (has_post_thumbnail()) { |
|
| 268 | + $bg_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); |
|
| 269 | 269 | $bg_image = $bg_image[0]; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - if ( ! empty( $bg_image ) ) : |
|
| 272 | + if ( ! empty($bg_image)) : |
|
| 273 | 273 | ?> |
| 274 | 274 | <div class="page-banner-wrap"> |
| 275 | 275 | <div class="page-banner"> |
| 276 | 276 | <?php lsx_banner_inner_top(); ?> |
| 277 | 277 | |
| 278 | - <div class="page-banner-image" style="background-image:url(<?php echo esc_attr( $bg_image ); ?>);"></div> |
|
| 278 | + <div class="page-banner-image" style="background-image:url(<?php echo esc_attr($bg_image); ?>);"></div> |
|
| 279 | 279 | |
| 280 | 280 | <div class="container"> |
| 281 | 281 | <header class="page-header"> |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | endif; |
| 296 | 296 | |
| 297 | -add_action( 'lsx_header_after', 'lsx_page_banner' ); |
|
| 297 | +add_action('lsx_header_after', 'lsx_page_banner'); |
|
| 298 | 298 | |
| 299 | -if ( ! function_exists( 'lsx_form_submit_button' ) ) : |
|
| 299 | +if ( ! function_exists('lsx_form_submit_button')) : |
|
| 300 | 300 | |
| 301 | 301 | /** |
| 302 | 302 | * filter the Gravity Forms button type. |
@@ -308,15 +308,15 @@ discard block |
||
| 308 | 308 | * @param $form Object |
| 309 | 309 | * @return String |
| 310 | 310 | */ |
| 311 | - function lsx_form_submit_button( $button, $form ) { |
|
| 311 | + function lsx_form_submit_button($button, $form) { |
|
| 312 | 312 | return "<button class='btn btn-primary' id='gform_submit_button_{$form["id"]}'><span>Submit</span></button>"; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | endif; |
| 316 | 316 | |
| 317 | -add_filter( 'gform_submit_button', 'lsx_form_submit_button', 10, 2 ); |
|
| 317 | +add_filter('gform_submit_button', 'lsx_form_submit_button', 10, 2); |
|
| 318 | 318 | |
| 319 | -if ( ! function_exists( 'lsx_excerpt_more' ) ) : |
|
| 319 | +if ( ! function_exists('lsx_excerpt_more')) : |
|
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | 322 | * Replaces the excerpt "more" text by a link. |
@@ -324,15 +324,15 @@ discard block |
||
| 324 | 324 | * @package lsx |
| 325 | 325 | * @subpackage extras |
| 326 | 326 | */ |
| 327 | - function lsx_excerpt_more( $more ) { |
|
| 327 | + function lsx_excerpt_more($more) { |
|
| 328 | 328 | return '...'; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | endif; |
| 332 | 332 | |
| 333 | -add_filter( 'excerpt_more', 'lsx_excerpt_more' ); |
|
| 333 | +add_filter('excerpt_more', 'lsx_excerpt_more'); |
|
| 334 | 334 | |
| 335 | -if ( ! function_exists( 'lsx_the_excerpt_filter' ) ) : |
|
| 335 | +if ( ! function_exists('lsx_the_excerpt_filter')) : |
|
| 336 | 336 | |
| 337 | 337 | /** |
| 338 | 338 | * Add a continue reading link to the excerpt. |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | * @package lsx |
| 341 | 341 | * @subpackage extras |
| 342 | 342 | */ |
| 343 | - function lsx_the_excerpt_filter( $excerpt ) { |
|
| 343 | + function lsx_the_excerpt_filter($excerpt) { |
|
| 344 | 344 | |
| 345 | 345 | $post_formats = array( |
| 346 | 346 | 'aside' => 'aside', |
@@ -353,23 +353,23 @@ discard block |
||
| 353 | 353 | 'audio' => 'audio', |
| 354 | 354 | ); |
| 355 | 355 | |
| 356 | - $show_full_content = has_post_format( apply_filters( 'lsx_the_excerpt_filter_post_types', $post_formats ) ); |
|
| 356 | + $show_full_content = has_post_format(apply_filters('lsx_the_excerpt_filter_post_types', $post_formats)); |
|
| 357 | 357 | |
| 358 | - if ( ! $show_full_content ) { |
|
| 359 | - if ( '' !== $excerpt && ! stristr( $excerpt, 'moretag' ) ) { |
|
| 360 | - $pagination = wp_link_pages( array( |
|
| 358 | + if ( ! $show_full_content) { |
|
| 359 | + if ('' !== $excerpt && ! stristr($excerpt, 'moretag')) { |
|
| 360 | + $pagination = wp_link_pages(array( |
|
| 361 | 361 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 362 | 362 | 'after' => '</div></div>', |
| 363 | 363 | 'link_before' => '<span>', |
| 364 | 364 | 'link_after' => '</span>', |
| 365 | 365 | 'echo' => 0, |
| 366 | - ) ); |
|
| 366 | + )); |
|
| 367 | 367 | |
| 368 | - if ( ! empty( $pagination ) ) { |
|
| 368 | + if ( ! empty($pagination)) { |
|
| 369 | 369 | $excerpt .= $pagination; |
| 370 | 370 | } else { |
| 371 | - $excerpt_more = '<p><a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Continue reading', 'lsx' ) . '</a></p>'; |
|
| 372 | - $excerpt .= apply_filters( 'excerpt_more_p', $excerpt_more ); |
|
| 371 | + $excerpt_more = '<p><a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('Continue reading', 'lsx') . '</a></p>'; |
|
| 372 | + $excerpt .= apply_filters('excerpt_more_p', $excerpt_more); |
|
| 373 | 373 | } |
| 374 | 374 | } |
| 375 | 375 | } |
@@ -379,9 +379,9 @@ discard block |
||
| 379 | 379 | |
| 380 | 380 | endif; |
| 381 | 381 | |
| 382 | -add_filter( 'the_excerpt', 'lsx_the_excerpt_filter' , 1 , 20 ); |
|
| 382 | +add_filter('the_excerpt', 'lsx_the_excerpt_filter', 1, 20); |
|
| 383 | 383 | |
| 384 | -if ( ! function_exists( 'lsx_custom_wp_trim_excerpt' ) ) : |
|
| 384 | +if ( ! function_exists('lsx_custom_wp_trim_excerpt')) : |
|
| 385 | 385 | |
| 386 | 386 | /** |
| 387 | 387 | * Allow HTML tags in excerpt. |
@@ -389,12 +389,12 @@ discard block |
||
| 389 | 389 | * @package lsx |
| 390 | 390 | * @subpackage extras |
| 391 | 391 | */ |
| 392 | - function lsx_custom_wp_trim_excerpt( $wpse_excerpt ) { |
|
| 392 | + function lsx_custom_wp_trim_excerpt($wpse_excerpt) { |
|
| 393 | 393 | global $post; |
| 394 | 394 | $raw_excerpt = $wpse_excerpt; |
| 395 | 395 | |
| 396 | - if ( empty( $wpse_excerpt ) ) { |
|
| 397 | - $wpse_excerpt = get_the_content( '' ); |
|
| 396 | + if (empty($wpse_excerpt)) { |
|
| 397 | + $wpse_excerpt = get_the_content(''); |
|
| 398 | 398 | |
| 399 | 399 | $post_formats = array( |
| 400 | 400 | 'aside' => 'aside', |
@@ -407,27 +407,27 @@ discard block |
||
| 407 | 407 | 'audio' => 'audio', |
| 408 | 408 | ); |
| 409 | 409 | |
| 410 | - $show_full_content = has_post_format( apply_filters( 'lsx_excerpt_read_more_post_formats', $post_formats ) ); |
|
| 410 | + $show_full_content = has_post_format(apply_filters('lsx_excerpt_read_more_post_formats', $post_formats)); |
|
| 411 | 411 | |
| 412 | - if ( ! $show_full_content ) { |
|
| 413 | - $wpse_excerpt = strip_shortcodes( $wpse_excerpt ); |
|
| 414 | - $wpse_excerpt = apply_filters( 'the_content', $wpse_excerpt ); |
|
| 415 | - $wpse_excerpt = str_replace( ']]>', ']]>', $wpse_excerpt ); |
|
| 416 | - $wpse_excerpt = strip_tags( $wpse_excerpt, apply_filters( 'excerpt_strip_tags', '<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<a>,<button>,<blockquote>,<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<ol>,<li>,<span>,<div>' ) ); |
|
| 412 | + if ( ! $show_full_content) { |
|
| 413 | + $wpse_excerpt = strip_shortcodes($wpse_excerpt); |
|
| 414 | + $wpse_excerpt = apply_filters('the_content', $wpse_excerpt); |
|
| 415 | + $wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt); |
|
| 416 | + $wpse_excerpt = strip_tags($wpse_excerpt, apply_filters('excerpt_strip_tags', '<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<a>,<button>,<blockquote>,<p>,<br>,<b>,<strong>,<i>,<u>,<ul>,<ol>,<li>,<span>,<div>')); |
|
| 417 | 417 | |
| 418 | 418 | $excerpt_word_count = 50; |
| 419 | - $excerpt_word_count = apply_filters( 'excerpt_length', $excerpt_word_count ); |
|
| 419 | + $excerpt_word_count = apply_filters('excerpt_length', $excerpt_word_count); |
|
| 420 | 420 | |
| 421 | 421 | $tokens = array(); |
| 422 | 422 | $excerpt_output = ''; |
| 423 | 423 | $has_more = false; |
| 424 | 424 | $count = 0; |
| 425 | 425 | |
| 426 | - preg_match_all( '/(<[^>]+>|[^<>\s]+)\s*/u', $wpse_excerpt, $tokens ); |
|
| 426 | + preg_match_all('/(<[^>]+>|[^<>\s]+)\s*/u', $wpse_excerpt, $tokens); |
|
| 427 | 427 | |
| 428 | - foreach ( $tokens[0] as $token ) { |
|
| 429 | - if ( $count >= $excerpt_word_count ) { |
|
| 430 | - $excerpt_output .= trim( $token ); |
|
| 428 | + foreach ($tokens[0] as $token) { |
|
| 429 | + if ($count >= $excerpt_word_count) { |
|
| 430 | + $excerpt_output .= trim($token); |
|
| 431 | 431 | $has_more = true; |
| 432 | 432 | break; |
| 433 | 433 | } |
@@ -436,41 +436,41 @@ discard block |
||
| 436 | 436 | $excerpt_output .= $token; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | - $wpse_excerpt = trim( force_balance_tags( $excerpt_output ) ); |
|
| 439 | + $wpse_excerpt = trim(force_balance_tags($excerpt_output)); |
|
| 440 | 440 | |
| 441 | - if ( $has_more ) { |
|
| 442 | - $excerpt_end = '<a class="moretag" href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'More', 'lsx' ) . '</a>'; |
|
| 443 | - $excerpt_end = apply_filters( 'excerpt_more', ' ' . $excerpt_end ); |
|
| 441 | + if ($has_more) { |
|
| 442 | + $excerpt_end = '<a class="moretag" href="' . esc_url(get_permalink()) . '">' . esc_html__('More', 'lsx') . '</a>'; |
|
| 443 | + $excerpt_end = apply_filters('excerpt_more', ' ' . $excerpt_end); |
|
| 444 | 444 | |
| 445 | - $pos = strrpos( $wpse_excerpt, '</' ); |
|
| 445 | + $pos = strrpos($wpse_excerpt, '</'); |
|
| 446 | 446 | |
| 447 | - if ( false !== $pos ) { |
|
| 447 | + if (false !== $pos) { |
|
| 448 | 448 | // Inside last HTML tag |
| 449 | - $wpse_excerpt = substr_replace( $wpse_excerpt, $excerpt_end, $pos, 0 ); /* Add read more next to last word */ |
|
| 449 | + $wpse_excerpt = substr_replace($wpse_excerpt, $excerpt_end, $pos, 0); /* Add read more next to last word */ |
|
| 450 | 450 | } else { |
| 451 | 451 | // After the content |
| 452 | 452 | $wpse_excerpt .= $excerpt_end; /*Add read more in new paragraph */ |
| 453 | 453 | } |
| 454 | 454 | } |
| 455 | 455 | } else { |
| 456 | - $wpse_excerpt = apply_filters( 'the_content', $wpse_excerpt ); |
|
| 457 | - $wpse_excerpt = str_replace( ']]>', ']]>', $wpse_excerpt ); |
|
| 456 | + $wpse_excerpt = apply_filters('the_content', $wpse_excerpt); |
|
| 457 | + $wpse_excerpt = str_replace(']]>', ']]>', $wpse_excerpt); |
|
| 458 | 458 | //$wpse_excerpt = strip_tags( $wpse_excerpt, '<blockquote>,<p>' ); |
| 459 | - $wpse_excerpt = trim( force_balance_tags( $wpse_excerpt ) ); |
|
| 459 | + $wpse_excerpt = trim(force_balance_tags($wpse_excerpt)); |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | return $wpse_excerpt; |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | - return apply_filters( 'lsx_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt ); |
|
| 465 | + return apply_filters('lsx_custom_wp_trim_excerpt', $wpse_excerpt, $raw_excerpt); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | endif; |
| 469 | 469 | |
| 470 | -remove_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); |
|
| 471 | -add_filter( 'get_the_excerpt', 'lsx_custom_wp_trim_excerpt' ); |
|
| 470 | +remove_filter('get_the_excerpt', 'wp_trim_excerpt'); |
|
| 471 | +add_filter('get_the_excerpt', 'lsx_custom_wp_trim_excerpt'); |
|
| 472 | 472 | |
| 473 | -if ( ! function_exists( 'lsx_full_width_widget_classes' ) ) : |
|
| 473 | +if ( ! function_exists('lsx_full_width_widget_classes')) : |
|
| 474 | 474 | |
| 475 | 475 | /** |
| 476 | 476 | * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget. |
@@ -478,8 +478,8 @@ discard block |
||
| 478 | 478 | * @package lsx |
| 479 | 479 | * @subpackage extras |
| 480 | 480 | */ |
| 481 | - function lsx_full_width_widget_classes( $params ) { |
|
| 482 | - if ( is_admin() ) { |
|
| 481 | + function lsx_full_width_widget_classes($params) { |
|
| 482 | + if (is_admin()) { |
|
| 483 | 483 | return $params; |
| 484 | 484 | } |
| 485 | 485 | |
@@ -488,9 +488,9 @@ discard block |
||
| 488 | 488 | $widget_id = $params[0]['widget_id']; |
| 489 | 489 | $widget_name = $params[0]['widget_name']; |
| 490 | 490 | |
| 491 | - if ( 'Text' === $widget_name ) { |
|
| 492 | - $wp_registered_widgets[ $widget_id ]['original_callback'] = $wp_registered_widgets[ $widget_id ]['callback']; |
|
| 493 | - $wp_registered_widgets[ $widget_id ]['callback'] = 'lsx_full_width_widget_custom_callback'; |
|
| 491 | + if ('Text' === $widget_name) { |
|
| 492 | + $wp_registered_widgets[$widget_id]['original_callback'] = $wp_registered_widgets[$widget_id]['callback']; |
|
| 493 | + $wp_registered_widgets[$widget_id]['callback'] = 'lsx_full_width_widget_custom_callback'; |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | return $params; |
@@ -498,9 +498,9 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | endif; |
| 500 | 500 | |
| 501 | -add_filter( 'dynamic_sidebar_params', 'lsx_full_width_widget_classes' ); |
|
| 501 | +add_filter('dynamic_sidebar_params', 'lsx_full_width_widget_classes'); |
|
| 502 | 502 | |
| 503 | -if ( ! function_exists( 'lsx_full_width_widget_custom_callback' ) ) : |
|
| 503 | +if ( ! function_exists('lsx_full_width_widget_custom_callback')) : |
|
| 504 | 504 | |
| 505 | 505 | /** |
| 506 | 506 | * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget. |
@@ -514,25 +514,25 @@ discard block |
||
| 514 | 514 | $original_callback_params = func_get_args(); |
| 515 | 515 | $widget_id = $original_callback_params[0]['widget_id']; |
| 516 | 516 | |
| 517 | - $original_callback = $wp_registered_widgets[ $widget_id ]['original_callback']; |
|
| 518 | - $wp_registered_widgets[ $widget_id ]['callback'] = $original_callback; |
|
| 517 | + $original_callback = $wp_registered_widgets[$widget_id]['original_callback']; |
|
| 518 | + $wp_registered_widgets[$widget_id]['callback'] = $original_callback; |
|
| 519 | 519 | |
| 520 | - $widget_id_base = $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base; |
|
| 520 | + $widget_id_base = $wp_registered_widgets[$widget_id]['callback'][0]->id_base; |
|
| 521 | 521 | |
| 522 | 522 | $widget_classname = ''; |
| 523 | 523 | |
| 524 | - if ( is_callable( $original_callback ) ) { |
|
| 524 | + if (is_callable($original_callback)) { |
|
| 525 | 525 | ob_start(); |
| 526 | - call_user_func_array( $original_callback, $original_callback_params ); |
|
| 526 | + call_user_func_array($original_callback, $original_callback_params); |
|
| 527 | 527 | $widget_output = ob_get_clean(); |
| 528 | 528 | |
| 529 | - echo wp_kses_post( apply_filters( 'lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id ) ); |
|
| 529 | + echo wp_kses_post(apply_filters('lsx_widget_output', $widget_output, $widget_id_base, $widget_classname, $widget_id)); |
|
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | endif; |
| 534 | 534 | |
| 535 | -if ( ! function_exists( 'lsx_full_width_widget_output' ) ) : |
|
| 535 | +if ( ! function_exists('lsx_full_width_widget_output')) : |
|
| 536 | 536 | |
| 537 | 537 | /** |
| 538 | 538 | * Filter sidebar widget params, to add the widget_lsx_full_width_alt or widget_lsx_full_width classes to the text widget. |
@@ -540,12 +540,12 @@ discard block |
||
| 540 | 540 | * @package lsx |
| 541 | 541 | * @subpackage extras |
| 542 | 542 | */ |
| 543 | - function lsx_full_width_widget_output( $widget_output, $widget_id_base, $widget_id ) { |
|
| 544 | - if ( 'text' === $widget_id_base ) { |
|
| 545 | - if ( false !== strpos( $widget_output, '<div class="lsx-full-width-alt">' ) ) { |
|
| 546 | - $widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output ); |
|
| 547 | - } elseif ( false !== strpos( $widget_output, '<div class="lsx-full-width">' ) ) { |
|
| 548 | - $widget_output = str_replace( 'class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output ); |
|
| 543 | + function lsx_full_width_widget_output($widget_output, $widget_id_base, $widget_id) { |
|
| 544 | + if ('text' === $widget_id_base) { |
|
| 545 | + if (false !== strpos($widget_output, '<div class="lsx-full-width-alt">')) { |
|
| 546 | + $widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width_alt"', $widget_output); |
|
| 547 | + } elseif (false !== strpos($widget_output, '<div class="lsx-full-width">')) { |
|
| 548 | + $widget_output = str_replace('class="widget widget_text"', 'class="widget widget_text widget_lsx_full_width"', $widget_output); |
|
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
@@ -554,13 +554,13 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | endif; |
| 556 | 556 | |
| 557 | -add_filter( 'lsx_widget_output', 'lsx_full_width_widget_output', 10, 3 ); |
|
| 557 | +add_filter('lsx_widget_output', 'lsx_full_width_widget_output', 10, 3); |
|
| 558 | 558 | |
| 559 | 559 | /** |
| 560 | 560 | * Check if the content has a restricted post format that needs to show a full excerpt. |
| 561 | 561 | */ |
| 562 | 562 | function lsx_post_format_force_content_on_list() { |
| 563 | - $post_formats = apply_filters( 'lsx_post_format_force_content_on_list', |
|
| 563 | + $post_formats = apply_filters('lsx_post_format_force_content_on_list', |
|
| 564 | 564 | array( |
| 565 | 565 | 'video' => 'video', |
| 566 | 566 | 'audio' => 'audio', |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | ) |
| 570 | 570 | ); |
| 571 | 571 | $return = false; |
| 572 | - if ( ! has_post_format( $post_formats ) ) { |
|
| 572 | + if ( ! has_post_format($post_formats)) { |
|
| 573 | 573 | $return = true; |
| 574 | 574 | } |
| 575 | 575 | return $return; |
@@ -578,24 +578,24 @@ discard block |
||
| 578 | 578 | /** |
| 579 | 579 | * Remove the Hentry Class Every |
| 580 | 580 | */ |
| 581 | -function lsx_remove_hentry( $classes ) { |
|
| 582 | - if ( 'post' !== get_post_type() ) { |
|
| 583 | - $classes = array_diff( $classes, array( 'hentry' ) ); |
|
| 581 | +function lsx_remove_hentry($classes) { |
|
| 582 | + if ('post' !== get_post_type()) { |
|
| 583 | + $classes = array_diff($classes, array('hentry')); |
|
| 584 | 584 | } |
| 585 | 585 | return $classes; |
| 586 | 586 | } |
| 587 | -add_filter( 'post_class','lsx_remove_hentry' ); |
|
| 587 | +add_filter('post_class', 'lsx_remove_hentry'); |
|
| 588 | 588 | |
| 589 | 589 | /** |
| 590 | 590 | * Strip Excerpts. |
| 591 | 591 | * |
| 592 | 592 | */ |
| 593 | -function lsx_strip_excerpt( $content ) { |
|
| 594 | - if ( is_search() || is_archive() || ( is_blog_installed() && ! is_single() && ! is_page() ) ) { |
|
| 595 | - $content = strip_shortcodes( $content ); |
|
| 596 | - $content = str_replace( ']]>', ']]>', $content ); |
|
| 597 | - $content = strip_tags( $content ); |
|
| 593 | +function lsx_strip_excerpt($content) { |
|
| 594 | + if (is_search() || is_archive() || (is_blog_installed() && ! is_single() && ! is_page())) { |
|
| 595 | + $content = strip_shortcodes($content); |
|
| 596 | + $content = str_replace(']]>', ']]>', $content); |
|
| 597 | + $content = strip_tags($content); |
|
| 598 | 598 | } |
| 599 | 599 | return $content; |
| 600 | 600 | } |
| 601 | -add_filter( 'the_content', 'lsx_strip_excerpt' ); |
|
| 601 | +add_filter('the_content', 'lsx_strip_excerpt'); |
|
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @subpackage hooks |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | function lsx_body_top() { |
| 20 | - do_action( 'lsx_body_top' ); |
|
| 20 | + do_action('lsx_body_top'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | function lsx_body_bottom() { |
| 24 | - do_action( 'lsx_body_bottom' ); |
|
| 24 | + do_action('lsx_body_bottom'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | |
| 33 | 33 | function lsx_head_top() { |
| 34 | - do_action( 'lsx_head_top' ); |
|
| 34 | + do_action('lsx_head_top'); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | function lsx_head_bottom() { |
| 38 | - do_action( 'lsx_head_bottom' ); |
|
| 38 | + do_action('lsx_head_bottom'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -45,27 +45,27 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | |
| 47 | 47 | function lsx_header_before() { |
| 48 | - do_action( 'lsx_header_before' ); |
|
| 48 | + do_action('lsx_header_before'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | function lsx_header_after() { |
| 52 | - do_action( 'lsx_header_after' ); |
|
| 52 | + do_action('lsx_header_after'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | function lsx_header_top() { |
| 56 | - do_action( 'lsx_header_top' ); |
|
| 56 | + do_action('lsx_header_top'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | function lsx_header_bottom() { |
| 60 | - do_action( 'lsx_header_bottom' ); |
|
| 60 | + do_action('lsx_header_bottom'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | function lsx_nav_before() { |
| 64 | - do_action( 'lsx_nav_before' ); |
|
| 64 | + do_action('lsx_nav_before'); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | function lsx_nav_after() { |
| 68 | - do_action( 'lsx_nav_after' ); |
|
| 68 | + do_action('lsx_nav_after'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | |
| 77 | 77 | function lsx_banner_content() { |
| 78 | - do_action( 'lsx_banner_content' ); |
|
| 78 | + do_action('lsx_banner_content'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | function lsx_banner_inner_top() { |
| 82 | - do_action( 'lsx_banner_inner_top' ); |
|
| 82 | + do_action('lsx_banner_inner_top'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | function lsx_banner_inner_bottom() { |
| 86 | - do_action( 'lsx_banner_inner_bottom' ); |
|
| 86 | + do_action('lsx_banner_inner_bottom'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | |
| 95 | 95 | function lsx_global_header_inner_bottom() { |
| 96 | - do_action( 'lsx_global_header_inner_bottom' ); |
|
| 96 | + do_action('lsx_global_header_inner_bottom'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -103,35 +103,35 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | |
| 105 | 105 | function lsx_content_wrap_before() { |
| 106 | - do_action( 'lsx_content_wrap_before' ); |
|
| 106 | + do_action('lsx_content_wrap_before'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | function lsx_content_wrap_after() { |
| 110 | - do_action( 'lsx_content_wrap_after' ); |
|
| 110 | + do_action('lsx_content_wrap_after'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | function lsx_content_before() { |
| 114 | - do_action( 'lsx_content_before' ); |
|
| 114 | + do_action('lsx_content_before'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | function lsx_content_after() { |
| 118 | - do_action( 'lsx_content_after' ); |
|
| 118 | + do_action('lsx_content_after'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | function lsx_content_top() { |
| 122 | - do_action( 'lsx_content_top' ); |
|
| 122 | + do_action('lsx_content_top'); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | function lsx_content_bottom() { |
| 126 | - do_action( 'lsx_content_bottom' ); |
|
| 126 | + do_action('lsx_content_bottom'); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | function lsx_content_post_tags() { |
| 130 | - do_action( 'lsx_content_post_tags' ); |
|
| 130 | + do_action('lsx_content_post_tags'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | function lsx_content_sharing() { |
| 134 | - do_action( 'lsx_content_sharing' ); |
|
| 134 | + do_action('lsx_content_sharing'); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -141,19 +141,19 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | |
| 143 | 143 | function lsx_entry_before() { |
| 144 | - do_action( 'lsx_entry_before' ); |
|
| 144 | + do_action('lsx_entry_before'); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | function lsx_entry_after() { |
| 148 | - do_action( 'lsx_entry_after' ); |
|
| 148 | + do_action('lsx_entry_after'); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | function lsx_entry_top() { |
| 152 | - do_action( 'lsx_entry_top' ); |
|
| 152 | + do_action('lsx_entry_top'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | function lsx_entry_bottom() { |
| 156 | - do_action( 'lsx_entry_bottom' ); |
|
| 156 | + do_action('lsx_entry_bottom'); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
@@ -163,27 +163,27 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | |
| 165 | 165 | function lsx_widget_entry_before() { |
| 166 | - do_action( 'lsx_widget_entry_before' ); |
|
| 166 | + do_action('lsx_widget_entry_before'); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | function lsx_widget_entry_after() { |
| 170 | - do_action( 'lsx_widget_entry_after' ); |
|
| 170 | + do_action('lsx_widget_entry_after'); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | function lsx_widget_entry_top() { |
| 174 | - do_action( 'lsx_widget_entry_top' ); |
|
| 174 | + do_action('lsx_widget_entry_top'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | function lsx_widget_entry_bottom() { |
| 178 | - do_action( 'lsx_widget_entry_bottom' ); |
|
| 178 | + do_action('lsx_widget_entry_bottom'); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | function lsx_widget_entry_content_top() { |
| 182 | - do_action( 'lsx_widget_entry_content_top' ); |
|
| 182 | + do_action('lsx_widget_entry_content_top'); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | function lsx_widget_entry_content_bottom() { |
| 186 | - do_action( 'lsx_widget_entry_content_bottom' ); |
|
| 186 | + do_action('lsx_widget_entry_content_bottom'); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -193,11 +193,11 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | |
| 195 | 195 | function lsx_comments_before() { |
| 196 | - do_action( 'lsx_comments_before' ); |
|
| 196 | + do_action('lsx_comments_before'); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | function lsx_comments_after() { |
| 200 | - do_action( 'lsx_comments_after' ); |
|
| 200 | + do_action('lsx_comments_after'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -207,19 +207,19 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | |
| 209 | 209 | function lsx_sidebars_before() { |
| 210 | - do_action( 'lsx_sidebars_before' ); |
|
| 210 | + do_action('lsx_sidebars_before'); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | function lsx_sidebars_after() { |
| 214 | - do_action( 'lsx_sidebars_after' ); |
|
| 214 | + do_action('lsx_sidebars_after'); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | function lsx_sidebar_top() { |
| 218 | - do_action( 'lsx_sidebar_top' ); |
|
| 218 | + do_action('lsx_sidebar_top'); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | function lsx_sidebar_bottom() { |
| 222 | - do_action( 'lsx_sidebar_bottom' ); |
|
| 222 | + do_action('lsx_sidebar_bottom'); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | /** |
@@ -229,17 +229,17 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | |
| 231 | 231 | function lsx_footer_before() { |
| 232 | - do_action( 'lsx_footer_before' ); |
|
| 232 | + do_action('lsx_footer_before'); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | function lsx_footer_after() { |
| 236 | - do_action( 'lsx_footer_after' ); |
|
| 236 | + do_action('lsx_footer_after'); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | function lsx_footer_top() { |
| 240 | - do_action( 'lsx_footer_top' ); |
|
| 240 | + do_action('lsx_footer_top'); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | function lsx_footer_bottom() { |
| 244 | - do_action( 'lsx_footer_bottom' ); |
|
| 244 | + do_action('lsx_footer_bottom'); |
|
| 245 | 245 | } |