@@ -13,48 +13,48 @@ discard block |
||
| 13 | 13 | * Add our action to init to set up our vars first. |
| 14 | 14 | */ |
| 15 | 15 | function lsx_projects_load_plugin_textdomain() { |
| 16 | - load_plugin_textdomain( 'lsx-projects', false, basename( LSX_PROJECTS_PATH ) . '/languages' ); |
|
| 16 | + load_plugin_textdomain('lsx-projects', false, basename(LSX_PROJECTS_PATH) . '/languages'); |
|
| 17 | 17 | } |
| 18 | -add_action( 'init', 'lsx_projects_load_plugin_textdomain' ); |
|
| 18 | +add_action('init', 'lsx_projects_load_plugin_textdomain'); |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Wraps the output class in a function to be called in templates |
| 22 | 22 | */ |
| 23 | -function lsx_projects( $args ) { |
|
| 23 | +function lsx_projects($args) { |
|
| 24 | 24 | $lsx_projects = new LSX_Projects; |
| 25 | - echo wp_kses_post( $lsx_projects->output( $args ) ); |
|
| 25 | + echo wp_kses_post($lsx_projects->output($args)); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Shortcode |
| 30 | 30 | */ |
| 31 | -function lsx_projects_shortcode( $atts ) { |
|
| 31 | +function lsx_projects_shortcode($atts) { |
|
| 32 | 32 | $lsx_projects = new LSX_Projects; |
| 33 | - return $lsx_projects->output( $atts ); |
|
| 33 | + return $lsx_projects->output($atts); |
|
| 34 | 34 | } |
| 35 | -add_shortcode( 'lsx_projects', 'lsx_projects_shortcode' ); |
|
| 35 | +add_shortcode('lsx_projects', 'lsx_projects_shortcode'); |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Wraps the output class in a function to be called in templates |
| 39 | 39 | */ |
| 40 | 40 | function lsx_groups_list() { |
| 41 | - do_action( 'lsx_groups_list' ); |
|
| 41 | + do_action('lsx_groups_list'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function lsx_child_group_list() { |
| 45 | - do_action( 'lsx_child_group_list' ); |
|
| 45 | + do_action('lsx_child_group_list'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | function lsx_projects_list() { |
| 49 | - do_action( 'lsx_projects_list' ); |
|
| 49 | + do_action('lsx_projects_list'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function lsx_projects_sidebar() { |
| 53 | - do_action( 'lsx_projects_sidebar' ); |
|
| 53 | + do_action('lsx_projects_sidebar'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function lsx_projects_single_tag() { |
| 57 | - do_action( 'lsx_projects_single_tag' ); |
|
| 57 | + do_action('lsx_projects_single_tag'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -66,19 +66,19 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | function projects_get_options() { |
| 68 | 68 | $options = array(); |
| 69 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 70 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 69 | + if (function_exists('tour_operator')) { |
|
| 70 | + $options = get_option('_lsx-to_settings', false); |
|
| 71 | 71 | } else { |
| 72 | - $options = get_option( '_lsx_settings', false ); |
|
| 72 | + $options = get_option('_lsx_settings', false); |
|
| 73 | 73 | |
| 74 | - if ( false === $options ) { |
|
| 75 | - $options = get_option( '_lsx_lsx-settings', false ); |
|
| 74 | + if (false === $options) { |
|
| 75 | + $options = get_option('_lsx_lsx-settings', false); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // If there are new CMB2 options available, then use those. |
| 80 | - $new_options = get_option( 'lsx_projects_options', false ); |
|
| 81 | - if ( false !== $new_options ) { |
|
| 80 | + $new_options = get_option('lsx_projects_options', false); |
|
| 81 | + if (false !== $new_options) { |
|
| 82 | 82 | $options['display'] = $new_options; |
| 83 | 83 | } |
| 84 | 84 | return $options; |
@@ -91,27 +91,27 @@ discard block |
||
| 91 | 91 | * @param mixed $default Optional default value |
| 92 | 92 | * @return mixed Option value |
| 93 | 93 | */ |
| 94 | -function projects_get_option( $key = '', $default = false ) { |
|
| 94 | +function projects_get_option($key = '', $default = false) { |
|
| 95 | 95 | $options = array(); |
| 96 | 96 | $value = $default; |
| 97 | - if ( function_exists( 'tour_operator' ) ) { |
|
| 98 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 97 | + if (function_exists('tour_operator')) { |
|
| 98 | + $options = get_option('_lsx-to_settings', false); |
|
| 99 | 99 | } else { |
| 100 | - $options = get_option( '_lsx_settings', false ); |
|
| 100 | + $options = get_option('_lsx_settings', false); |
|
| 101 | 101 | |
| 102 | - if ( false === $options ) { |
|
| 103 | - $options = get_option( '_lsx_lsx-settings', false ); |
|
| 102 | + if (false === $options) { |
|
| 103 | + $options = get_option('_lsx_lsx-settings', false); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // If there are new CMB2 options available, then use those. |
| 108 | - $new_options = get_option( 'lsx_projects_options', false ); |
|
| 109 | - if ( false !== $new_options ) { |
|
| 108 | + $new_options = get_option('lsx_projects_options', false); |
|
| 109 | + if (false !== $new_options) { |
|
| 110 | 110 | $options['display'] = $new_options; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if ( isset( $options['display'] ) && isset( $options['display'][ $key ] ) ) { |
|
| 114 | - $value = $options['display'][ $key ]; |
|
| 113 | + if (isset($options['display']) && isset($options['display'][$key])) { |
|
| 114 | + $value = $options['display'][$key]; |
|
| 115 | 115 | } |
| 116 | 116 | return $value; |
| 117 | 117 | } |
@@ -9,53 +9,53 @@ |
||
| 9 | 9 | |
| 10 | 10 | $groups = ''; |
| 11 | 11 | $groups_class = ''; |
| 12 | - $terms = get_the_terms( get_the_ID(), 'project-group' ); |
|
| 12 | + $terms = get_the_terms(get_the_ID(), 'project-group'); |
|
| 13 | 13 | |
| 14 | - if ( $terms && ! is_wp_error( $terms ) ) { |
|
| 14 | + if ($terms && ! is_wp_error($terms)) { |
|
| 15 | 15 | $groups = array(); |
| 16 | 16 | $groups_class = array(); |
| 17 | 17 | |
| 18 | - foreach ( $terms as $term ) { |
|
| 19 | - $groups[] = '<a href="' . get_term_link( $term ) . '">' . $term->name . '</a>'; |
|
| 18 | + foreach ($terms as $term) { |
|
| 19 | + $groups[] = '<a href="' . get_term_link($term) . '">' . $term->name . '</a>'; |
|
| 20 | 20 | $groups_class[] = 'filter-' . $term->slug; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - $groups = join( ', ', $groups ); |
|
| 24 | - $groups_class = join( ' ', $groups_class ); |
|
| 23 | + $groups = join(', ', $groups); |
|
| 24 | + $groups_class = join(' ', $groups_class); |
|
| 25 | 25 | } |
| 26 | 26 | ?> |
| 27 | 27 | |
| 28 | -<div class="col-xs-12 col-sm-6 col-md-4 lsx-projects-column <?php echo esc_attr( $groups_class ); ?>"> |
|
| 28 | +<div class="col-xs-12 col-sm-6 col-md-4 lsx-projects-column <?php echo esc_attr($groups_class); ?>"> |
|
| 29 | 29 | <article class="lsx-projects-slot"> |
| 30 | - <?php if ( ! empty( lsx_get_thumbnail( 'lsx-thumbnail-single' ) ) ) : ?> |
|
| 31 | - <?php if ( ! isset( $lsx_projects_frontend->options['display'] ) || ! isset( $lsx_projects_frontend->options['display']['team_disable_single'] ) ) : ?> |
|
| 32 | - <a href="<?php the_permalink(); ?>"><figure class="lsx-projects-avatar"><?php lsx_thumbnail( 'lsx-thumbnail-single' ); ?></figure></a> |
|
| 30 | + <?php if ( ! empty(lsx_get_thumbnail('lsx-thumbnail-single'))) : ?> |
|
| 31 | + <?php if ( ! isset($lsx_projects_frontend->options['display']) || ! isset($lsx_projects_frontend->options['display']['team_disable_single'])) : ?> |
|
| 32 | + <a href="<?php the_permalink(); ?>"><figure class="lsx-projects-avatar"><?php lsx_thumbnail('lsx-thumbnail-single'); ?></figure></a> |
|
| 33 | 33 | <?php else : ?> |
| 34 | - <figure class="lsx-projects-avatar"><?php lsx_thumbnail( 'lsx-thumbnail-single' ); ?></figure> |
|
| 34 | + <figure class="lsx-projects-avatar"><?php lsx_thumbnail('lsx-thumbnail-single'); ?></figure> |
|
| 35 | 35 | <?php endif; ?> |
| 36 | 36 | <?php endif; ?> |
| 37 | 37 | |
| 38 | 38 | <?php |
| 39 | - if ( empty( lsx_get_thumbnail( 'lsx-thumbnail-single' ) ) ) { |
|
| 40 | - if ( ! empty( projects_get_option( 'projects_placeholder' ) ) ) { |
|
| 41 | - echo wp_kses_post( '<img src="' . projects_get_option( 'projects_placeholder' ) . '" width="auto" alt="placeholder" />' ); |
|
| 39 | + if (empty(lsx_get_thumbnail('lsx-thumbnail-single'))) { |
|
| 40 | + if ( ! empty(projects_get_option('projects_placeholder'))) { |
|
| 41 | + echo wp_kses_post('<img src="' . projects_get_option('projects_placeholder') . '" width="auto" alt="placeholder" />'); |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | ?> |
| 45 | 45 | |
| 46 | 46 | <h5 class="lsx-projects-title"> |
| 47 | - <?php if ( ! isset( $lsx_projects_frontend->options['display'] ) || ! isset( $lsx_projects_frontend->options['display']['team_disable_single'] ) ) : ?> |
|
| 47 | + <?php if ( ! isset($lsx_projects_frontend->options['display']) || ! isset($lsx_projects_frontend->options['display']['team_disable_single'])) : ?> |
|
| 48 | 48 | <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> |
| 49 | 49 | <?php else : ?> |
| 50 | 50 | <?php the_title(); ?> |
| 51 | 51 | <?php endif; ?> |
| 52 | 52 | </h5> |
| 53 | 53 | |
| 54 | - <?php if ( ! empty( $groups ) ) : ?> |
|
| 55 | - <p class="lsx-projects-groups"><?php echo wp_kses_post( $groups ); ?></p> |
|
| 54 | + <?php if ( ! empty($groups)) : ?> |
|
| 55 | + <p class="lsx-projects-groups"><?php echo wp_kses_post($groups); ?></p> |
|
| 56 | 56 | <?php endif; ?> |
| 57 | 57 | |
| 58 | 58 | <!--<div class="lsx-projects-content"><?php the_excerpt(); ?></div>--> |
| 59 | - <div class="lsx-projects-content"><a href="<?php the_permalink(); ?>" class="moretag"><?php esc_html_e( 'View more', 'lsx-projects' ); ?></a></div> |
|
| 59 | + <div class="lsx-projects-content"><a href="<?php the_permalink(); ?>" class="moretag"><?php esc_html_e('View more', 'lsx-projects'); ?></a></div> |
|
| 60 | 60 | </article> |
| 61 | 61 | </div> |
@@ -5,41 +5,41 @@ discard block |
||
| 5 | 5 | ?> |
| 6 | 6 | |
| 7 | 7 | <?php |
| 8 | - $client = get_post_meta( get_the_ID(), 'lsx_project_client', true ); |
|
| 9 | - $client_logo = get_post_meta( get_the_ID(), 'lsx_project_client_logo', true ); |
|
| 10 | - $url = get_post_meta( get_the_ID(), 'lsx_project_url', true ); |
|
| 8 | + $client = get_post_meta(get_the_ID(), 'lsx_project_client', true); |
|
| 9 | + $client_logo = get_post_meta(get_the_ID(), 'lsx_project_client_logo', true); |
|
| 10 | + $url = get_post_meta(get_the_ID(), 'lsx_project_url', true); |
|
| 11 | 11 | |
| 12 | 12 | global $lsx_projects; |
| 13 | 13 | |
| 14 | 14 | $button_label = ''; |
| 15 | 15 | $button_cf_id = ''; |
| 16 | 16 | |
| 17 | - if ( ! empty( projects_get_option( 'projects_modal_enable' ) ) ) { |
|
| 18 | - if ( ! empty( projects_get_option( 'projects_modal_cta_label' ) ) && ! empty( projects_get_option( 'projects_modal_form_id' ) ) ) { |
|
| 19 | - $button_label = projects_get_option( 'projects_modal_cta_label' ); |
|
| 20 | - $button_cf_id = projects_get_option( 'projects_modal_form_id' ); |
|
| 17 | + if ( ! empty(projects_get_option('projects_modal_enable'))) { |
|
| 18 | + if ( ! empty(projects_get_option('projects_modal_cta_label')) && ! empty(projects_get_option('projects_modal_form_id'))) { |
|
| 19 | + $button_label = projects_get_option('projects_modal_cta_label'); |
|
| 20 | + $button_cf_id = projects_get_option('projects_modal_form_id'); |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - if ( ! empty( $client_logo ) ) { |
|
| 25 | - $client_logo = wp_get_attachment_image_src( $client_logo, 'full' ); |
|
| 24 | + if ( ! empty($client_logo)) { |
|
| 25 | + $client_logo = wp_get_attachment_image_src($client_logo, 'full'); |
|
| 26 | 26 | |
| 27 | - if ( is_array( $client_logo ) ) { |
|
| 27 | + if (is_array($client_logo)) { |
|
| 28 | 28 | $client_logo = '<img src="' . $client_logo[0] . '">'; |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $groups = ''; |
| 33 | - $terms = get_the_terms( get_the_ID(), 'project-group' ); |
|
| 33 | + $terms = get_the_terms(get_the_ID(), 'project-group'); |
|
| 34 | 34 | |
| 35 | - if ( $terms && ! is_wp_error( $terms ) ) { |
|
| 35 | + if ($terms && ! is_wp_error($terms)) { |
|
| 36 | 36 | $groups = array(); |
| 37 | 37 | |
| 38 | - foreach ( $terms as $term ) { |
|
| 39 | - $groups[] = '<a href="' . get_term_link( $term ) . '">' . $term->name . '</a>'; |
|
| 38 | + foreach ($terms as $term) { |
|
| 39 | + $groups[] = '<a href="' . get_term_link($term) . '">' . $term->name . '</a>'; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $groups = join( ', ', $groups ); |
|
| 42 | + $groups = join(', ', $groups); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Connections |
@@ -48,22 +48,22 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // Connection Projects |
| 50 | 50 | |
| 51 | - if ( $terms && ! is_wp_error( $terms ) ) { |
|
| 51 | + if ($terms && ! is_wp_error($terms)) { |
|
| 52 | 52 | $groups_ = array(); |
| 53 | 53 | |
| 54 | - foreach ( $terms as $term ) { |
|
| 54 | + foreach ($terms as $term) { |
|
| 55 | 55 | $groups_[] = $term->term_id; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( count( $groups_ ) > 0 ) { |
|
| 58 | + if (count($groups_) > 0) { |
|
| 59 | 59 | $connection_project['post_type'] = 'project'; |
| 60 | - $connection_project['title'] = esc_html__( 'Related Projects', 'lsx-projects' ); |
|
| 60 | + $connection_project['title'] = esc_html__('Related Projects', 'lsx-projects'); |
|
| 61 | 61 | //$connection_project['posts'] = get_post_meta( get_the_ID(), 'project_to_project', false ); |
| 62 | 62 | $connection_project['posts'] = array(); |
| 63 | 63 | |
| 64 | 64 | $args = array( |
| 65 | 65 | 'post_type' => 'project', |
| 66 | - 'post__not_in' => array( get_the_ID() ), |
|
| 66 | + 'post__not_in' => array(get_the_ID()), |
|
| 67 | 67 | 'no_found_rows' => true, |
| 68 | 68 | 'ignore_sticky_posts' => 1, |
| 69 | 69 | 'update_post_meta_cache' => false, |
@@ -75,18 +75,18 @@ discard block |
||
| 75 | 75 | ), |
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | - $projects_ = new \WP_Query( $args ); |
|
| 78 | + $projects_ = new \WP_Query($args); |
|
| 79 | 79 | |
| 80 | - if ( $projects_->have_posts() ) { |
|
| 81 | - while ( $projects_->have_posts() ) { |
|
| 80 | + if ($projects_->have_posts()) { |
|
| 81 | + while ($projects_->have_posts()) { |
|
| 82 | 82 | $projects_->the_post(); |
| 83 | 83 | $connection_project['posts'][] = get_the_ID(); |
| 84 | 84 | wp_reset_postdata(); |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if ( ! empty( $connection_project['posts'] ) ) { |
|
| 89 | - $post_ids = join( ',', $connection_project['posts'] ); |
|
| 88 | + if ( ! empty($connection_project['posts'])) { |
|
| 89 | + $post_ids = join(',', $connection_project['posts']); |
|
| 90 | 90 | $connection_project['shortcode'] = '[lsx_projects columns="3" include="' . $post_ids . '"]'; |
| 91 | 91 | $connections[] = $connection_project; |
| 92 | 92 | } |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // Connection Products |
| 97 | 97 | |
| 98 | - if ( class_exists( 'WooCommerce' ) ) { |
|
| 98 | + if (class_exists('WooCommerce')) { |
|
| 99 | 99 | $connection_product['post_type'] = 'product'; |
| 100 | - $connection_product['title'] = esc_html__( 'Related Products', 'lsx-projects' ) . ' <small>' . esc_html__( 'Products used to build this project', 'lsx-projects' ) . '</small>'; |
|
| 101 | - $connection_product['posts'] = get_post_meta( get_the_ID(), 'product_to_project', false ); |
|
| 100 | + $connection_product['title'] = esc_html__('Related Products', 'lsx-projects') . ' <small>' . esc_html__('Products used to build this project', 'lsx-projects') . '</small>'; |
|
| 101 | + $connection_product['posts'] = get_post_meta(get_the_ID(), 'product_to_project', false); |
|
| 102 | 102 | |
| 103 | - if ( ! empty( $connection_product['posts'] ) ) { |
|
| 103 | + if ( ! empty($connection_product['posts'])) { |
|
| 104 | 104 | $connection_product['small_list_html'] = ''; |
| 105 | 105 | |
| 106 | 106 | $args = array( |
@@ -113,19 +113,19 @@ discard block |
||
| 113 | 113 | 'update_post_meta_cache' => false, |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | - $connection_product['posts_obj'] = new \WP_Query( $args ); |
|
| 116 | + $connection_product['posts_obj'] = new \WP_Query($args); |
|
| 117 | 117 | |
| 118 | - if ( $connection_product['posts_obj']->have_posts() ) { |
|
| 118 | + if ($connection_product['posts_obj']->have_posts()) { |
|
| 119 | 119 | $connection_product['small_list_html'] = array(); |
| 120 | 120 | |
| 121 | - while ( $connection_product['posts_obj']->have_posts() ) { |
|
| 121 | + while ($connection_product['posts_obj']->have_posts()) { |
|
| 122 | 122 | $connection_product['posts_obj']->the_post(); |
| 123 | - $connection_product['small_list_html'][] = '<a href="' . get_permalink() . '">' . the_title( '', '', false ) . '</a>'; |
|
| 123 | + $connection_product['small_list_html'][] = '<a href="' . get_permalink() . '">' . the_title('', '', false) . '</a>'; |
|
| 124 | 124 | wp_reset_postdata(); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $connection_product['posts_obj']->rewind_posts(); |
| 128 | - $connection_product['small_list_html'] = join( ', ', $connection_product['small_list_html'] ); |
|
| 128 | + $connection_product['small_list_html'] = join(', ', $connection_product['small_list_html']); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $connections[] = $connection_product; |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | $connection_service['post_type'] = 'page'; |
| 138 | 138 | // $connection_service['title'] = esc_html__( 'Services', 'lsx-projects' ); |
| 139 | - $connection_service['pages'] = get_post_meta( get_the_ID(), 'page_to_project', false ); |
|
| 139 | + $connection_service['pages'] = get_post_meta(get_the_ID(), 'page_to_project', false); |
|
| 140 | 140 | |
| 141 | - if ( ! empty( $connection_service['pages'] ) ) { |
|
| 142 | - $post_ids = join( ',', $connection_service['pages'] ); |
|
| 141 | + if ( ! empty($connection_service['pages'])) { |
|
| 142 | + $post_ids = join(',', $connection_service['pages']); |
|
| 143 | 143 | //$connection_service['shortcode'] = '[lsx_services columns="3" include="' . $post_ids . '"]'; |
| 144 | 144 | $connection_service['small_list_html'] = ''; |
| 145 | 145 | |
@@ -153,18 +153,18 @@ discard block |
||
| 153 | 153 | 'update_post_meta_cache' => false, |
| 154 | 154 | ); |
| 155 | 155 | |
| 156 | - $services_ = new \WP_Query( $args ); |
|
| 156 | + $services_ = new \WP_Query($args); |
|
| 157 | 157 | |
| 158 | - if ( $services_->have_posts() ) { |
|
| 158 | + if ($services_->have_posts()) { |
|
| 159 | 159 | $connection_service['small_list_html'] = array(); |
| 160 | 160 | |
| 161 | - while ( $services_->have_posts() ) { |
|
| 161 | + while ($services_->have_posts()) { |
|
| 162 | 162 | $services_->the_post(); |
| 163 | - $connection_service['small_list_html'][] = '<a href="' . get_permalink() . '">' . the_title( '', '', false ) . '</a>'; |
|
| 163 | + $connection_service['small_list_html'][] = '<a href="' . get_permalink() . '">' . the_title('', '', false) . '</a>'; |
|
| 164 | 164 | wp_reset_postdata(); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $connection_service['small_list_html'] = join( ', ', $connection_service['small_list_html'] ); |
|
| 167 | + $connection_service['small_list_html'] = join(', ', $connection_service['small_list_html']); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $connections[] = $connection_service; |
@@ -174,10 +174,10 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $connection_testimonial['post_type'] = 'testimonial'; |
| 176 | 176 | // $connection_testimonial['title'] = esc_html__( 'Testimonials', 'lsx-projects' ); |
| 177 | - $connection_testimonial['posts'] = get_post_meta( get_the_ID(), 'testimonial_to_project', false ); |
|
| 177 | + $connection_testimonial['posts'] = get_post_meta(get_the_ID(), 'testimonial_to_project', false); |
|
| 178 | 178 | |
| 179 | - if ( ! empty( $connection_testimonial['posts'] ) ) { |
|
| 180 | - $post_ids = join( ',', $connection_testimonial['posts'] ); |
|
| 179 | + if ( ! empty($connection_testimonial['posts'])) { |
|
| 180 | + $post_ids = join(',', $connection_testimonial['posts']); |
|
| 181 | 181 | $connection_testimonial['shortcode'] = '[lsx_testimonials columns="1" include="' . $post_ids . '" orderby="date" order="DESC"]'; |
| 182 | 182 | $connections[] = $connection_testimonial; |
| 183 | 183 | } |
@@ -186,10 +186,10 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $connection_team['post_type'] = 'team'; |
| 188 | 188 | // $connection_team['title'] = esc_html__( 'Team', 'lsx-projects' ); |
| 189 | - $connection_team['posts'] = get_post_meta( get_the_ID(), 'team_to_project', false ); |
|
| 189 | + $connection_team['posts'] = get_post_meta(get_the_ID(), 'team_to_project', false); |
|
| 190 | 190 | |
| 191 | - if ( ! empty( $connection_team['posts'] ) ) { |
|
| 192 | - $post_ids = join( ',', $connection_team['posts'] ); |
|
| 191 | + if ( ! empty($connection_team['posts'])) { |
|
| 192 | + $post_ids = join(',', $connection_team['posts']); |
|
| 193 | 193 | $connection_team['shortcode'] = '[lsx_team columns="4" include="' . $post_ids . '" show_social="false" show_desc="false" show_link="true"]'; |
| 194 | 194 | $connection_team['small_list_html'] = ''; |
| 195 | 195 | |
@@ -203,19 +203,19 @@ discard block |
||
| 203 | 203 | 'update_post_meta_cache' => false, |
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | - $team_ = new \WP_Query( $args ); |
|
| 206 | + $team_ = new \WP_Query($args); |
|
| 207 | 207 | |
| 208 | - if ( $team_->have_posts() ) { |
|
| 208 | + if ($team_->have_posts()) { |
|
| 209 | 209 | global $lsx_team; |
| 210 | 210 | $connection_team['small_list_html'] = array(); |
| 211 | 211 | |
| 212 | - while ( $team_->have_posts() ) { |
|
| 212 | + while ($team_->have_posts()) { |
|
| 213 | 213 | $team_->the_post(); |
| 214 | - $connection_team['small_list_html'][] = '<a href="' . get_permalink() . '">' . $lsx_team->get_thumbnail( get_the_ID(), 'lsx-team-archive' ) . '</a>'; |
|
| 214 | + $connection_team['small_list_html'][] = '<a href="' . get_permalink() . '">' . $lsx_team->get_thumbnail(get_the_ID(), 'lsx-team-archive') . '</a>'; |
|
| 215 | 215 | wp_reset_postdata(); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - $connection_team['small_list_html'] = join( ' ', $connection_team['small_list_html'] ); |
|
| 218 | + $connection_team['small_list_html'] = join(' ', $connection_team['small_list_html']); |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | $connections[] = $connection_team; |
@@ -232,12 +232,12 @@ discard block |
||
| 232 | 232 | <div class="col-xs-12 col-sm-7 col-md-8"> |
| 233 | 233 | <div class="entry-content"><?php the_content(); ?></div> |
| 234 | 234 | |
| 235 | - <?php if ( count( $connections ) > 0 ) : ?> |
|
| 236 | - <?php foreach ( $connections as $i => $connection ) : ?> |
|
| 235 | + <?php if (count($connections) > 0) : ?> |
|
| 236 | + <?php foreach ($connections as $i => $connection) : ?> |
|
| 237 | 237 | <?php |
| 238 | - if ( 'testimonial' === $connection['post_type'] ) { |
|
| 238 | + if ('testimonial' === $connection['post_type']) { |
|
| 239 | 239 | echo '<div class="tab-pane-fake">'; |
| 240 | - echo do_shortcode( $connection['shortcode'] ); |
|
| 240 | + echo do_shortcode($connection['shortcode']); |
|
| 241 | 241 | echo '</div>'; |
| 242 | 242 | } |
| 243 | 243 | ?> |
@@ -248,83 +248,83 @@ discard block |
||
| 248 | 248 | <div class="col-xs-12 col-sm-5 col-md-4"> |
| 249 | 249 | <div class="entry-fixed-sidebar-wrapper"> |
| 250 | 250 | <div class="entry-fixed-sidebar"> |
| 251 | - <?php if ( ! empty( $client_logo ) ) : ?> |
|
| 252 | - <div class="entry-meta-single"><?php echo wp_kses_post( $client_logo ); ?></div> |
|
| 253 | - <?php elseif ( ! empty( $client ) ) : ?> |
|
| 254 | - <div class="entry-meta-single"><?php echo esc_html( $client ); ?></div> |
|
| 251 | + <?php if ( ! empty($client_logo)) : ?> |
|
| 252 | + <div class="entry-meta-single"><?php echo wp_kses_post($client_logo); ?></div> |
|
| 253 | + <?php elseif ( ! empty($client)) : ?> |
|
| 254 | + <div class="entry-meta-single"><?php echo esc_html($client); ?></div> |
|
| 255 | 255 | <?php endif; ?> |
| 256 | 256 | |
| 257 | - <?php if ( ! empty( $groups ) ) : ?> |
|
| 258 | - <div class="entry-meta-key"><?php esc_html_e( 'Industry:', 'lsx-projects' ); ?></div> |
|
| 259 | - <div class="entry-meta-value"><?php echo wp_kses_post( $groups ); ?></div> |
|
| 257 | + <?php if ( ! empty($groups)) : ?> |
|
| 258 | + <div class="entry-meta-key"><?php esc_html_e('Industry:', 'lsx-projects'); ?></div> |
|
| 259 | + <div class="entry-meta-value"><?php echo wp_kses_post($groups); ?></div> |
|
| 260 | 260 | <?php endif; ?> |
| 261 | 261 | |
| 262 | - <?php if ( ! empty( $connection_service['small_list_html'] ) ) : ?> |
|
| 263 | - <div class="entry-meta-key"><?php esc_html_e( 'Services:', 'lsx-projects' ); ?></div> |
|
| 264 | - <div class="entry-meta-value"><?php echo wp_kses_post( $connection_service['small_list_html'] ); ?></div> |
|
| 262 | + <?php if ( ! empty($connection_service['small_list_html'])) : ?> |
|
| 263 | + <div class="entry-meta-key"><?php esc_html_e('Services:', 'lsx-projects'); ?></div> |
|
| 264 | + <div class="entry-meta-value"><?php echo wp_kses_post($connection_service['small_list_html']); ?></div> |
|
| 265 | 265 | <?php endif; ?> |
| 266 | 266 | |
| 267 | - <?php if ( ! empty( $connection_product['small_list_html'] ) ) : ?> |
|
| 267 | + <?php if ( ! empty($connection_product['small_list_html'])) : ?> |
|
| 268 | 268 | <!-- |
| 269 | - <div class="entry-meta-key"><?php esc_html_e( 'Products used:', 'lsx-projects' ); ?></div> |
|
| 270 | - <div class="entry-meta-value"><?php echo wp_kses_post( $connection_product['small_list_html'] ); ?></div> |
|
| 269 | + <div class="entry-meta-key"><?php esc_html_e('Products used:', 'lsx-projects'); ?></div> |
|
| 270 | + <div class="entry-meta-value"><?php echo wp_kses_post($connection_product['small_list_html']); ?></div> |
|
| 271 | 271 | --> |
| 272 | 272 | <?php endif; ?> |
| 273 | 273 | |
| 274 | - <?php if ( ! empty( $connection_team['small_list_html'] ) ) : ?> |
|
| 275 | - <div class="entry-meta-key"><?php esc_html_e( 'Team members involved:', 'lsx-projects' ); ?></div> |
|
| 276 | - <div class="entry-meta-value entry-meta-value-team"><?php echo wp_kses_post( $connection_team['small_list_html'] ); ?></div> |
|
| 274 | + <?php if ( ! empty($connection_team['small_list_html'])) : ?> |
|
| 275 | + <div class="entry-meta-key"><?php esc_html_e('Team members involved:', 'lsx-projects'); ?></div> |
|
| 276 | + <div class="entry-meta-value entry-meta-value-team"><?php echo wp_kses_post($connection_team['small_list_html']); ?></div> |
|
| 277 | 277 | <?php endif; ?> |
| 278 | 278 | |
| 279 | - <?php if ( ! empty( $url ) ) : ?> |
|
| 280 | - <div class="entry-meta-single"><a href="<?php echo esc_url( $url ); ?>" target="_blank" rel="nofollow" class="btn btn-block secondary-btn"><?php esc_html_e( 'See website', 'lsx-projects' ); ?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></div> |
|
| 279 | + <?php if ( ! empty($url)) : ?> |
|
| 280 | + <div class="entry-meta-single"><a href="<?php echo esc_url($url); ?>" target="_blank" rel="nofollow" class="btn btn-block secondary-btn"><?php esc_html_e('See website', 'lsx-projects'); ?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></div> |
|
| 281 | 281 | <?php endif; ?> |
| 282 | 282 | |
| 283 | - <?php if ( ! empty( $button_label ) ) : ?> |
|
| 284 | - <div class="entry-meta-single"><a href="#lsx-project-contact" data-toggle="modal" class="btn btn-block cta-btn"><?php echo esc_html( $button_label ); ?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></div> |
|
| 283 | + <?php if ( ! empty($button_label)) : ?> |
|
| 284 | + <div class="entry-meta-single"><a href="#lsx-project-contact" data-toggle="modal" class="btn btn-block cta-btn"><?php echo esc_html($button_label); ?> <i class="fa fa-angle-right" aria-hidden="true"></i></a></div> |
|
| 285 | 285 | <?php endif; ?> |
| 286 | 286 | </div> |
| 287 | 287 | </div> |
| 288 | 288 | </div> |
| 289 | 289 | </div> |
| 290 | 290 | |
| 291 | - <?php if ( count( $connections ) > 0 ) : ?> |
|
| 292 | - <?php foreach ( $connections as $i => $connection ) : ?> |
|
| 291 | + <?php if (count($connections) > 0) : ?> |
|
| 292 | + <?php foreach ($connections as $i => $connection) : ?> |
|
| 293 | 293 | <?php |
| 294 | 294 | // Team is now visible on detail box |
| 295 | 295 | // Services is now visible on detail box |
| 296 | 296 | // Testimonials is now visible below the content |
| 297 | - if ( in_array( $connection['post_type'], array( 'team', 'testimonial', 'service' ) ) ) { |
|
| 297 | + if (in_array($connection['post_type'], array('team', 'testimonial', 'service'))) { |
|
| 298 | 298 | continue; |
| 299 | 299 | } |
| 300 | 300 | ?> |
| 301 | - <?php if ( 'page' !== $connection['post_type'] ) { ?> |
|
| 301 | + <?php if ('page' !== $connection['post_type']) { ?> |
|
| 302 | 302 | <div class="lsx-projects-section lsx-full-width"> |
| 303 | 303 | <div class="row"> |
| 304 | 304 | <div class="col-xs-12"> |
| 305 | - <h3 class="lsx-title"><?php echo wp_kses_post( $connection['title'] ); ?></h3> |
|
| 305 | + <h3 class="lsx-title"><?php echo wp_kses_post($connection['title']); ?></h3> |
|
| 306 | 306 | |
| 307 | 307 | <?php |
| 308 | - if ( 'product' === $connection['post_type'] ) { |
|
| 309 | - if ( $connection_product['posts_obj']->have_posts() ) { |
|
| 308 | + if ('product' === $connection['post_type']) { |
|
| 309 | + if ($connection_product['posts_obj']->have_posts()) { |
|
| 310 | 310 | // @codingStandardsIgnoreLine |
| 311 | - echo apply_filters( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' ); |
|
| 311 | + echo apply_filters('woocommerce_before_widget_product_list', '<ul class="product_list_widget">'); |
|
| 312 | 312 | |
| 313 | - while ( $connection_product['posts_obj']->have_posts() ) { |
|
| 313 | + while ($connection_product['posts_obj']->have_posts()) { |
|
| 314 | 314 | $connection_product['posts_obj']->the_post(); |
| 315 | 315 | |
| 316 | - wc_get_template( 'content-widget-product.php', array( |
|
| 316 | + wc_get_template('content-widget-product.php', array( |
|
| 317 | 317 | 'show_rating' => false, |
| 318 | - ) ); |
|
| 318 | + )); |
|
| 319 | 319 | |
| 320 | 320 | wp_reset_postdata(); |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | // @codingStandardsIgnoreLine |
| 324 | - echo apply_filters( 'woocommerce_after_widget_product_list', '</ul>' ); |
|
| 324 | + echo apply_filters('woocommerce_after_widget_product_list', '</ul>'); |
|
| 325 | 325 | } |
| 326 | 326 | } else { |
| 327 | - echo do_shortcode( $connection['shortcode'] ); |
|
| 327 | + echo do_shortcode($connection['shortcode']); |
|
| 328 | 328 | } |
| 329 | 329 | ?> |
| 330 | 330 | </div> |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * Contructor |
| 30 | 30 | */ |
| 31 | 31 | public function __construct() { |
| 32 | - add_action( 'init', array( $this, 'cmb2_post_search_ajax' ) ); |
|
| 32 | + add_action('init', array($this, 'cmb2_post_search_ajax')); |
|
| 33 | 33 | $this->load_vendors(); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public static function get_instance() { |
| 44 | 44 | |
| 45 | 45 | // If the single instance hasn't been set, set it now. |
| 46 | - if ( null === self::$instance ) { |
|
| 46 | + if (null === self::$instance) { |
|
| 47 | 47 | self::$instance = new self(); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | private function load_vendors() { |
| 58 | 58 | // Configure custom fields. |
| 59 | - if ( ! class_exists( 'CMB2' ) ) { |
|
| 59 | + if ( ! class_exists('CMB2')) { |
|
| 60 | 60 | require_once LSX_PROJECTS_PATH . 'vendor/CMB2/init.php'; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | * @return void |
| 68 | 68 | */ |
| 69 | 69 | public function get_post_types() { |
| 70 | - $post_types = apply_filters( 'lsx_projects_post_types', isset( $this->post_types ) ); |
|
| 71 | - foreach ( $post_types as $index => $post_type ) { |
|
| 72 | - $is_disabled = \cmb2_get_option( 'lsx_projects_options', $post_type . '_disabled', false ); |
|
| 73 | - if ( true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled ) { |
|
| 74 | - unset( $post_types[ $index ] ); |
|
| 70 | + $post_types = apply_filters('lsx_projects_post_types', isset($this->post_types)); |
|
| 71 | + foreach ($post_types as $index => $post_type) { |
|
| 72 | + $is_disabled = \cmb2_get_option('lsx_projects_options', $post_type . '_disabled', false); |
|
| 73 | + if (true === $is_disabled || 1 === $is_disabled || 'on' === $is_disabled) { |
|
| 74 | + unset($post_types[$index]); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | return $post_types; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function cmb2_post_search_ajax() { |
| 86 | 86 | require_once LSX_PROJECTS_PATH . 'vendor/lsx-field-post-search-ajax/cmb-field-post-search-ajax.php'; |
| 87 | - if ( method_exists( 'MAG_CMB2_Field_Post_Search_Ajax', 'get_instance' ) ) { |
|
| 87 | + if (method_exists('MAG_CMB2_Field_Post_Search_Ajax', 'get_instance')) { |
|
| 88 | 88 | $this->cmb2_post_search_ajax = \MAG_CMB2_Field_Post_Search_Ajax::get_instance(); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -13,14 +13,14 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | // If this file is called directly, abort. |
| 16 | -if ( ! defined( 'WPINC' ) ) { |
|
| 16 | +if ( ! defined('WPINC')) { |
|
| 17 | 17 | die; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -define( 'LSX_PROJECTS_PATH', plugin_dir_path( __FILE__ ) ); |
|
| 21 | -define( 'LSX_PROJECTS_CORE', __FILE__ ); |
|
| 22 | -define( 'LSX_PROJECTS_URL', plugin_dir_url( __FILE__ ) ); |
|
| 23 | -define( 'LSX_PROJECTS_VER', '1.2.0' ); |
|
| 20 | +define('LSX_PROJECTS_PATH', plugin_dir_path(__FILE__)); |
|
| 21 | +define('LSX_PROJECTS_CORE', __FILE__); |
|
| 22 | +define('LSX_PROJECTS_URL', plugin_dir_url(__FILE__)); |
|
| 23 | +define('LSX_PROJECTS_VER', '1.2.0'); |
|
| 24 | 24 | |
| 25 | 25 | /* ======================= Below is the Plugin Class init ========================= */ |
| 26 | 26 | |