@@ -60,12 +60,12 @@ |
||
| 60 | 60 | <strong><?php _e( 'Get your Tourism Establishment Online', 'lsx' ); ?></strong> |
| 61 | 61 | |
| 62 | 62 | <?php |
| 63 | - if(is_singular('landing-page')){ |
|
| 64 | - $email_address = get_post_meta(get_the_ID(),'email_address',true); |
|
| 65 | - if(false === $email_address){ |
|
| 63 | + if(is_singular('landing-page')){ |
|
| 64 | + $email_address = get_post_meta(get_the_ID(),'email_address',true); |
|
| 65 | + if(false === $email_address){ |
|
| 66 | 66 | $email_address = '[email protected]'; |
| 67 | 67 | } |
| 68 | - } ?> |
|
| 68 | + } ?> |
|
| 69 | 69 | |
| 70 | 70 | <span class="email-address"><?php _e( 'Questions? Email Us: ', 'lsx' ); ?><a href="mailto:<?php echo $email_address; ?>"><?php echo $email_address; ?></a></span> |
| 71 | 71 | </div> |
@@ -12,16 +12,16 @@ discard block |
||
| 12 | 12 | <html <?php language_attributes(); ?>> |
| 13 | 13 | <head> |
| 14 | 14 | <?php lsx_head_top(); ?> |
| 15 | -<meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
| 15 | +<meta charset="<?php bloginfo('charset'); ?>"> |
|
| 16 | 16 | <link rel="profile" href="http://gmpg.org/xfn/11"> |
| 17 | -<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> |
|
| 17 | +<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>"> |
|
| 18 | 18 | <?php lsx_head_bottom(); ?> |
| 19 | 19 | <?php wp_head(); ?> |
| 20 | 20 | </head> |
| 21 | -<body <?php body_class( 'lsx' ); ?>> |
|
| 21 | +<body <?php body_class('lsx'); ?>> |
|
| 22 | 22 | <?php lsx_body_top(); ?> |
| 23 | 23 | |
| 24 | -<?php if ( !is_singular('landing-page') ) { ?> |
|
| 24 | +<?php if ( ! is_singular('landing-page')) { ?> |
|
| 25 | 25 | |
| 26 | 26 | <?php lsx_header_before(); ?> |
| 27 | 27 | <header class="<?php lsx_header_classes(); ?>"> |
@@ -57,17 +57,17 @@ discard block |
||
| 57 | 57 | </div> |
| 58 | 58 | |
| 59 | 59 | <div class="header-links"> |
| 60 | - <strong><?php esc_html_e( 'Get your Tourism Establishment Online', 'lsx' ); ?></strong> |
|
| 60 | + <strong><?php esc_html_e('Get your Tourism Establishment Online', 'lsx'); ?></strong> |
|
| 61 | 61 | |
| 62 | 62 | <?php |
| 63 | - if(is_singular('landing-page')){ |
|
| 64 | - $email_address = get_post_meta(get_the_ID(),'email_address',true); |
|
| 65 | - if(false === $email_address){ |
|
| 63 | + if (is_singular('landing-page')) { |
|
| 64 | + $email_address = get_post_meta(get_the_ID(), 'email_address', true); |
|
| 65 | + if (false === $email_address) { |
|
| 66 | 66 | $email_address = '[email protected]'; |
| 67 | 67 | } |
| 68 | 68 | } ?> |
| 69 | 69 | |
| 70 | - <span class="email-address"><?php esc_html_e( 'Questions? Email Us: ', 'lsx' ); ?><a href="mailto:<?php echo esc_attr( $email_address ); ?>"><?php echo esc_html( $email_address ); ?></a></span> |
|
| 70 | + <span class="email-address"><?php esc_html_e('Questions? Email Us: ', 'lsx'); ?><a href="mailto:<?php echo esc_attr($email_address); ?>"><?php echo esc_html($email_address); ?></a></span> |
|
| 71 | 71 | </div> |
| 72 | 72 | </div> |
| 73 | 73 | |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | |
| 22 | 22 | <?php lsx_content_top(); ?> |
| 23 | 23 | |
| 24 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 24 | + <?php while (have_posts()) : the_post(); ?> |
|
| 25 | 25 | |
| 26 | - <?php get_template_part( 'content', 'portfolio-single' ); ?> |
|
| 26 | + <?php get_template_part('content', 'portfolio-single'); ?> |
|
| 27 | 27 | |
| 28 | 28 | <?php endwhile; ?> |
| 29 | 29 | |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | <?php lsx_content_top(); ?> |
| 15 | 15 | |
| 16 | - <?php if(have_posts() && !class_exists('Lsx_Banners')) : ?> |
|
| 16 | + <?php if (have_posts() && ! class_exists('Lsx_Banners')) : ?> |
|
| 17 | 17 | |
| 18 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 18 | + <?php while (have_posts()) : the_post(); ?> |
|
| 19 | 19 | |
| 20 | 20 | <?php lsx_entry_before(); ?> |
| 21 | 21 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | <div id="home-widgets"> |
| 38 | 38 | |
| 39 | - <?php if ( ! dynamic_sidebar( 'sidebar-home' ) ) : ?> |
|
| 39 | + <?php if ( ! dynamic_sidebar('sidebar-home')) : ?> |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | <?php endif; // end sidebar widget area ?> |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | <?php lsx_content_top(); ?> |
| 15 | 15 | |
| 16 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 16 | + <?php while (have_posts()) : the_post(); ?> |
|
| 17 | 17 | |
| 18 | - <?php get_template_part( 'content', 'page' ); ?> |
|
| 18 | + <?php get_template_part('content', 'page'); ?> |
|
| 19 | 19 | |
| 20 | 20 | <?php endwhile; // end of the loop. ?> |
| 21 | 21 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | <?php |
| 25 | 25 | // If comments are open or we have at least one comment, load up the comment template |
| 26 | - if ( comments_open() || '0' != get_comments_number() ) : |
|
| 26 | + if (comments_open() || '0' != get_comments_number()) : |
|
| 27 | 27 | comments_template(); |
| 28 | 28 | endif; |
| 29 | 29 | ?> |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | |
| 9 | 9 | $type_class = "filter-item column-3 "; |
| 10 | -$types = get_the_terms( get_the_ID(), 'jetpack-portfolio-type'); |
|
| 10 | +$types = get_the_terms(get_the_ID(), 'jetpack-portfolio-type'); |
|
| 11 | 11 | if ($types) { |
| 12 | 12 | foreach ($types as $type) { |
| 13 | 13 | $type_class .= $type->slug . " "; |
@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | <article id="post-<?php the_ID(); ?>" data-column="<?php echo 3; ?>" <?php post_class($type_class); ?>> |
| 19 | 19 | <div class="portfolio-content-wrapper"> |
| 20 | 20 | <div class="portfolio-thumbnail"> |
| 21 | - <?php if ( has_post_thumbnail() ) : ?> |
|
| 21 | + <?php if (has_post_thumbnail()) : ?> |
|
| 22 | 22 | <a href="<?php the_permalink(); ?>"> |
| 23 | - <?php lsx_thumbnail( 'lsx-thumbnail-wide' ); ?> |
|
| 23 | + <?php lsx_thumbnail('lsx-thumbnail-wide'); ?> |
|
| 24 | 24 | </a> |
| 25 | 25 | <?php endif; ?> |
| 26 | 26 | </div> |
| 27 | 27 | |
| 28 | - <?php the_title( '<a class="portfolio-title" href="' . esc_url( get_permalink() ) . '" rel="bookmark"><span>', '</span></a>' ); ?> |
|
| 28 | + <?php the_title('<a class="portfolio-title" href="' . esc_url(get_permalink()) . '" rel="bookmark"><span>', '</span></a>'); ?> |
|
| 29 | 29 | </div> |
| 30 | 30 | </article> |
| 31 | 31 | \ No newline at end of file |
@@ -16,15 +16,15 @@ |
||
| 16 | 16 | <?php |
| 17 | 17 | the_content(); |
| 18 | 18 | |
| 19 | - wp_link_pages( array( |
|
| 19 | + wp_link_pages(array( |
|
| 20 | 20 | 'before' => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">', |
| 21 | 21 | 'after' => '</div></div>', |
| 22 | 22 | 'link_before' => '<span>', |
| 23 | 23 | 'link_after' => '</span>' |
| 24 | - ) ); |
|
| 24 | + )); |
|
| 25 | 25 | ?> |
| 26 | 26 | </div><!-- .entry-content --> |
| 27 | - <?php edit_post_link( __( 'Edit', 'lsx' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?> |
|
| 27 | + <?php edit_post_link(__('Edit', 'lsx'), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>'); ?> |
|
| 28 | 28 | |
| 29 | 29 | <?php lsx_entry_bottom(); ?> |
| 30 | 30 | |
@@ -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,50 +28,50 @@ 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( 'automatic-feed-links' ); |
|
| 41 | - add_theme_support( 'title-tag' ); |
|
| 42 | - add_theme_support( 'post-thumbnails' ); |
|
| 43 | - add_theme_support( 'post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside') ); |
|
| 40 | + add_theme_support('automatic-feed-links'); |
|
| 41 | + add_theme_support('title-tag'); |
|
| 42 | + add_theme_support('post-thumbnails'); |
|
| 43 | + add_theme_support('post-formats', array('image', 'video', 'gallery', 'audio', 'link', 'quote', 'aside')); |
|
| 44 | 44 | |
| 45 | 45 | // This theme uses wp_nav_menu() in one location. |
| 46 | - register_nav_menus( array( |
|
| 47 | - 'primary' => __( 'Primary Menu', 'lsx' ), |
|
| 48 | - 'top-menu'=> __( 'Top Menu' , 'lsx' ), |
|
| 49 | - 'social'=> __( 'Social Menu' , 'lsx' ), |
|
| 50 | - 'footer'=> __( 'Footer Menu' , 'lsx' ) |
|
| 51 | - ) ); |
|
| 46 | + register_nav_menus(array( |
|
| 47 | + 'primary' => __('Primary Menu', 'lsx'), |
|
| 48 | + 'top-menu'=> __('Top Menu', 'lsx'), |
|
| 49 | + 'social'=> __('Social Menu', 'lsx'), |
|
| 50 | + 'footer'=> __('Footer Menu', 'lsx') |
|
| 51 | + )); |
|
| 52 | 52 | |
| 53 | 53 | //Set the content width |
| 54 | 54 | $content_width = 1140; |
| 55 | 55 | |
| 56 | - add_editor_style( get_template_directory_uri() . '/css/editor-style.css' ); |
|
| 57 | - add_theme_support( 'html5', array( 'caption' ) ); |
|
| 56 | + add_editor_style(get_template_directory_uri() . '/css/editor-style.css'); |
|
| 57 | + add_theme_support('html5', array('caption')); |
|
| 58 | 58 | |
| 59 | - add_theme_support( 'woocommerce' ); |
|
| 60 | - add_theme_support( 'sensei' ); |
|
| 59 | + add_theme_support('woocommerce'); |
|
| 60 | + add_theme_support('sensei'); |
|
| 61 | 61 | } |
| 62 | 62 | endif; // lsx_setup |
| 63 | -add_action( 'after_setup_theme', 'lsx_setup' ); |
|
| 63 | +add_action('after_setup_theme', 'lsx_setup'); |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Removes the "Custom Fields" meta box. |
| 67 | 67 | */ |
| 68 | 68 | function lsx_remove_meta_boxes() { |
| 69 | 69 | $post_types = get_post_types(); |
| 70 | - foreach($post_types as $post_type){ |
|
| 71 | - remove_meta_box( 'postcustom' , $post_type , 'normal' ); |
|
| 70 | + foreach ($post_types as $post_type) { |
|
| 71 | + remove_meta_box('postcustom', $post_type, 'normal'); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | -add_action( 'admin_menu' , 'lsx_remove_meta_boxes' ); |
|
| 74 | +add_action('admin_menu', 'lsx_remove_meta_boxes'); |
|
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | 77 | * Overwrite the $content_width var, based on the layout of the page. |
@@ -83,34 +83,34 @@ discard block |
||
| 83 | 83 | function lsx_process_content_width() { |
| 84 | 84 | global $content_width; |
| 85 | 85 | |
| 86 | - if( |
|
| 86 | + if ( |
|
| 87 | 87 | is_page_template('page-templates/template-portfolio.php') || |
| 88 | 88 | is_page_template('page-templates/template-front-page.php') || |
| 89 | 89 | is_page_template('page-templates/template-full-width.php') || |
| 90 | 90 | is_post_type_archive('jetpack-portfolio') || |
| 91 | - is_tax(array('jetpack-portfolio-type','jetpack-portfolio-tag')) || |
|
| 91 | + is_tax(array('jetpack-portfolio-type', 'jetpack-portfolio-tag')) || |
|
| 92 | 92 | is_singular('jetpack-portfolio') |
| 93 | - ){ |
|
| 93 | + ) { |
|
| 94 | 94 | $content_width = 1140; |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | -add_action('wp_head','lsx_process_content_width'); |
|
| 97 | +add_action('wp_head', 'lsx_process_content_width'); |
|
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | 100 | * Disable the comments form by default for the page post type. |
| 101 | 101 | * @package lsx |
| 102 | 102 | * @subpackage config |
| 103 | 103 | */ |
| 104 | -function lsx_page_comments_off( $data ) { |
|
| 104 | +function lsx_page_comments_off($data) { |
|
| 105 | 105 | |
| 106 | - if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft','lsx') ) { |
|
| 106 | + if ($data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft', 'lsx')) { |
|
| 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. |
@@ -119,14 +119,14 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | function lsx_is_legacy($data) { |
| 121 | 121 | |
| 122 | - if( $data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft','lsx') ) { |
|
| 122 | + if ($data['post_type'] == 'page' && $data['post_status'] == 'auto-draft' && $data['post_title'] == __('Auto Draft', 'lsx')) { |
|
| 123 | 123 | $data['comment_status'] = 0; |
| 124 | 124 | $data['ping_status'] = 0; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $data; |
| 128 | 128 | } |
| 129 | -add_filter( 'wp_insert_post_data', 'lsx_page_comments_off' ); |
|
| 129 | +add_filter('wp_insert_post_data', 'lsx_page_comments_off'); |
|
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | 132 | * Run the init command |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | * @subpackage config |
| 135 | 135 | */ |
| 136 | 136 | function lsx_init() { |
| 137 | - if(class_exists('WooCommerce')){ |
|
| 138 | - remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); |
|
| 137 | + if (class_exists('WooCommerce')) { |
|
| 138 | + remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | -add_action( 'init', 'lsx_init',100 ); |
|
| 141 | +add_action('init', 'lsx_init', 100); |
|
| 142 | 142 | |
| 143 | 143 | /** |
| 144 | 144 | * Run on the wp_head |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | function lsx_wp_head() { |
| 149 | 149 | |
| 150 | - $layout = get_theme_mod('lsx_layout','2cr'); |
|
| 151 | - $layout = apply_filters( 'lsx_layout', $layout ); |
|
| 150 | + $layout = get_theme_mod('lsx_layout', '2cr'); |
|
| 151 | + $layout = apply_filters('lsx_layout', $layout); |
|
| 152 | 152 | |
| 153 | - 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')) ){ |
|
| 154 | - remove_action('lsx_content_top', 'lsx_breadcrumbs', 100 ); |
|
| 153 | + 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'))) { |
|
| 154 | + remove_action('lsx_content_top', 'lsx_breadcrumbs', 100); |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | -add_action( 'wp_head', 'lsx_wp_head',100 ); |
|
| 157 | +add_action('wp_head', 'lsx_wp_head', 100); |
|
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | * @param mixed $setting The setting for which the sanitizing is occurring. |
| 18 | 18 | * @return mixed The sanitized value. |
| 19 | 19 | */ |
| 20 | -function lsx_sanitize_choices( $value, $setting ) { |
|
| 21 | - if ( is_object( $setting ) ) { |
|
| 20 | +function lsx_sanitize_choices($value, $setting) { |
|
| 21 | + if (is_object($setting)) { |
|
| 22 | 22 | $setting = $setting->id; |
| 23 | 23 | } |
| 24 | - $choices = lsx_customizer_sanitize_get_choices( $setting ); |
|
| 25 | - $allowed_choices = array_keys( $choices ); |
|
| 26 | - if ( ! in_array( $value, $allowed_choices ) ) { |
|
| 27 | - $value = lsx_customizer_sanitize_get_default( $setting ); |
|
| 24 | + $choices = lsx_customizer_sanitize_get_choices($setting); |
|
| 25 | + $allowed_choices = array_keys($choices); |
|
| 26 | + if ( ! in_array($value, $allowed_choices)) { |
|
| 27 | + $value = lsx_customizer_sanitize_get_default($setting); |
|
| 28 | 28 | } |
| 29 | 29 | return $value; |
| 30 | 30 | } |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | * @return mixed $field |
| 40 | 40 | */ |
| 41 | 41 | |
| 42 | -function lsx_customizer_sanitize_get_choices( $id ) { |
|
| 42 | +function lsx_customizer_sanitize_get_choices($id) { |
|
| 43 | 43 | global $lsx_customizer; |
| 44 | 44 | //LSX_Theme_Customizer |
| 45 | 45 | |
| 46 | 46 | $field = $lsx_customizer->get_control($id); |
| 47 | 47 | |
| 48 | - if ( isset( $field['choices'] ) ) { |
|
| 48 | + if (isset($field['choices'])) { |
|
| 49 | 49 | return $field['choices']; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | * @return mixed $default |
| 62 | 62 | */ |
| 63 | 63 | |
| 64 | -function lsx_customizer_sanitize_get_default( $id ) { |
|
| 64 | +function lsx_customizer_sanitize_get_default($id) { |
|
| 65 | 65 | global $lsx_customizer; |
| 66 | 66 | //LSX_Theme_Customizer |
| 67 | 67 | |
| 68 | 68 | $setting = $lsx_customizer->get_setting($id); |
| 69 | 69 | |
| 70 | - if ( isset( $setting['default'] ) ) { |
|
| 70 | + if (isset($setting['default'])) { |
|
| 71 | 71 | return $setting['default']; |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | * @param obj $setting |
| 83 | 83 | * @return string $default |
| 84 | 84 | */ |
| 85 | -function lsx_sanitize_email( $email, $setting ) { |
|
| 85 | +function lsx_sanitize_email($email, $setting) { |
|
| 86 | 86 | // Sanitize $input as a hex value without the hash prefix. |
| 87 | - $email = sanitize_email( $email ); |
|
| 87 | + $email = sanitize_email($email); |
|
| 88 | 88 | |
| 89 | 89 | // If $email is a valid email, return it; otherwise, return the default. |
| 90 | - return ( ! is_null( $email ) ? $email : $setting->default ); |
|
| 90 | + return ( ! is_null($email) ? $email : $setting->default); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | * @param array $input |
| 100 | 100 | * @return array $output |
| 101 | 101 | */ |
| 102 | -function lsx_sanitize_checkbox( $input ) { |
|
| 103 | - if ( $input ) { |
|
| 102 | +function lsx_sanitize_checkbox($input) { |
|
| 103 | + if ($input) { |
|
| 104 | 104 | $output = '1'; |
| 105 | 105 | } else { |
| 106 | 106 | $output = false; |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | * @category portfolio |
| 124 | 124 | */ |
| 125 | 125 | function lsx_remove_single_related_posts() { |
| 126 | - if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 127 | - $jprp = Jetpack_RelatedPosts::init(); |
|
| 128 | - $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
| 129 | - remove_filter( 'the_content', $callback, 40 ); |
|
| 130 | - } |
|
| 126 | + if ( is_single() && class_exists( 'Jetpack_RelatedPosts' ) ) { |
|
| 127 | + $jprp = Jetpack_RelatedPosts::init(); |
|
| 128 | + $callback = array( $jprp, 'filter_add_target_to_dom' ); |
|
| 129 | + remove_filter( 'the_content', $callback, 40 ); |
|
| 130 | + } |
|
| 131 | 131 | } |
| 132 | 132 | add_filter( 'wp', 'lsx_remove_single_related_posts', 20 ); |
| 133 | 133 | |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if(is_array($types)){ |
| 312 | 312 | foreach ($types as $type) { |
| 313 | 313 | $content = '<li><a href="#" data-filter=".'.$type->slug.'">'; |
| 314 | - $content .= $type->name; |
|
| 314 | + $content .= $type->name; |
|
| 315 | 315 | $content .= '</a></li>'; |
| 316 | 316 | echo $content; |
| 317 | 317 | echo "\n"; |
@@ -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,35 +214,35 @@ 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 | - check_admin_referer( 'lsx_save_portfolio', '_lsx_client_nonce' ); |
|
| 222 | - check_admin_referer( 'lsx_save_portfolio', '_lsx_website_nonce' ); |
|
| 220 | +function lsx_save_portfolio_post_meta($post_id, $post) { |
|
| 221 | + check_admin_referer('lsx_save_portfolio', '_lsx_client_nonce'); |
|
| 222 | + check_admin_referer('lsx_save_portfolio', '_lsx_website_nonce'); |
|
| 223 | 223 | |
| 224 | - $post_type = get_post_type_object( $post->post_type ); |
|
| 224 | + $post_type = get_post_type_object($post->post_type); |
|
| 225 | 225 | |
| 226 | - if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) |
|
| 226 | + if ( ! current_user_can($post_type->cap->edit_post, $post_id)) |
|
| 227 | 227 | return $post_id; |
| 228 | 228 | |
| 229 | 229 | |
| 230 | - $meta_keys = array('lsx-website','lsx-client'); |
|
| 230 | + $meta_keys = array('lsx-website', 'lsx-client'); |
|
| 231 | 231 | |
| 232 | - foreach($meta_keys as $meta_key){ |
|
| 233 | - $new_meta_value = sanitize_text_field( wp_unslash( $_POST[$meta_key] ) ); |
|
| 234 | - $new_meta_value = ! empty( $new_meta_value ) ? $new_meta_value : ''; |
|
| 232 | + foreach ($meta_keys as $meta_key) { |
|
| 233 | + $new_meta_value = sanitize_text_field(wp_unslash($_POST[$meta_key])); |
|
| 234 | + $new_meta_value = ! empty($new_meta_value) ? $new_meta_value : ''; |
|
| 235 | 235 | |
| 236 | - $meta_value = get_post_meta( $post_id, $meta_key, true ); |
|
| 236 | + $meta_value = get_post_meta($post_id, $meta_key, true); |
|
| 237 | 237 | |
| 238 | - if ( $new_meta_value && '' == $meta_value ) |
|
| 239 | - add_post_meta( $post_id, $meta_key, $new_meta_value, true ); |
|
| 238 | + if ($new_meta_value && '' == $meta_value) |
|
| 239 | + add_post_meta($post_id, $meta_key, $new_meta_value, true); |
|
| 240 | 240 | |
| 241 | - elseif ( $new_meta_value && $new_meta_value != $meta_value ) |
|
| 242 | - update_post_meta( $post_id, $meta_key, $new_meta_value ); |
|
| 241 | + elseif ($new_meta_value && $new_meta_value != $meta_value) |
|
| 242 | + update_post_meta($post_id, $meta_key, $new_meta_value); |
|
| 243 | 243 | |
| 244 | - elseif ( '' == $new_meta_value && $meta_value ) |
|
| 245 | - delete_post_meta( $post_id, $meta_key, $meta_value ); |
|
| 244 | + elseif ('' == $new_meta_value && $meta_value) |
|
| 245 | + delete_post_meta($post_id, $meta_key, $meta_value); |
|
| 246 | 246 | |
| 247 | 247 | } |
| 248 | 248 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | add_meta_box( |
| 253 | 253 | 'lsx_client_meta_box', |
| 254 | - esc_html__( 'Client', 'lsx' ), |
|
| 254 | + esc_html__('Client', 'lsx'), |
|
| 255 | 255 | 'lsx_client_meta_box', |
| 256 | 256 | 'jetpack-portfolio', |
| 257 | 257 | 'side', |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | add_meta_box( |
| 262 | 262 | 'lsx_website_meta_box', |
| 263 | - esc_html__( 'Website', 'lsx' ), |
|
| 263 | + esc_html__('Website', 'lsx'), |
|
| 264 | 264 | 'lsx_website_meta_box', |
| 265 | 265 | 'jetpack-portfolio', |
| 266 | 266 | 'side', |
@@ -268,25 +268,25 @@ discard block |
||
| 268 | 268 | ); |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | -function lsx_client_meta_box( $object, $box ) { ?> |
|
| 271 | +function lsx_client_meta_box($object, $box) { ?> |
|
| 272 | 272 | |
| 273 | - <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_client_nonce' ); ?> |
|
| 273 | + <?php wp_nonce_field('lsx_save_portfolio', '_lsx_client_nonce'); ?> |
|
| 274 | 274 | |
| 275 | 275 | <p> |
| 276 | - <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" /> |
|
| 276 | + <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" /> |
|
| 277 | 277 | <br /><br /> |
| 278 | - <label for="lsx-client"><?php esc_html_e( 'Enter the name of the project client', 'lsx' ); ?></label> |
|
| 278 | + <label for="lsx-client"><?php esc_html_e('Enter the name of the project client', 'lsx'); ?></label> |
|
| 279 | 279 | </p> |
| 280 | 280 | <?php } |
| 281 | 281 | |
| 282 | -function lsx_website_meta_box( $object, $box ) { ?> |
|
| 282 | +function lsx_website_meta_box($object, $box) { ?> |
|
| 283 | 283 | |
| 284 | - <?php wp_nonce_field( 'lsx_save_portfolio', '_lsx_website_nonce' ); ?> |
|
| 284 | + <?php wp_nonce_field('lsx_save_portfolio', '_lsx_website_nonce'); ?> |
|
| 285 | 285 | |
| 286 | 286 | <p> |
| 287 | - <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" /> |
|
| 287 | + <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" /> |
|
| 288 | 288 | <br /><br /> |
| 289 | - <label for="lsx-website"><?php esc_html_e( 'Enter the URL of the project website', 'lsx' ); ?></label> |
|
| 289 | + <label for="lsx-website"><?php esc_html_e('Enter the URL of the project website', 'lsx'); ?></label> |
|
| 290 | 290 | </p> |
| 291 | 291 | <?php } |
| 292 | 292 | |
@@ -299,18 +299,18 @@ discard block |
||
| 299 | 299 | * @category portfolio |
| 300 | 300 | */ |
| 301 | 301 | |
| 302 | -function lsx_portfolio_sorter(){ ?> |
|
| 302 | +function lsx_portfolio_sorter() { ?> |
|
| 303 | 303 | <ul id="filterNav" class="clearfix"> |
| 304 | - <li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e( 'All', 'lsx' ); ?></a></li> |
|
| 304 | + <li class="allBtn"><a href="#" data-filter="*" class="selected"><?php esc_html_e('All', 'lsx'); ?></a></li> |
|
| 305 | 305 | <?php |
| 306 | 306 | $types = get_terms('jetpack-portfolio-type'); |
| 307 | 307 | |
| 308 | - if(is_array($types)){ |
|
| 308 | + if (is_array($types)) { |
|
| 309 | 309 | foreach ($types as $type) { |
| 310 | - $content = '<li><a href="#" data-filter=".'.$type->slug.'">'; |
|
| 310 | + $content = '<li><a href="#" data-filter=".' . $type->slug . '">'; |
|
| 311 | 311 | $content .= $type->name; |
| 312 | 312 | $content .= '</a></li>'; |
| 313 | - echo wp_kses_post( $content ); |
|
| 313 | + echo wp_kses_post($content); |
|
| 314 | 314 | echo "\n"; |
| 315 | 315 | } |
| 316 | 316 | }?> |
@@ -325,18 +325,18 @@ discard block |
||
| 325 | 325 | * @category portfolio |
| 326 | 326 | */ |
| 327 | 327 | |
| 328 | -function lsx_portfolio_naviagtion_labels($labels){ |
|
| 328 | +function lsx_portfolio_naviagtion_labels($labels) { |
|
| 329 | 329 | |
| 330 | - if(is_post_type_archive('jetpack-portfolio')){ |
|
| 330 | + if (is_post_type_archive('jetpack-portfolio')) { |
|
| 331 | 331 | $labels = array( |
| 332 | - 'next' => '<span class="meta-nav">←</span> '.__( 'Older', 'lsx' ), |
|
| 333 | - 'previous' => __( 'Newer', 'lsx' ).' <span class="meta-nav">→</span>', |
|
| 334 | - 'title' => __( 'Portfolio navigation', 'lsx' ) |
|
| 332 | + 'next' => '<span class="meta-nav">←</span> ' . __('Older', 'lsx'), |
|
| 333 | + 'previous' => __('Newer', 'lsx') . ' <span class="meta-nav">→</span>', |
|
| 334 | + 'title' => __('Portfolio navigation', 'lsx') |
|
| 335 | 335 | ); |
| 336 | 336 | } |
| 337 | 337 | return $labels; |
| 338 | 338 | } |
| 339 | -add_filter('lsx_post_navigation_labels','lsx_portfolio_naviagtion_labels',1,10); |
|
| 339 | +add_filter('lsx_post_navigation_labels', 'lsx_portfolio_naviagtion_labels', 1, 10); |
|
| 340 | 340 | |
| 341 | 341 | |
| 342 | 342 | /* |
@@ -350,11 +350,11 @@ discard block |
||
| 350 | 350 | * @subpackage jetpack |
| 351 | 351 | * @category related-posts |
| 352 | 352 | */ |
| 353 | -function lsx_remove_related_post_context(){ |
|
| 354 | - add_filter( 'jetpack_relatedposts_filter_post_context', '__return_empty_string' ); |
|
| 355 | - add_filter( 'rest_api_allowed_post_types', 'lsx_allowed_related_post_types' ); |
|
| 353 | +function lsx_remove_related_post_context() { |
|
| 354 | + add_filter('jetpack_relatedposts_filter_post_context', '__return_empty_string'); |
|
| 355 | + add_filter('rest_api_allowed_post_types', 'lsx_allowed_related_post_types'); |
|
| 356 | 356 | } |
| 357 | -add_action('init','lsx_remove_related_post_context',20); |
|
| 357 | +add_action('init', 'lsx_remove_related_post_context', 20); |
|
| 358 | 358 | |
| 359 | 359 | |
| 360 | 360 | /* |
@@ -371,13 +371,13 @@ discard block |
||
| 371 | 371 | $infinite_scroll_args = array( |
| 372 | 372 | 'container' => 'main', |
| 373 | 373 | 'type' => 'click', |
| 374 | - 'posts_per_page' => get_option('posts_per_page',10), |
|
| 374 | + 'posts_per_page' => get_option('posts_per_page', 10), |
|
| 375 | 375 | 'render' => 'lsx_infinite_scroll_render' |
| 376 | 376 | ); |
| 377 | 377 | |
| 378 | - add_theme_support( 'infinite-scroll', $infinite_scroll_args ); |
|
| 378 | + add_theme_support('infinite-scroll', $infinite_scroll_args); |
|
| 379 | 379 | } |
| 380 | -add_action( 'after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup' ); |
|
| 380 | +add_action('after_setup_theme', 'lsx_jetpack_infinite_scroll_after_setup'); |
|
| 381 | 381 | |
| 382 | 382 | /** |
| 383 | 383 | * Set the code to be rendered on for calling posts, |
@@ -390,13 +390,13 @@ discard block |
||
| 390 | 390 | function lsx_infinite_scroll_render() { |
| 391 | 391 | global $wp_query; |
| 392 | 392 | |
| 393 | - while(have_posts()){ |
|
| 393 | + while (have_posts()) { |
|
| 394 | 394 | the_post(); |
| 395 | 395 | |
| 396 | - if('jetpack-portfolio' == get_post_type()){ |
|
| 397 | - get_template_part( 'content', 'portfolio' ); |
|
| 398 | - }else{ |
|
| 399 | - get_template_part( 'content', get_post_type() ); |
|
| 396 | + if ('jetpack-portfolio' == get_post_type()) { |
|
| 397 | + get_template_part('content', 'portfolio'); |
|
| 398 | + } else { |
|
| 399 | + get_template_part('content', get_post_type()); |
|
| 400 | 400 | } |
| 401 | 401 | } |
| 402 | 402 | } |
@@ -408,8 +408,8 @@ discard block |
||
| 408 | 408 | * @subpackage jetpack |
| 409 | 409 | * @category related posts |
| 410 | 410 | */ |
| 411 | -function lsx_related_posts_headline( $headline ) { |
|
| 412 | - $headline = sprintf( '<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html( 'Related Posts' ) ); |
|
| 411 | +function lsx_related_posts_headline($headline) { |
|
| 412 | + $headline = sprintf('<h3 class="jp-relatedposts-headline"><em>%s</em></h3>', esc_html('Related Posts')); |
|
| 413 | 413 | return $headline; |
| 414 | 414 | } |
| 415 | -add_filter( 'jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline' ); |
|
| 415 | +add_filter('jetpack_relatedposts_filter_headline', 'lsx_related_posts_headline'); |
|