| @@ -1,28 +1,28 @@ discard block | ||
| 1 | 1 | <div class="uix-field-wrapper"> | 
| 2 | 2 | |
| 3 | 3 | <ul class="ui-tab-nav"> | 
| 4 | -		<li><a href="#ui-general" class="active"><?php esc_html_e('General','to-reviews'); ?></a></li> | |
| 5 | -		<?php if(class_exists('LSX_TO_Search')) { ?> | |
| 6 | -			<li><a href="#ui-search"><?php esc_html_e('Search','to-reviews'); ?></a></li> | |
| 4 | +		<li><a href="#ui-general" class="active"><?php esc_html_e('General', 'to-reviews'); ?></a></li> | |
| 5 | +		<?php if (class_exists('LSX_TO_Search')) { ?> | |
| 6 | +			<li><a href="#ui-search"><?php esc_html_e('Search', 'to-reviews'); ?></a></li> | |
| 7 | 7 | <?php } ?> | 
| 8 | -		<li><a href="#ui-placeholders"><?php esc_html_e('Placeholders','to-reviews'); ?></a></li> | |
| 9 | -		<li><a href="#ui-archives"><?php esc_html_e('Archives','to-reviews'); ?></a></li> | |
| 10 | -		<li><a href="#ui-single"><?php esc_html_e('Single','to-reviews'); ?></a></li> | |
| 8 | +		<li><a href="#ui-placeholders"><?php esc_html_e('Placeholders', 'to-reviews'); ?></a></li> | |
| 9 | +		<li><a href="#ui-archives"><?php esc_html_e('Archives', 'to-reviews'); ?></a></li> | |
| 10 | +		<li><a href="#ui-single"><?php esc_html_e('Single', 'to-reviews'); ?></a></li> | |
| 11 | 11 | </ul> | 
| 12 | 12 | |
| 13 | 13 | <div id="ui-general" class="ui-tab active"> | 
| 14 | 14 | <table class="form-table"> | 
| 15 | 15 | <tbody> | 
| 16 | -			<?php do_action('lsx_to_framework_review_tab_content','review','general'); ?> | |
| 16 | +			<?php do_action('lsx_to_framework_review_tab_content', 'review', 'general'); ?> | |
| 17 | 17 | </tbody> | 
| 18 | 18 | </table> | 
| 19 | 19 | </div> | 
| 20 | 20 | |
| 21 | -	<?php if(class_exists('LSX_TO_Search')) { ?> | |
| 21 | +	<?php if (class_exists('LSX_TO_Search')) { ?> | |
| 22 | 22 | <div id="ui-search" class="ui-tab"> | 
| 23 | 23 | <table class="form-table"> | 
| 24 | 24 | <tbody> | 
| 25 | -				<?php do_action('lsx_to_framework_review_tab_content','review','search'); ?> | |
| 25 | +				<?php do_action('lsx_to_framework_review_tab_content', 'review', 'search'); ?> | |
| 26 | 26 | </tbody> | 
| 27 | 27 | </table> | 
| 28 | 28 | </div> | 
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 | <div id="ui-placeholders" class="ui-tab"> | 
| 32 | 32 | <table class="form-table"> | 
| 33 | 33 | <tbody> | 
| 34 | -			<?php do_action('lsx_to_framework_review_tab_content','review','placeholders'); ?> | |
| 34 | +			<?php do_action('lsx_to_framework_review_tab_content', 'review', 'placeholders'); ?> | |
| 35 | 35 | </tbody> | 
| 36 | 36 | </table> | 
| 37 | 37 | </div> | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | <div id="ui-archives" class="ui-tab"> | 
| 40 | 40 | <table class="form-table"> | 
| 41 | 41 | <tbody> | 
| 42 | -			<?php do_action('lsx_to_framework_review_tab_content','review','archives'); ?> | |
| 42 | +			<?php do_action('lsx_to_framework_review_tab_content', 'review', 'archives'); ?> | |
| 43 | 43 | </tbody> | 
| 44 | 44 | </table> | 
| 45 | 45 | </div> | 
| @@ -47,9 +47,9 @@ discard block | ||
| 47 | 47 | <div id="ui-single" class="ui-tab"> | 
| 48 | 48 | <table class="form-table"> | 
| 49 | 49 | <tbody> | 
| 50 | -			<?php do_action('lsx_to_framework_review_tab_content','review','single'); ?> | |
| 50 | +			<?php do_action('lsx_to_framework_review_tab_content', 'review', 'single'); ?> | |
| 51 | 51 | </tbody> | 
| 52 | 52 | </table> | 
| 53 | 53 | </div> | 
| 54 | -	<?php do_action('lsx_to_framework_review_tab_bottom','review'); ?> | |
| 54 | +	<?php do_action('lsx_to_framework_review_tab_bottom', 'review'); ?> | |
| 55 | 55 | </div> | 
| @@ -13,19 +13,19 @@ | ||
| 13 | 13 | 'class' => 'LSX_TO_Reviews', | 
| 14 | 14 | 'menu_icon' => 'dashicons-editor-ul', | 
| 15 | 15 | 'labels' => array( | 
| 16 | - 'name' => esc_html__( 'Reviews', 'to-reviews' ), | |
| 17 | - 'singular_name' => esc_html__( 'Review', 'to-reviews' ), | |
| 18 | - 'add_new' => esc_html__( 'Add New', 'to-reviews' ), | |
| 19 | - 'add_new_item' => esc_html__( 'Add New Review', 'to-reviews' ), | |
| 20 | - 'edit_item' => esc_html__( 'Edit Review', 'to-reviews' ), | |
| 21 | - 'new_item' => esc_html__( 'New Reviews', 'to-reviews' ), | |
| 22 | - 'all_items' => esc_html__( 'Reviews', 'to-reviews' ), | |
| 23 | - 'view_item' => esc_html__( 'View Review', 'to-reviews' ), | |
| 24 | - 'search_items' => esc_html__( 'Search Reviews', 'to-reviews' ), | |
| 25 | - 'not_found' => esc_html__( 'No reviews found', 'to-reviews' ), | |
| 26 | - 'not_found_in_trash' => esc_html__( 'No reviews found in Trash', 'to-reviews' ), | |
| 16 | +		'name'               => esc_html__('Reviews', 'to-reviews'), | |
| 17 | +		'singular_name'      => esc_html__('Review', 'to-reviews'), | |
| 18 | +		'add_new'            => esc_html__('Add New', 'to-reviews'), | |
| 19 | +		'add_new_item'       => esc_html__('Add New Review', 'to-reviews'), | |
| 20 | +		'edit_item'          => esc_html__('Edit Review', 'to-reviews'), | |
| 21 | +		'new_item'           => esc_html__('New Reviews', 'to-reviews'), | |
| 22 | +		'all_items'          => esc_html__('Reviews', 'to-reviews'), | |
| 23 | +		'view_item'          => esc_html__('View Review', 'to-reviews'), | |
| 24 | +		'search_items'       => esc_html__('Search Reviews', 'to-reviews'), | |
| 25 | +		'not_found'          => esc_html__('No reviews found', 'to-reviews'), | |
| 26 | +		'not_found_in_trash' => esc_html__('No reviews found in Trash', 'to-reviews'), | |
| 27 | 27 | 'parent_item_colon' => '', | 
| 28 | - 'menu_name' => esc_html__( 'Activities', 'to-reviews' ), | |
| 28 | +		'menu_name'          => esc_html__('Activities', 'to-reviews'), | |
| 29 | 29 | ), | 
| 30 | 30 | 'public' => true, | 
| 31 | 31 | 'publicly_queryable' => true, | 
| @@ -10,46 +10,46 @@ | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | $post_type = array( | 
| 13 | - 'class' => 'LSX_TO_Reviews', | |
| 14 | - 'menu_icon' => 'dashicons-editor-ul', | |
| 15 | - 'labels' => array( | |
| 16 | - 'name' => esc_html__( 'Reviews', 'to-reviews' ), | |
| 17 | - 'singular_name' => esc_html__( 'Review', 'to-reviews' ), | |
| 18 | - 'add_new' => esc_html__( 'Add New', 'to-reviews' ), | |
| 19 | - 'add_new_item' => esc_html__( 'Add New Review', 'to-reviews' ), | |
| 20 | - 'edit_item' => esc_html__( 'Edit Review', 'to-reviews' ), | |
| 21 | - 'new_item' => esc_html__( 'New Reviews', 'to-reviews' ), | |
| 22 | - 'all_items' => esc_html__( 'Reviews', 'to-reviews' ), | |
| 23 | - 'view_item' => esc_html__( 'View Review', 'to-reviews' ), | |
| 24 | - 'search_items' => esc_html__( 'Search Reviews', 'to-reviews' ), | |
| 25 | - 'not_found' => esc_html__( 'No reviews found', 'to-reviews' ), | |
| 26 | - 'not_found_in_trash' => esc_html__( 'No reviews found in Trash', 'to-reviews' ), | |
| 27 | - 'parent_item_colon' => '', | |
| 28 | - 'menu_name' => esc_html__( 'Activities', 'to-reviews' ), | |
| 29 | - ), | |
| 30 | - 'public' => true, | |
| 31 | - 'publicly_queryable' => true, | |
| 32 | - 'show_ui' => true, | |
| 33 | - 'show_in_menu' => 'tour-operator', | |
| 34 | - 'menu_position' => 60, | |
| 35 | - 'query_var' => true, | |
| 36 | - 'rewrite' => array( | |
| 37 | - 'slug' => 'review', | |
| 38 | - 'with_front' => false, | |
| 39 | - ), | |
| 40 | - 'exclude_from_search' => false, | |
| 41 | - 'capability_type' => 'post', | |
| 42 | - 'has_archive' => 'reviews', | |
| 43 | - 'hierarchical' => false, | |
| 44 | - 'show_in_rest' => true, | |
| 45 | - 'supports' => array( | |
| 46 | - 'title', | |
| 47 | - 'slug', | |
| 48 | - 'editor', | |
| 49 | - 'thumbnail', | |
| 50 | - 'excerpt', | |
| 51 | - 'custom-fields', | |
| 52 | - ), | |
| 13 | + 'class' => 'LSX_TO_Reviews', | |
| 14 | + 'menu_icon' => 'dashicons-editor-ul', | |
| 15 | + 'labels' => array( | |
| 16 | + 'name' => esc_html__( 'Reviews', 'to-reviews' ), | |
| 17 | + 'singular_name' => esc_html__( 'Review', 'to-reviews' ), | |
| 18 | + 'add_new' => esc_html__( 'Add New', 'to-reviews' ), | |
| 19 | + 'add_new_item' => esc_html__( 'Add New Review', 'to-reviews' ), | |
| 20 | + 'edit_item' => esc_html__( 'Edit Review', 'to-reviews' ), | |
| 21 | + 'new_item' => esc_html__( 'New Reviews', 'to-reviews' ), | |
| 22 | + 'all_items' => esc_html__( 'Reviews', 'to-reviews' ), | |
| 23 | + 'view_item' => esc_html__( 'View Review', 'to-reviews' ), | |
| 24 | + 'search_items' => esc_html__( 'Search Reviews', 'to-reviews' ), | |
| 25 | + 'not_found' => esc_html__( 'No reviews found', 'to-reviews' ), | |
| 26 | + 'not_found_in_trash' => esc_html__( 'No reviews found in Trash', 'to-reviews' ), | |
| 27 | + 'parent_item_colon' => '', | |
| 28 | + 'menu_name' => esc_html__( 'Activities', 'to-reviews' ), | |
| 29 | + ), | |
| 30 | + 'public' => true, | |
| 31 | + 'publicly_queryable' => true, | |
| 32 | + 'show_ui' => true, | |
| 33 | + 'show_in_menu' => 'tour-operator', | |
| 34 | + 'menu_position' => 60, | |
| 35 | + 'query_var' => true, | |
| 36 | + 'rewrite' => array( | |
| 37 | + 'slug' => 'review', | |
| 38 | + 'with_front' => false, | |
| 39 | + ), | |
| 40 | + 'exclude_from_search' => false, | |
| 41 | + 'capability_type' => 'post', | |
| 42 | + 'has_archive' => 'reviews', | |
| 43 | + 'hierarchical' => false, | |
| 44 | + 'show_in_rest' => true, | |
| 45 | + 'supports' => array( | |
| 46 | + 'title', | |
| 47 | + 'slug', | |
| 48 | + 'editor', | |
| 49 | + 'thumbnail', | |
| 50 | + 'excerpt', | |
| 51 | + 'custom-fields', | |
| 52 | + ), | |
| 53 | 53 | ); | 
| 54 | 54 | |
| 55 | 55 | return $post_type; | 
| @@ -13,7 +13,7 @@ discard block | ||
| 13 | 13 | * @subpackage template-tags | 
| 14 | 14 | * @category review | 
| 15 | 15 | */ | 
| 16 | -if ( ! function_exists( 'lsx_to_review_posts' ) ) { | |
| 16 | +if ( ! function_exists('lsx_to_review_posts')) { | |
| 17 | 17 |  	function lsx_to_review_posts() { | 
| 18 | 18 | global $lsx_to_archive; | 
| 19 | 19 | |
| @@ -21,11 +21,11 @@ discard block | ||
| 21 | 21 | 'from' => 'post', | 
| 22 | 22 | 'to' => 'review', | 
| 23 | 23 | 'column' => '3', | 
| 24 | - 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . esc_html__( 'Featured Posts', 'to-reviews' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', | |
| 24 | +			'before'	=> '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . esc_html__('Featured Posts', 'to-reviews') . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', | |
| 25 | 25 | 'after' => '</div></div></section>', | 
| 26 | 26 | ); | 
| 27 | 27 | |
| 28 | - lsx_to_connected_panel_query( $args ); | |
| 28 | + lsx_to_connected_panel_query($args); | |
| 29 | 29 | } | 
| 30 | 30 | } | 
| 31 | 31 | |
| @@ -36,8 +36,8 @@ discard block | ||
| 36 | 36 | * @subpackage template-tag | 
| 37 | 37 | * @category content | 
| 38 | 38 | */ | 
| 39 | -function lsx_to_review_content( $slug, $name = null ) { | |
| 40 | - do_action( 'lsx_to_review_content', $slug, $name ); | |
| 39 | +function lsx_to_review_content($slug, $name = null) { | |
| 40 | +	do_action('lsx_to_review_content', $slug, $name); | |
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | 43 | /* ================ REVIEWS =========================== */ | 
| @@ -53,8 +53,8 @@ discard block | ||
| 53 | 53 | * @subpackage template-tags | 
| 54 | 54 | * @category review | 
| 55 | 55 | */ | 
| 56 | -function lsx_to_review_rating( $before = '', $after = '', $echo = true ) { | |
| 57 | - lsx_to_custom_field_query( 'rating', $before, $after, $echo ); | |
| 56 | +function lsx_to_review_rating($before = '', $after = '', $echo = true) { | |
| 57 | +	lsx_to_custom_field_query('rating', $before, $after, $echo); | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | 60 | /** | 
| @@ -69,24 +69,24 @@ discard block | ||
| 69 | 69 | * @subpackage template-tags | 
| 70 | 70 | * @category review | 
| 71 | 71 | */ | 
| 72 | -function lsx_to_review_dates( $before = '', $after = '', $echo = true ) { | |
| 73 | - $valid_from = get_post_meta( get_the_ID(), 'date_of_visit_start', true ); | |
| 74 | - $valid_to = get_post_meta( get_the_ID(), 'date_of_visit_end', true ); | |
| 72 | +function lsx_to_review_dates($before = '', $after = '', $echo = true) { | |
| 73 | + $valid_from = get_post_meta(get_the_ID(), 'date_of_visit_start', true); | |
| 74 | + $valid_to = get_post_meta(get_the_ID(), 'date_of_visit_end', true); | |
| 75 | 75 | |
| 76 | -	if ( false !== $valid_from && '' !== $valid_from ) { | |
| 77 | - $valid_from = date( 'd M Y', strtotime( $valid_from ) ); | |
| 76 | +	if (false !== $valid_from && '' !== $valid_from) { | |
| 77 | +		$valid_from = date('d M Y', strtotime($valid_from)); | |
| 78 | 78 | } | 
| 79 | 79 | |
| 80 | -	if ( false !== $valid_to && '' !== $valid_to ) { | |
| 81 | - $valid_from .= ' - ' . date( 'd M Y', strtotime( $valid_to ) ); | |
| 80 | +	if (false !== $valid_to && '' !== $valid_to) { | |
| 81 | +		$valid_from .= ' - ' . date('d M Y', strtotime($valid_to)); | |
| 82 | 82 | } | 
| 83 | 83 | |
| 84 | -	if ( false !== $valid_from && '' !== $valid_from ) { | |
| 84 | +	if (false !== $valid_from && '' !== $valid_from) { | |
| 85 | 85 | $return = $before . $valid_from . $after; | 
| 86 | 86 | |
| 87 | -		if ( $echo ) { | |
| 87 | +		if ($echo) { | |
| 88 | 88 | echo $return; | 
| 89 | -		} else { | |
| 89 | +		}else { | |
| 90 | 90 | return $return; | 
| 91 | 91 | } | 
| 92 | 92 | } | 
| @@ -101,16 +101,16 @@ discard block | ||
| 101 | 101 |  function lsx_to_review_accommodation() { | 
| 102 | 102 | global $lsx_archive; | 
| 103 | 103 | |
| 104 | -	if ( post_type_exists( 'accommodation' ) && is_singular( 'review' ) ) { | |
| 104 | +	if (post_type_exists('accommodation') && is_singular('review')) { | |
| 105 | 105 | $args = array( | 
| 106 | 106 | 'from' => 'accommodation', | 
| 107 | 107 | 'to' => 'review', | 
| 108 | 108 | 'column' => '3', | 
| 109 | - 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'to-reviews' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', | |
| 109 | +			'before'	=> '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __(lsx_to_get_post_type_section_title('accommodation', '', 'Featured Accommodations'), 'to-reviews') . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', | |
| 110 | 110 | 'after' => '</div></div></section>', | 
| 111 | 111 | ); | 
| 112 | 112 | |
| 113 | - lsx_to_connected_panel_query( $args ); | |
| 113 | + lsx_to_connected_panel_query($args); | |
| 114 | 114 | } | 
| 115 | 115 | } | 
| 116 | 116 | |
| @@ -124,16 +124,16 @@ discard block | ||
| 124 | 124 |  function lsx_to_review_tour() { | 
| 125 | 125 | global $lsx_archive; | 
| 126 | 126 | |
| 127 | -	if ( post_type_exists( 'tour' ) && is_singular( 'review' ) ) { | |
| 127 | +	if (post_type_exists('tour') && is_singular('review')) { | |
| 128 | 128 | $args = array( | 
| 129 | 129 | 'from' => 'tour', | 
| 130 | 130 | 'to' => 'review', | 
| 131 | 131 | 'column' => '3', | 
| 132 | - 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'to-reviews' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', | |
| 132 | +			'before'	=> '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __(lsx_to_get_post_type_section_title('tour', '', 'Featured Tours'), 'to-reviews') . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', | |
| 133 | 133 | 'after' => '</div></div></section>', | 
| 134 | 134 | ); | 
| 135 | 135 | |
| 136 | - lsx_to_connected_panel_query( $args ); | |
| 136 | + lsx_to_connected_panel_query($args); | |
| 137 | 137 | } | 
| 138 | 138 | } | 
| 139 | 139 | |
| @@ -147,16 +147,16 @@ discard block | ||
| 147 | 147 |  function lsx_to_review_destination() { | 
| 148 | 148 | global $lsx_archive; | 
| 149 | 149 | |
| 150 | -	if ( post_type_exists( 'destination' ) && is_singular( 'review' ) ) { | |
| 150 | +	if (post_type_exists('destination') && is_singular('review')) { | |
| 151 | 151 | $args = array( | 
| 152 | 152 | 'from' => 'destination', | 
| 153 | 153 | 'to' => 'review', | 
| 154 | 154 | 'column' => '3', | 
| 155 | - 'before' => '<section id="destinations" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-destinations">' . __( lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' ), 'to-reviews' ) . '</h2><div id="collapse-destinations" class="collapse in"><div class="collapse-inner">', | |
| 155 | +			'before'	=> '<section id="destinations" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-destinations">' . __(lsx_to_get_post_type_section_title('destination', '', 'Featured Destinations'), 'to-reviews') . '</h2><div id="collapse-destinations" class="collapse in"><div class="collapse-inner">', | |
| 156 | 156 | 'after' => '</div></div></section>', | 
| 157 | 157 | ); | 
| 158 | 158 | |
| 159 | - lsx_to_connected_panel_query( $args ); | |
| 159 | + lsx_to_connected_panel_query($args); | |
| 160 | 160 | } | 
| 161 | 161 | } | 
| 162 | 162 | |
| @@ -170,16 +170,16 @@ discard block | ||
| 170 | 170 |  function lsx_to_accommodation_reviews() { | 
| 171 | 171 | global $lsx_archive; | 
| 172 | 172 | |
| 173 | -	if ( post_type_exists( 'review' ) && is_singular( 'accommodation' ) ) { | |
| 173 | +	if (post_type_exists('review') && is_singular('accommodation')) { | |
| 174 | 174 | $args = array( | 
| 175 | 175 | 'from' => 'review', | 
| 176 | 176 | 'to' => 'accommodation', | 
| 177 | 177 | 'column' => '2', | 
| 178 | - 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 178 | +			'before'	=> '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __(lsx_to_get_post_type_section_title('review', '', 'Reviews'), 'to-reviews') . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 179 | 179 | 'after' => '</div></div></section>', | 
| 180 | 180 | ); | 
| 181 | 181 | |
| 182 | - lsx_to_connected_panel_query( $args ); | |
| 182 | + lsx_to_connected_panel_query($args); | |
| 183 | 183 | } | 
| 184 | 184 | } | 
| 185 | 185 | |
| @@ -193,16 +193,16 @@ discard block | ||
| 193 | 193 |  function lsx_to_tour_reviews() { | 
| 194 | 194 | global $lsx_archive; | 
| 195 | 195 | |
| 196 | -	if ( post_type_exists( 'review' ) && is_singular( 'tour' ) ) { | |
| 196 | +	if (post_type_exists('review') && is_singular('tour')) { | |
| 197 | 197 | $args = array( | 
| 198 | 198 | 'from' => 'review', | 
| 199 | 199 | 'to' => 'tour', | 
| 200 | 200 | 'column' => '2', | 
| 201 | - 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 201 | +			'before'	=> '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __(lsx_to_get_post_type_section_title('review', '', 'Reviews'), 'to-reviews') . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 202 | 202 | 'after' => '</div></div></section>', | 
| 203 | 203 | ); | 
| 204 | 204 | |
| 205 | - lsx_to_connected_panel_query( $args ); | |
| 205 | + lsx_to_connected_panel_query($args); | |
| 206 | 206 | } | 
| 207 | 207 | } | 
| 208 | 208 | |
| @@ -216,16 +216,16 @@ discard block | ||
| 216 | 216 |  function lsx_to_destination_reviews() { | 
| 217 | 217 | global $lsx_archive; | 
| 218 | 218 | |
| 219 | -	if ( post_type_exists( 'review' ) && is_singular( 'destination' ) ) { | |
| 219 | +	if (post_type_exists('review') && is_singular('destination')) { | |
| 220 | 220 | $args = array( | 
| 221 | 221 | 'from' => 'review', | 
| 222 | 222 | 'to' => 'destination', | 
| 223 | 223 | 'column' => '2', | 
| 224 | - 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 224 | +			'before'	=> '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __(lsx_to_get_post_type_section_title('review', '', 'Reviews'), 'to-reviews') . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 225 | 225 | 'after' => '</div></div></section>', | 
| 226 | 226 | ); | 
| 227 | 227 | |
| 228 | - lsx_to_connected_panel_query( $args ); | |
| 228 | + lsx_to_connected_panel_query($args); | |
| 229 | 229 | } | 
| 230 | 230 | } | 
| 231 | 231 | |
| @@ -241,6 +241,6 @@ discard block | ||
| 241 | 241 | * @subpackage template-tags | 
| 242 | 242 | * @category connections | 
| 243 | 243 | */ | 
| 244 | -function lsx_to_connected_reviews( $before = '', $after = '', $echo = true ) { | |
| 245 | - lsx_to_connected_items_query( 'review', get_post_type(), $before, $after, $echo ); | |
| 244 | +function lsx_to_connected_reviews($before = '', $after = '', $echo = true) { | |
| 245 | +	lsx_to_connected_items_query('review', get_post_type(), $before, $after, $echo); | |
| 246 | 246 | } | 
| @@ -14,19 +14,19 @@ discard block | ||
| 14 | 14 | * @category review | 
| 15 | 15 | */ | 
| 16 | 16 |  if ( ! function_exists( 'lsx_to_review_posts' ) ) { | 
| 17 | -	function lsx_to_review_posts() { | |
| 18 | - global $lsx_to_archive; | |
| 19 | - | |
| 20 | - $args = array( | |
| 21 | - 'from' => 'post', | |
| 22 | - 'to' => 'review', | |
| 23 | - 'column' => '3', | |
| 24 | - 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . esc_html__( 'Featured Posts', 'to-reviews' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', | |
| 25 | - 'after' => '</div></div></section>', | |
| 26 | - ); | |
| 27 | - | |
| 28 | - lsx_to_connected_panel_query( $args ); | |
| 29 | - } | |
| 17 | +     function lsx_to_review_posts() { | |
| 18 | + global $lsx_to_archive; | |
| 19 | + | |
| 20 | + $args = array( | |
| 21 | + 'from' => 'post', | |
| 22 | + 'to' => 'review', | |
| 23 | + 'column' => '3', | |
| 24 | + 'before' => '<section id="posts" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-posts">' . esc_html__( 'Featured Posts', 'to-reviews' ) . '</h2><div id="collapse-posts" class="collapse in"><div class="collapse-inner">', | |
| 25 | + 'after' => '</div></div></section>', | |
| 26 | + ); | |
| 27 | + | |
| 28 | + lsx_to_connected_panel_query( $args ); | |
| 29 | + } | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 | /** | 
| @@ -37,7 +37,7 @@ discard block | ||
| 37 | 37 | * @category content | 
| 38 | 38 | */ | 
| 39 | 39 |  function lsx_to_review_content( $slug, $name = null ) { | 
| 40 | - do_action( 'lsx_to_review_content', $slug, $name ); | |
| 40 | + do_action( 'lsx_to_review_content', $slug, $name ); | |
| 41 | 41 | } | 
| 42 | 42 | |
| 43 | 43 | /* ================ REVIEWS =========================== */ | 
| @@ -54,7 +54,7 @@ discard block | ||
| 54 | 54 | * @category review | 
| 55 | 55 | */ | 
| 56 | 56 |  function lsx_to_review_rating( $before = '', $after = '', $echo = true ) { | 
| 57 | - lsx_to_custom_field_query( 'rating', $before, $after, $echo ); | |
| 57 | + lsx_to_custom_field_query( 'rating', $before, $after, $echo ); | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | 60 | /** | 
| @@ -70,26 +70,26 @@ discard block | ||
| 70 | 70 | * @category review | 
| 71 | 71 | */ | 
| 72 | 72 |  function lsx_to_review_dates( $before = '', $after = '', $echo = true ) { | 
| 73 | - $valid_from = get_post_meta( get_the_ID(), 'date_of_visit_start', true ); | |
| 74 | - $valid_to = get_post_meta( get_the_ID(), 'date_of_visit_end', true ); | |
| 75 | - | |
| 76 | -	if ( false !== $valid_from && '' !== $valid_from ) { | |
| 77 | - $valid_from = date( 'd M Y', strtotime( $valid_from ) ); | |
| 78 | - } | |
| 79 | - | |
| 80 | -	if ( false !== $valid_to && '' !== $valid_to ) { | |
| 81 | - $valid_from .= ' - ' . date( 'd M Y', strtotime( $valid_to ) ); | |
| 82 | - } | |
| 83 | - | |
| 84 | -	if ( false !== $valid_from && '' !== $valid_from ) { | |
| 85 | - $return = $before . $valid_from . $after; | |
| 86 | - | |
| 87 | -		if ( $echo ) { | |
| 88 | - echo $return; | |
| 89 | -		} else { | |
| 90 | - return $return; | |
| 91 | - } | |
| 92 | - } | |
| 73 | + $valid_from = get_post_meta( get_the_ID(), 'date_of_visit_start', true ); | |
| 74 | + $valid_to = get_post_meta( get_the_ID(), 'date_of_visit_end', true ); | |
| 75 | + | |
| 76 | +     if ( false !== $valid_from && '' !== $valid_from ) { | |
| 77 | + $valid_from = date( 'd M Y', strtotime( $valid_from ) ); | |
| 78 | + } | |
| 79 | + | |
| 80 | +     if ( false !== $valid_to && '' !== $valid_to ) { | |
| 81 | + $valid_from .= ' - ' . date( 'd M Y', strtotime( $valid_to ) ); | |
| 82 | + } | |
| 83 | + | |
| 84 | +     if ( false !== $valid_from && '' !== $valid_from ) { | |
| 85 | + $return = $before . $valid_from . $after; | |
| 86 | + | |
| 87 | +          if ( $echo ) { | |
| 88 | + echo $return; | |
| 89 | +          } else { | |
| 90 | + return $return; | |
| 91 | + } | |
| 92 | + } | |
| 93 | 93 | } | 
| 94 | 94 | /** | 
| 95 | 95 | * Outputs the connected accommodation for a review | 
| @@ -99,19 +99,19 @@ discard block | ||
| 99 | 99 | * @category review | 
| 100 | 100 | */ | 
| 101 | 101 |  function lsx_to_review_accommodation() { | 
| 102 | - global $lsx_archive; | |
| 103 | - | |
| 104 | -	if ( post_type_exists( 'accommodation' ) && is_singular( 'review' ) ) { | |
| 105 | - $args = array( | |
| 106 | - 'from' => 'accommodation', | |
| 107 | - 'to' => 'review', | |
| 108 | - 'column' => '3', | |
| 109 | - 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'to-reviews' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', | |
| 110 | - 'after' => '</div></div></section>', | |
| 111 | - ); | |
| 112 | - | |
| 113 | - lsx_to_connected_panel_query( $args ); | |
| 114 | - } | |
| 102 | + global $lsx_archive; | |
| 103 | + | |
| 104 | +     if ( post_type_exists( 'accommodation' ) && is_singular( 'review' ) ) { | |
| 105 | + $args = array( | |
| 106 | + 'from' => 'accommodation', | |
| 107 | + 'to' => 'review', | |
| 108 | + 'column' => '3', | |
| 109 | + 'before' => '<section id="accommodation" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-accommodation">' . __( lsx_to_get_post_type_section_title( 'accommodation', '', 'Featured Accommodations' ), 'to-reviews' ) . '</h2><div id="collapse-accommodation" class="collapse in"><div class="collapse-inner">', | |
| 110 | + 'after' => '</div></div></section>', | |
| 111 | + ); | |
| 112 | + | |
| 113 | + lsx_to_connected_panel_query( $args ); | |
| 114 | + } | |
| 115 | 115 | } | 
| 116 | 116 | |
| 117 | 117 | /** | 
| @@ -122,19 +122,19 @@ discard block | ||
| 122 | 122 | * @category review | 
| 123 | 123 | */ | 
| 124 | 124 |  function lsx_to_review_tour() { | 
| 125 | - global $lsx_archive; | |
| 126 | - | |
| 127 | -	if ( post_type_exists( 'tour' ) && is_singular( 'review' ) ) { | |
| 128 | - $args = array( | |
| 129 | - 'from' => 'tour', | |
| 130 | - 'to' => 'review', | |
| 131 | - 'column' => '3', | |
| 132 | - 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'to-reviews' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', | |
| 133 | - 'after' => '</div></div></section>', | |
| 134 | - ); | |
| 135 | - | |
| 136 | - lsx_to_connected_panel_query( $args ); | |
| 137 | - } | |
| 125 | + global $lsx_archive; | |
| 126 | + | |
| 127 | +     if ( post_type_exists( 'tour' ) && is_singular( 'review' ) ) { | |
| 128 | + $args = array( | |
| 129 | + 'from' => 'tour', | |
| 130 | + 'to' => 'review', | |
| 131 | + 'column' => '3', | |
| 132 | + 'before' => '<section id="tours" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-tours">' . __( lsx_to_get_post_type_section_title( 'tour', '', 'Featured Tours' ), 'to-reviews' ) . '</h2><div id="collapse-tours" class="collapse in"><div class="collapse-inner">', | |
| 133 | + 'after' => '</div></div></section>', | |
| 134 | + ); | |
| 135 | + | |
| 136 | + lsx_to_connected_panel_query( $args ); | |
| 137 | + } | |
| 138 | 138 | } | 
| 139 | 139 | |
| 140 | 140 | /** | 
| @@ -145,19 +145,19 @@ discard block | ||
| 145 | 145 | * @category review | 
| 146 | 146 | */ | 
| 147 | 147 |  function lsx_to_review_destination() { | 
| 148 | - global $lsx_archive; | |
| 149 | - | |
| 150 | -	if ( post_type_exists( 'destination' ) && is_singular( 'review' ) ) { | |
| 151 | - $args = array( | |
| 152 | - 'from' => 'destination', | |
| 153 | - 'to' => 'review', | |
| 154 | - 'column' => '3', | |
| 155 | - 'before' => '<section id="destinations" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-destinations">' . __( lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' ), 'to-reviews' ) . '</h2><div id="collapse-destinations" class="collapse in"><div class="collapse-inner">', | |
| 156 | - 'after' => '</div></div></section>', | |
| 157 | - ); | |
| 158 | - | |
| 159 | - lsx_to_connected_panel_query( $args ); | |
| 160 | - } | |
| 148 | + global $lsx_archive; | |
| 149 | + | |
| 150 | +     if ( post_type_exists( 'destination' ) && is_singular( 'review' ) ) { | |
| 151 | + $args = array( | |
| 152 | + 'from' => 'destination', | |
| 153 | + 'to' => 'review', | |
| 154 | + 'column' => '3', | |
| 155 | + 'before' => '<section id="destinations" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-destinations">' . __( lsx_to_get_post_type_section_title( 'destination', '', 'Featured Destinations' ), 'to-reviews' ) . '</h2><div id="collapse-destinations" class="collapse in"><div class="collapse-inner">', | |
| 156 | + 'after' => '</div></div></section>', | |
| 157 | + ); | |
| 158 | + | |
| 159 | + lsx_to_connected_panel_query( $args ); | |
| 160 | + } | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | /** | 
| @@ -168,19 +168,19 @@ discard block | ||
| 168 | 168 | * @category review | 
| 169 | 169 | */ | 
| 170 | 170 |  function lsx_to_accommodation_reviews() { | 
| 171 | - global $lsx_archive; | |
| 172 | - | |
| 173 | -	if ( post_type_exists( 'review' ) && is_singular( 'accommodation' ) ) { | |
| 174 | - $args = array( | |
| 175 | - 'from' => 'review', | |
| 176 | - 'to' => 'accommodation', | |
| 177 | - 'column' => '2', | |
| 178 | - 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 179 | - 'after' => '</div></div></section>', | |
| 180 | - ); | |
| 181 | - | |
| 182 | - lsx_to_connected_panel_query( $args ); | |
| 183 | - } | |
| 171 | + global $lsx_archive; | |
| 172 | + | |
| 173 | +     if ( post_type_exists( 'review' ) && is_singular( 'accommodation' ) ) { | |
| 174 | + $args = array( | |
| 175 | + 'from' => 'review', | |
| 176 | + 'to' => 'accommodation', | |
| 177 | + 'column' => '2', | |
| 178 | + 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 179 | + 'after' => '</div></div></section>', | |
| 180 | + ); | |
| 181 | + | |
| 182 | + lsx_to_connected_panel_query( $args ); | |
| 183 | + } | |
| 184 | 184 | } | 
| 185 | 185 | |
| 186 | 186 | /** | 
| @@ -191,19 +191,19 @@ discard block | ||
| 191 | 191 | * @category review | 
| 192 | 192 | */ | 
| 193 | 193 |  function lsx_to_tour_reviews() { | 
| 194 | - global $lsx_archive; | |
| 195 | - | |
| 196 | -	if ( post_type_exists( 'review' ) && is_singular( 'tour' ) ) { | |
| 197 | - $args = array( | |
| 198 | - 'from' => 'review', | |
| 199 | - 'to' => 'tour', | |
| 200 | - 'column' => '2', | |
| 201 | - 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 202 | - 'after' => '</div></div></section>', | |
| 203 | - ); | |
| 204 | - | |
| 205 | - lsx_to_connected_panel_query( $args ); | |
| 206 | - } | |
| 194 | + global $lsx_archive; | |
| 195 | + | |
| 196 | +     if ( post_type_exists( 'review' ) && is_singular( 'tour' ) ) { | |
| 197 | + $args = array( | |
| 198 | + 'from' => 'review', | |
| 199 | + 'to' => 'tour', | |
| 200 | + 'column' => '2', | |
| 201 | + 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 202 | + 'after' => '</div></div></section>', | |
| 203 | + ); | |
| 204 | + | |
| 205 | + lsx_to_connected_panel_query( $args ); | |
| 206 | + } | |
| 207 | 207 | } | 
| 208 | 208 | |
| 209 | 209 | /** | 
| @@ -214,19 +214,19 @@ discard block | ||
| 214 | 214 | * @category review | 
| 215 | 215 | */ | 
| 216 | 216 |  function lsx_to_destination_reviews() { | 
| 217 | - global $lsx_archive; | |
| 218 | - | |
| 219 | -	if ( post_type_exists( 'review' ) && is_singular( 'destination' ) ) { | |
| 220 | - $args = array( | |
| 221 | - 'from' => 'review', | |
| 222 | - 'to' => 'destination', | |
| 223 | - 'column' => '2', | |
| 224 | - 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 225 | - 'after' => '</div></div></section>', | |
| 226 | - ); | |
| 227 | - | |
| 228 | - lsx_to_connected_panel_query( $args ); | |
| 229 | - } | |
| 217 | + global $lsx_archive; | |
| 218 | + | |
| 219 | +     if ( post_type_exists( 'review' ) && is_singular( 'destination' ) ) { | |
| 220 | + $args = array( | |
| 221 | + 'from' => 'review', | |
| 222 | + 'to' => 'destination', | |
| 223 | + 'column' => '2', | |
| 224 | + 'before' => '<section id="review" class="lsx-to-section lsx-to-collapse-section"><h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title" data-toggle="collapse" data-target="#collapse-review">' . __( lsx_to_get_post_type_section_title( 'review', '', 'Reviews' ), 'to-reviews' ) . '</h2><div id="collapse-review" class="collapse in"><div class="collapse-inner">', | |
| 225 | + 'after' => '</div></div></section>', | |
| 226 | + ); | |
| 227 | + | |
| 228 | + lsx_to_connected_panel_query( $args ); | |
| 229 | + } | |
| 230 | 230 | } | 
| 231 | 231 | |
| 232 | 232 | /** | 
| @@ -242,5 +242,5 @@ discard block | ||
| 242 | 242 | * @category connections | 
| 243 | 243 | */ | 
| 244 | 244 |  function lsx_to_connected_reviews( $before = '', $after = '', $echo = true ) { | 
| 245 | - lsx_to_connected_items_query( 'review', get_post_type(), $before, $after, $echo ); | |
| 245 | + lsx_to_connected_items_query( 'review', get_post_type(), $before, $after, $echo ); | |
| 246 | 246 | } | 
| @@ -10,69 +10,69 @@ discard block | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | $metabox = array( | 
| 13 | - 'title' => esc_html__( 'Tour Operator Plugin', 'to-reviews' ), | |
| 13 | +	'title'  => esc_html__('Tour Operator Plugin', 'to-reviews'), | |
| 14 | 14 | 'pages' => 'review', | 
| 15 | 15 | 'fields' => array(), | 
| 16 | 16 | ); | 
| 17 | 17 | |
| 18 | 18 | $metabox['fields'][] = array( | 
| 19 | 19 | 'id' => 'featured', | 
| 20 | - 'name' => esc_html__( 'Featured', 'to-reviews' ), | |
| 20 | +	'name' => esc_html__('Featured', 'to-reviews'), | |
| 21 | 21 | 'type' => 'checkbox', | 
| 22 | 22 | ); | 
| 23 | 23 | |
| 24 | 24 | $metabox['fields'][] = array( | 
| 25 | 25 | 'id' => 'disable_single', | 
| 26 | - 'name' => esc_html__( 'Disable Single', 'to-reviews' ), | |
| 26 | +	'name' => esc_html__('Disable Single', 'to-reviews'), | |
| 27 | 27 | 'type' => 'checkbox', | 
| 28 | 28 | ); | 
| 29 | 29 | |
| 30 | -if ( ! class_exists( 'LSX_Banners' ) ) { | |
| 30 | +if ( ! class_exists('LSX_Banners')) { | |
| 31 | 31 | $metabox['fields'][] = array( | 
| 32 | 32 | 'id' => 'tagline', | 
| 33 | - 'name' => esc_html__( 'Tagline', 'to-reviews' ), | |
| 33 | +		'name' => esc_html__('Tagline', 'to-reviews'), | |
| 34 | 34 | 'type' => 'text', | 
| 35 | 35 | ); | 
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | $metabox['fields'][] = array( | 
| 39 | 39 | 'id' => 'no_adults', | 
| 40 | - 'name' => esc_html__( 'No of Adults', 'to-reviews' ), | |
| 40 | +	'name'	=> esc_html__('No of Adults', 'to-reviews'), | |
| 41 | 41 | 'type' => 'text', | 
| 42 | 42 | 'cols' => 6, | 
| 43 | 43 | ); | 
| 44 | 44 | |
| 45 | 45 | $metabox['fields'][] = array( | 
| 46 | 46 | 'id' => 'no_children', | 
| 47 | - 'name' => esc_html__( 'No of Children', 'to-reviews' ), | |
| 47 | +	'name'	=> esc_html__('No of Children', 'to-reviews'), | |
| 48 | 48 | 'type' => 'text', | 
| 49 | 49 | 'cols' => 6, | 
| 50 | 50 | ); | 
| 51 | 51 | |
| 52 | 52 | $metabox['fields'][] = array( | 
| 53 | 53 | 'id' => 'reviewer_name', | 
| 54 | - 'name' => esc_html__( 'Reviewer Name', 'to-reviews' ), | |
| 54 | +	'name'	=> esc_html__('Reviewer Name', 'to-reviews'), | |
| 55 | 55 | 'type' => 'text', | 
| 56 | 56 | 'cols' => 6, | 
| 57 | 57 | ); | 
| 58 | 58 | |
| 59 | 59 | $metabox['fields'][] = array( | 
| 60 | 60 | 'id' => 'reviewer_email', | 
| 61 | - 'name' => esc_html__( 'Reviewer Email', 'to-reviews' ), | |
| 61 | +	'name'	=> esc_html__('Reviewer Email', 'to-reviews'), | |
| 62 | 62 | 'type' => 'text', | 
| 63 | 63 | 'cols' => 6, | 
| 64 | 64 | ); | 
| 65 | 65 | |
| 66 | 66 | $metabox['fields'][] = array( | 
| 67 | 67 | 'id' => 'rating', | 
| 68 | - 'name' => esc_html__( 'Rating', 'to-reviews' ), | |
| 68 | +	'name'		 => esc_html__('Rating', 'to-reviews'), | |
| 69 | 69 | 'type' => 'radio', | 
| 70 | - 'options' => array( '0', '1', '2', '3', '4', '5' ), | |
| 70 | +	'options'	 => array('0', '1', '2', '3', '4', '5'), | |
| 71 | 71 | 'allow_none' => true, | 
| 72 | 72 | ); | 
| 73 | 73 | $metabox['fields'][] = array( | 
| 74 | 74 | 'id' => 'date_of_visit_start', | 
| 75 | - 'name' => esc_html__( 'Date of visit', 'to-reviews' ), | |
| 75 | +	'name'	=> esc_html__('Date of visit', 'to-reviews'), | |
| 76 | 76 | 'type' => 'date', | 
| 77 | 77 | 'cols' => 6, | 
| 78 | 78 | ); | 
| @@ -84,10 +84,10 @@ discard block | ||
| 84 | 84 | 'cols' => 6, | 
| 85 | 85 | ); | 
| 86 | 86 | |
| 87 | -if ( class_exists( 'LSX_TO_Team' ) ) { | |
| 87 | +if (class_exists('LSX_TO_Team')) { | |
| 88 | 88 | $metabox['fields'][] = array( | 
| 89 | 89 | 'id' => 'team_to_review', | 
| 90 | - 'name' => esc_html__( 'Reviewed By', 'to-reviews' ), | |
| 90 | +		'name'       => esc_html__('Reviewed By', 'to-reviews'), | |
| 91 | 91 | 'type' => 'post_select', | 
| 92 | 92 | 'use_ajax' => false, | 
| 93 | 93 | 'allow_none' => true, | 
| @@ -103,7 +103,7 @@ discard block | ||
| 103 | 103 | |
| 104 | 104 | $metabox['fields'][] = array( | 
| 105 | 105 | 'id' => 'gallery_title', | 
| 106 | - 'name' => esc_html__( 'Gallery', 'to-reviews' ), | |
| 106 | +	'name' => esc_html__('Gallery', 'to-reviews'), | |
| 107 | 107 | 'type' => 'title', | 
| 108 | 108 | ); | 
| 109 | 109 | |
| @@ -114,19 +114,19 @@ discard block | ||
| 114 | 114 | 'repeatable' => true, | 
| 115 | 115 | 'show_size' => false, | 
| 116 | 116 | 'sortable' => true, | 
| 117 | - 'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ), | |
| 117 | +	'string-repeat-field' => esc_html__('Add new image', 'tour-operator'), | |
| 118 | 118 | ); | 
| 119 | 119 | |
| 120 | -if ( class_exists( 'Envira_Gallery' ) ) { | |
| 120 | +if (class_exists('Envira_Gallery')) { | |
| 121 | 121 | $metabox['fields'][] = array( | 
| 122 | 122 | 'id' => 'envira_title', | 
| 123 | - 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), | |
| 123 | +		'name' => esc_html__('Envira Gallery', 'to-reviews'), | |
| 124 | 124 | 'type' => 'title', | 
| 125 | 125 | ); | 
| 126 | 126 | |
| 127 | 127 | $metabox['fields'][] = array( | 
| 128 | 128 | 'id' => 'envira_gallery', | 
| 129 | - 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), | |
| 129 | +		'name'       => esc_html__('Envira Gallery', 'to-reviews'), | |
| 130 | 130 | 'type' => 'post_select', | 
| 131 | 131 | 'use_ajax' => false, | 
| 132 | 132 | 'allow_none' => true, | 
| @@ -139,10 +139,10 @@ discard block | ||
| 139 | 139 | ), | 
| 140 | 140 | ); | 
| 141 | 141 | |
| 142 | -	if ( class_exists( 'Envira_Videos' ) ) { | |
| 142 | +	if (class_exists('Envira_Videos')) { | |
| 143 | 143 | $metabox['fields'][] = array( | 
| 144 | 144 | 'id' => 'envira_video', | 
| 145 | - 'name' => esc_html__( 'Envira Video Gallery', 'to-reviews' ), | |
| 145 | +			'name'       => esc_html__('Envira Video Gallery', 'to-reviews'), | |
| 146 | 146 | 'type' => 'post_select', | 
| 147 | 147 | 'use_ajax' => false, | 
| 148 | 148 | 'allow_none' => true, | 
| @@ -158,13 +158,13 @@ discard block | ||
| 158 | 158 | } | 
| 159 | 159 | |
| 160 | 160 | $post_types = array( | 
| 161 | - 'post' => esc_html__( 'Posts', 'to-reviews' ), | |
| 162 | - 'accommodation' => esc_html__( 'Accommodation', 'to-reviews' ), | |
| 163 | - 'destination' => esc_html__( 'Destinations', 'to-reviews' ), | |
| 164 | - 'tour' => esc_html__( 'Tours', 'to-reviews' ), | |
| 161 | +	'post'          => esc_html__('Posts', 'to-reviews'), | |
| 162 | +	'accommodation' => esc_html__('Accommodation', 'to-reviews'), | |
| 163 | +	'destination'   => esc_html__('Destinations', 'to-reviews'), | |
| 164 | +	'tour'          => esc_html__('Tours', 'to-reviews'), | |
| 165 | 165 | ); | 
| 166 | 166 | |
| 167 | -foreach ( $post_types as $slug => $label ) { | |
| 167 | +foreach ($post_types as $slug => $label) { | |
| 168 | 168 | $metabox['fields'][] = array( | 
| 169 | 169 | 'id' => $slug . '_title', | 
| 170 | 170 | 'name' => $label, | 
| @@ -173,7 +173,7 @@ discard block | ||
| 173 | 173 | |
| 174 | 174 | $metabox['fields'][] = array( | 
| 175 | 175 | 'id' => $slug . '_to_review', | 
| 176 | - 'name' => $label . esc_html__( ' related with this review', 'to-reviews' ), | |
| 176 | +		'name'       => $label . esc_html__(' related with this review', 'to-reviews'), | |
| 177 | 177 | 'type' => 'post_select', | 
| 178 | 178 | 'use_ajax' => false, | 
| 179 | 179 | 'repeatable' => true, | 
| @@ -188,6 +188,6 @@ discard block | ||
| 188 | 188 | ); | 
| 189 | 189 | } | 
| 190 | 190 | |
| 191 | -$metabox['fields'] = apply_filters( 'lsx_to_review_custom_fields', $metabox['fields'] ); | |
| 191 | +$metabox['fields'] = apply_filters('lsx_to_review_custom_fields', $metabox['fields']); | |
| 192 | 192 | |
| 193 | 193 | return $metabox; | 
| @@ -10,182 +10,182 @@ | ||
| 10 | 10 | */ | 
| 11 | 11 | |
| 12 | 12 | $metabox = array( | 
| 13 | - 'title' => esc_html__( 'Tour Operator Plugin', 'to-reviews' ), | |
| 14 | - 'pages' => 'review', | |
| 15 | - 'fields' => array(), | |
| 13 | + 'title' => esc_html__( 'Tour Operator Plugin', 'to-reviews' ), | |
| 14 | + 'pages' => 'review', | |
| 15 | + 'fields' => array(), | |
| 16 | 16 | ); | 
| 17 | 17 | |
| 18 | 18 | $metabox['fields'][] = array( | 
| 19 | - 'id' => 'featured', | |
| 20 | - 'name' => esc_html__( 'Featured', 'to-reviews' ), | |
| 21 | - 'type' => 'checkbox', | |
| 19 | + 'id' => 'featured', | |
| 20 | + 'name' => esc_html__( 'Featured', 'to-reviews' ), | |
| 21 | + 'type' => 'checkbox', | |
| 22 | 22 | ); | 
| 23 | 23 | |
| 24 | 24 | $metabox['fields'][] = array( | 
| 25 | - 'id' => 'disable_single', | |
| 26 | - 'name' => esc_html__( 'Disable Single', 'to-reviews' ), | |
| 27 | - 'type' => 'checkbox', | |
| 25 | + 'id' => 'disable_single', | |
| 26 | + 'name' => esc_html__( 'Disable Single', 'to-reviews' ), | |
| 27 | + 'type' => 'checkbox', | |
| 28 | 28 | ); | 
| 29 | 29 | |
| 30 | 30 |  if ( ! class_exists( 'LSX_Banners' ) ) { | 
| 31 | - $metabox['fields'][] = array( | |
| 32 | - 'id' => 'tagline', | |
| 33 | - 'name' => esc_html__( 'Tagline', 'to-reviews' ), | |
| 34 | - 'type' => 'text', | |
| 35 | - ); | |
| 31 | + $metabox['fields'][] = array( | |
| 32 | + 'id' => 'tagline', | |
| 33 | + 'name' => esc_html__( 'Tagline', 'to-reviews' ), | |
| 34 | + 'type' => 'text', | |
| 35 | + ); | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | $metabox['fields'][] = array( | 
| 39 | - 'id' => 'no_adults', | |
| 40 | - 'name' => esc_html__( 'No of Adults', 'to-reviews' ), | |
| 41 | - 'type' => 'text', | |
| 42 | - 'cols' => 6, | |
| 39 | + 'id' => 'no_adults', | |
| 40 | + 'name' => esc_html__( 'No of Adults', 'to-reviews' ), | |
| 41 | + 'type' => 'text', | |
| 42 | + 'cols' => 6, | |
| 43 | 43 | ); | 
| 44 | 44 | |
| 45 | 45 | $metabox['fields'][] = array( | 
| 46 | - 'id' => 'no_children', | |
| 47 | - 'name' => esc_html__( 'No of Children', 'to-reviews' ), | |
| 48 | - 'type' => 'text', | |
| 49 | - 'cols' => 6, | |
| 46 | + 'id' => 'no_children', | |
| 47 | + 'name' => esc_html__( 'No of Children', 'to-reviews' ), | |
| 48 | + 'type' => 'text', | |
| 49 | + 'cols' => 6, | |
| 50 | 50 | ); | 
| 51 | 51 | |
| 52 | 52 | $metabox['fields'][] = array( | 
| 53 | - 'id' => 'reviewer_name', | |
| 54 | - 'name' => esc_html__( 'Reviewer Name', 'to-reviews' ), | |
| 55 | - 'type' => 'text', | |
| 56 | - 'cols' => 6, | |
| 53 | + 'id' => 'reviewer_name', | |
| 54 | + 'name' => esc_html__( 'Reviewer Name', 'to-reviews' ), | |
| 55 | + 'type' => 'text', | |
| 56 | + 'cols' => 6, | |
| 57 | 57 | ); | 
| 58 | 58 | |
| 59 | 59 | $metabox['fields'][] = array( | 
| 60 | - 'id' => 'reviewer_email', | |
| 61 | - 'name' => esc_html__( 'Reviewer Email', 'to-reviews' ), | |
| 62 | - 'type' => 'text', | |
| 63 | - 'cols' => 6, | |
| 60 | + 'id' => 'reviewer_email', | |
| 61 | + 'name' => esc_html__( 'Reviewer Email', 'to-reviews' ), | |
| 62 | + 'type' => 'text', | |
| 63 | + 'cols' => 6, | |
| 64 | 64 | ); | 
| 65 | 65 | |
| 66 | 66 | $metabox['fields'][] = array( | 
| 67 | - 'id' => 'rating', | |
| 68 | - 'name' => esc_html__( 'Rating', 'to-reviews' ), | |
| 69 | - 'type' => 'radio', | |
| 70 | - 'options' => array( '0', '1', '2', '3', '4', '5' ), | |
| 71 | - 'allow_none' => true, | |
| 67 | + 'id' => 'rating', | |
| 68 | + 'name' => esc_html__( 'Rating', 'to-reviews' ), | |
| 69 | + 'type' => 'radio', | |
| 70 | + 'options' => array( '0', '1', '2', '3', '4', '5' ), | |
| 71 | + 'allow_none' => true, | |
| 72 | 72 | ); | 
| 73 | 73 | $metabox['fields'][] = array( | 
| 74 | - 'id' => 'date_of_visit_start', | |
| 75 | - 'name' => esc_html__( 'Date of visit', 'to-reviews' ), | |
| 76 | - 'type' => 'date', | |
| 77 | - 'cols' => 6, | |
| 74 | + 'id' => 'date_of_visit_start', | |
| 75 | + 'name' => esc_html__( 'Date of visit', 'to-reviews' ), | |
| 76 | + 'type' => 'date', | |
| 77 | + 'cols' => 6, | |
| 78 | 78 | ); | 
| 79 | 79 | |
| 80 | 80 | $metabox['fields'][] = array( | 
| 81 | - 'id' => 'date_of_visit_end', | |
| 82 | - 'name' => '', | |
| 83 | - 'type' => 'date', | |
| 84 | - 'cols' => 6, | |
| 81 | + 'id' => 'date_of_visit_end', | |
| 82 | + 'name' => '', | |
| 83 | + 'type' => 'date', | |
| 84 | + 'cols' => 6, | |
| 85 | 85 | ); | 
| 86 | 86 | |
| 87 | 87 |  if ( class_exists( 'LSX_TO_Team' ) ) { | 
| 88 | - $metabox['fields'][] = array( | |
| 89 | - 'id' => 'team_to_review', | |
| 90 | - 'name' => esc_html__( 'Reviewed By', 'to-reviews' ), | |
| 91 | - 'type' => 'post_select', | |
| 92 | - 'use_ajax' => false, | |
| 93 | - 'allow_none' => true, | |
| 94 | - 'query' => array( | |
| 95 | - 'post_type' => 'team', | |
| 96 | - 'nopagin' => true, | |
| 97 | - 'posts_per_page' => 1000, | |
| 98 | - 'orderby' => 'title', | |
| 99 | - 'order' => 'ASC', | |
| 100 | - ), | |
| 101 | - ); | |
| 88 | + $metabox['fields'][] = array( | |
| 89 | + 'id' => 'team_to_review', | |
| 90 | + 'name' => esc_html__( 'Reviewed By', 'to-reviews' ), | |
| 91 | + 'type' => 'post_select', | |
| 92 | + 'use_ajax' => false, | |
| 93 | + 'allow_none' => true, | |
| 94 | + 'query' => array( | |
| 95 | + 'post_type' => 'team', | |
| 96 | + 'nopagin' => true, | |
| 97 | + 'posts_per_page' => 1000, | |
| 98 | + 'orderby' => 'title', | |
| 99 | + 'order' => 'ASC', | |
| 100 | + ), | |
| 101 | + ); | |
| 102 | 102 | } | 
| 103 | 103 | |
| 104 | 104 | $metabox['fields'][] = array( | 
| 105 | - 'id' => 'gallery_title', | |
| 106 | - 'name' => esc_html__( 'Gallery', 'to-reviews' ), | |
| 107 | - 'type' => 'title', | |
| 105 | + 'id' => 'gallery_title', | |
| 106 | + 'name' => esc_html__( 'Gallery', 'to-reviews' ), | |
| 107 | + 'type' => 'title', | |
| 108 | 108 | ); | 
| 109 | 109 | |
| 110 | 110 | $metabox['fields'][] = array( | 
| 111 | - 'id' => 'gallery', | |
| 112 | - 'name' => '', | |
| 113 | - 'type' => 'image', | |
| 114 | - 'repeatable' => true, | |
| 115 | - 'show_size' => false, | |
| 116 | - 'sortable' => true, | |
| 117 | - 'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ), | |
| 111 | + 'id' => 'gallery', | |
| 112 | + 'name' => '', | |
| 113 | + 'type' => 'image', | |
| 114 | + 'repeatable' => true, | |
| 115 | + 'show_size' => false, | |
| 116 | + 'sortable' => true, | |
| 117 | + 'string-repeat-field' => esc_html__( 'Add new image', 'tour-operator' ), | |
| 118 | 118 | ); | 
| 119 | 119 | |
| 120 | 120 |  if ( class_exists( 'Envira_Gallery' ) ) { | 
| 121 | - $metabox['fields'][] = array( | |
| 122 | - 'id' => 'envira_title', | |
| 123 | - 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), | |
| 124 | - 'type' => 'title', | |
| 125 | - ); | |
| 126 | - | |
| 127 | - $metabox['fields'][] = array( | |
| 128 | - 'id' => 'envira_gallery', | |
| 129 | - 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), | |
| 130 | - 'type' => 'post_select', | |
| 131 | - 'use_ajax' => false, | |
| 132 | - 'allow_none' => true, | |
| 133 | - 'query' => array( | |
| 134 | - 'post_type' => 'envira', | |
| 135 | - 'nopagin' => true, | |
| 136 | - 'posts_per_page' => '-1', | |
| 137 | - 'orderby' => 'title', | |
| 138 | - 'order' => 'ASC', | |
| 139 | - ), | |
| 140 | - ); | |
| 141 | - | |
| 142 | -	if ( class_exists( 'Envira_Videos' ) ) { | |
| 143 | - $metabox['fields'][] = array( | |
| 144 | - 'id' => 'envira_video', | |
| 145 | - 'name' => esc_html__( 'Envira Video Gallery', 'to-reviews' ), | |
| 146 | - 'type' => 'post_select', | |
| 147 | - 'use_ajax' => false, | |
| 148 | - 'allow_none' => true, | |
| 149 | - 'query' => array( | |
| 150 | - 'post_type' => 'envira', | |
| 151 | - 'nopagin' => true, | |
| 152 | - 'posts_per_page' => '-1', | |
| 153 | - 'orderby' => 'title', | |
| 154 | - 'order' => 'ASC', | |
| 155 | - ), | |
| 156 | - ); | |
| 157 | - } | |
| 121 | + $metabox['fields'][] = array( | |
| 122 | + 'id' => 'envira_title', | |
| 123 | + 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), | |
| 124 | + 'type' => 'title', | |
| 125 | + ); | |
| 126 | + | |
| 127 | + $metabox['fields'][] = array( | |
| 128 | + 'id' => 'envira_gallery', | |
| 129 | + 'name' => esc_html__( 'Envira Gallery', 'to-reviews' ), | |
| 130 | + 'type' => 'post_select', | |
| 131 | + 'use_ajax' => false, | |
| 132 | + 'allow_none' => true, | |
| 133 | + 'query' => array( | |
| 134 | + 'post_type' => 'envira', | |
| 135 | + 'nopagin' => true, | |
| 136 | + 'posts_per_page' => '-1', | |
| 137 | + 'orderby' => 'title', | |
| 138 | + 'order' => 'ASC', | |
| 139 | + ), | |
| 140 | + ); | |
| 141 | + | |
| 142 | +     if ( class_exists( 'Envira_Videos' ) ) { | |
| 143 | + $metabox['fields'][] = array( | |
| 144 | + 'id' => 'envira_video', | |
| 145 | + 'name' => esc_html__( 'Envira Video Gallery', 'to-reviews' ), | |
| 146 | + 'type' => 'post_select', | |
| 147 | + 'use_ajax' => false, | |
| 148 | + 'allow_none' => true, | |
| 149 | + 'query' => array( | |
| 150 | + 'post_type' => 'envira', | |
| 151 | + 'nopagin' => true, | |
| 152 | + 'posts_per_page' => '-1', | |
| 153 | + 'orderby' => 'title', | |
| 154 | + 'order' => 'ASC', | |
| 155 | + ), | |
| 156 | + ); | |
| 157 | + } | |
| 158 | 158 | } | 
| 159 | 159 | |
| 160 | 160 | $post_types = array( | 
| 161 | - 'post' => esc_html__( 'Posts', 'to-reviews' ), | |
| 162 | - 'accommodation' => esc_html__( 'Accommodation', 'to-reviews' ), | |
| 163 | - 'destination' => esc_html__( 'Destinations', 'to-reviews' ), | |
| 164 | - 'tour' => esc_html__( 'Tours', 'to-reviews' ), | |
| 161 | + 'post' => esc_html__( 'Posts', 'to-reviews' ), | |
| 162 | + 'accommodation' => esc_html__( 'Accommodation', 'to-reviews' ), | |
| 163 | + 'destination' => esc_html__( 'Destinations', 'to-reviews' ), | |
| 164 | + 'tour' => esc_html__( 'Tours', 'to-reviews' ), | |
| 165 | 165 | ); | 
| 166 | 166 | |
| 167 | 167 |  foreach ( $post_types as $slug => $label ) { | 
| 168 | - $metabox['fields'][] = array( | |
| 169 | - 'id' => $slug . '_title', | |
| 170 | - 'name' => $label, | |
| 171 | - 'type' => 'title', | |
| 172 | - ); | |
| 173 | - | |
| 174 | - $metabox['fields'][] = array( | |
| 175 | - 'id' => $slug . '_to_review', | |
| 176 | - 'name' => $label . esc_html__( ' related with this review', 'to-reviews' ), | |
| 177 | - 'type' => 'post_select', | |
| 178 | - 'use_ajax' => false, | |
| 179 | - 'repeatable' => true, | |
| 180 | - 'allow_none' => true, | |
| 181 | - 'query' => array( | |
| 182 | - 'post_type' => $slug, | |
| 183 | - 'nopagin' => true, | |
| 184 | - 'posts_per_page' => '-1', | |
| 185 | - 'orderby' => 'title', | |
| 186 | - 'order' => 'ASC', | |
| 187 | - ), | |
| 188 | - ); | |
| 168 | + $metabox['fields'][] = array( | |
| 169 | + 'id' => $slug . '_title', | |
| 170 | + 'name' => $label, | |
| 171 | + 'type' => 'title', | |
| 172 | + ); | |
| 173 | + | |
| 174 | + $metabox['fields'][] = array( | |
| 175 | + 'id' => $slug . '_to_review', | |
| 176 | + 'name' => $label . esc_html__( ' related with this review', 'to-reviews' ), | |
| 177 | + 'type' => 'post_select', | |
| 178 | + 'use_ajax' => false, | |
| 179 | + 'repeatable' => true, | |
| 180 | + 'allow_none' => true, | |
| 181 | + 'query' => array( | |
| 182 | + 'post_type' => $slug, | |
| 183 | + 'nopagin' => true, | |
| 184 | + 'posts_per_page' => '-1', | |
| 185 | + 'orderby' => 'title', | |
| 186 | + 'order' => 'ASC', | |
| 187 | + ), | |
| 188 | + ); | |
| 189 | 189 | } | 
| 190 | 190 | |
| 191 | 191 | $metabox['fields'] = apply_filters( 'lsx_to_review_custom_fields', $metabox['fields'] ); | 
| @@ -8,33 +8,33 @@ | ||
| 8 | 8 | |
| 9 | 9 | global $lsx_to_archive, $post; | 
| 10 | 10 | |
| 11 | -if ( 1 !== $lsx_to_archive ) { | |
| 11 | +if (1 !== $lsx_to_archive) { | |
| 12 | 12 | $lsx_to_archive = false; | 
| 13 | 13 | } | 
| 14 | 14 | ?> | 
| 15 | 15 | |
| 16 | 16 | <?php lsx_entry_before(); ?> | 
| 17 | 17 | |
| 18 | -<article id="review-<?php echo esc_attr( $post->post_name ); ?>" <?php post_class( 'lsx-to-archive-container' ); ?>> | |
| 18 | +<article id="review-<?php echo esc_attr($post->post_name); ?>" <?php post_class('lsx-to-archive-container'); ?>> | |
| 19 | 19 | <?php lsx_entry_top(); ?> | 
| 20 | 20 | |
| 21 | -	<?php if ( is_single() && false === $lsx_to_archive ) { ?> | |
| 21 | +	<?php if (is_single() && false === $lsx_to_archive) { ?> | |
| 22 | 22 | |
| 23 | - <div <?php lsx_to_entry_class( 'entry-content' ); ?>> | |
| 23 | +		<div <?php lsx_to_entry_class('entry-content'); ?>> | |
| 24 | 24 | <div class="lsx-to-section-inner"> | 
| 25 | 25 | <h3 class="lsx-to-summary-title"><?php the_title(); ?></h3> | 
| 26 | 26 | <div class="lsx-to-review-content"><?php the_content(); ?></div> | 
| 27 | 27 | |
| 28 | - <h3 class="lsx-to-summary-title"><?php esc_html_e( 'Trip Details', 'to-reviews' ); ?></h3> | |
| 28 | +				<h3 class="lsx-to-summary-title"><?php esc_html_e('Trip Details', 'to-reviews'); ?></h3> | |
| 29 | 29 | <?php lsx_to_fast_facts(); ?> | 
| 30 | 30 | </div> | 
| 31 | 31 | |
| 32 | 32 | <?php lsx_to_sharing(); ?> | 
| 33 | 33 | </div> | 
| 34 | 34 | |
| 35 | -	<?php } elseif ( is_search() || empty( tour_operator()->options[ get_post_type() ]['disable_entry_text'] ) ) { ?> | |
| 35 | +	<?php } elseif (is_search() || empty(tour_operator()->options[get_post_type()]['disable_entry_text'])) { ?> | |
| 36 | 36 | |
| 37 | - <div <?php lsx_to_entry_class( 'entry-content' ); ?>><?php | |
| 37 | +		<div <?php lsx_to_entry_class('entry-content'); ?>><?php | |
| 38 | 38 | lsx_to_entry_content_top(); | 
| 39 | 39 | the_excerpt(); | 
| 40 | 40 | lsx_to_entry_content_bottom(); | 
| @@ -9,7 +9,7 @@ discard block | ||
| 9 | 9 | global $lsx_to_archive, $post; | 
| 10 | 10 | |
| 11 | 11 |  if ( 1 !== $lsx_to_archive ) { | 
| 12 | - $lsx_to_archive = false; | |
| 12 | + $lsx_to_archive = false; | |
| 13 | 13 | } | 
| 14 | 14 | ?> | 
| 15 | 15 | |
| @@ -35,10 +35,10 @@ discard block | ||
| 35 | 35 |  	<?php } elseif ( is_search() || empty( tour_operator()->options[ get_post_type() ]['disable_entry_text'] ) ) { ?> | 
| 36 | 36 | |
| 37 | 37 | <div <?php lsx_to_entry_class( 'entry-content' ); ?>><?php | 
| 38 | - lsx_to_entry_content_top(); | |
| 39 | - the_excerpt(); | |
| 40 | - lsx_to_entry_content_bottom(); | |
| 41 | - ?></div> | |
| 38 | + lsx_to_entry_content_top(); | |
| 39 | + the_excerpt(); | |
| 40 | + lsx_to_entry_content_bottom(); | |
| 41 | + ?></div> | |
| 42 | 42 | |
| 43 | 43 | <?php } ?> | 
| 44 | 44 | |
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | |
| 11 | 11 | <?php lsx_content_wrap_before(); ?> | 
| 12 | 12 | |
| 13 | - <div id="primary" class="content-area col-sm-12 <?php echo esc_attr( lsx_main_class() ); ?>"> | |
| 13 | + <div id="primary" class="content-area col-sm-12 <?php echo esc_attr(lsx_main_class()); ?>"> | |
| 14 | 14 | |
| 15 | 15 | <?php lsx_content_before(); ?> | 
| 16 | 16 | |
| @@ -18,15 +18,15 @@ discard block | ||
| 18 | 18 | |
| 19 | 19 | <?php lsx_content_top(); ?> | 
| 20 | 20 | |
| 21 | - <?php while ( have_posts() ) : the_post(); ?> | |
| 21 | + <?php while (have_posts()) : the_post(); ?> | |
| 22 | 22 | |
| 23 | 23 | <section id="summary" class="lsx-to-section lsx-to-collapse-section"> | 
| 24 | - <h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title hidden-lg" data-toggle="collapse" data-target="#collapse-summary"><?php esc_html_e( 'Summary', 'to-reviews' ); ?></h2> | |
| 24 | +					<h2 class="lsx-to-section-title lsx-to-collapse-title lsx-title hidden-lg" data-toggle="collapse" data-target="#collapse-summary"><?php esc_html_e('Summary', 'to-reviews'); ?></h2> | |
| 25 | 25 | |
| 26 | 26 | <div id="collapse-summary" class="collapse in"> | 
| 27 | 27 | <div class="collapse-inner"> | 
| 28 | 28 | <div class="row"> | 
| 29 | - <?php lsx_to_content( 'content', 'review' ); ?> | |
| 29 | +								<?php lsx_to_content('content', 'review'); ?> | |
| 30 | 30 | </div> | 
| 31 | 31 | </div> | 
| 32 | 32 | </div> | 
| @@ -10,7 +10,7 @@ discard block | ||
| 10 | 10 | |
| 11 | 11 | <?php lsx_content_wrap_before(); ?> | 
| 12 | 12 | |
| 13 | - <div id="primary" class="content-area col-sm-12 <?php echo esc_attr( lsx_main_class() ); ?>"> | |
| 13 | + <div id="primary" class="content-area col-sm-12 <?php echo esc_attr(lsx_main_class()); ?>"> | |
| 14 | 14 | |
| 15 | 15 | <?php lsx_content_before(); ?> | 
| 16 | 16 | |
| @@ -18,14 +18,14 @@ discard block | ||
| 18 | 18 | |
| 19 | 19 | <?php lsx_content_top(); ?> | 
| 20 | 20 | |
| 21 | - <?php if ( have_posts() ) : ?> | |
| 21 | + <?php if (have_posts()) : ?> | |
| 22 | 22 | |
| 23 | - <div class="row lsx-to-archive-items lsx-to-archive-template-<?php echo esc_attr( tour_operator()->archive_layout ); ?> lsx-to-archive-template-image-<?php echo esc_attr( tour_operator()->archive_list_layout_image_style ); ?>"> | |
| 23 | + <div class="row lsx-to-archive-items lsx-to-archive-template-<?php echo esc_attr(tour_operator()->archive_layout); ?> lsx-to-archive-template-image-<?php echo esc_attr(tour_operator()->archive_list_layout_image_style); ?>"> | |
| 24 | 24 | |
| 25 | - <?php while ( have_posts() ) : the_post(); ?> | |
| 25 | + <?php while (have_posts()) : the_post(); ?> | |
| 26 | 26 | |
| 27 | - <div class="<?php echo esc_attr( lsx_to_archive_class( 'lsx-to-archive-item' ) ); ?>"> | |
| 28 | - <?php lsx_to_review_content( 'content', 'review' ); ?> | |
| 27 | +						<div class="<?php echo esc_attr(lsx_to_archive_class('lsx-to-archive-item')); ?>"> | |
| 28 | +							<?php lsx_to_review_content('content', 'review'); ?> | |
| 29 | 29 | </div> | 
| 30 | 30 | |
| 31 | 31 | <?php endwhile; ?> | 
| @@ -34,7 +34,7 @@ discard block | ||
| 34 | 34 | |
| 35 | 35 | <?php else : ?> | 
| 36 | 36 | |
| 37 | - <?php get_template_part( 'partials/content', 'none' ); ?> | |
| 37 | +				<?php get_template_part('partials/content', 'none'); ?> | |
| 38 | 38 | |
| 39 | 39 | <?php endif; ?> | 
| 40 | 40 | |
| @@ -32,9 +32,12 @@ | ||
| 32 | 32 | |
| 33 | 33 | </div> | 
| 34 | 34 | |
| 35 | - <?php else : ?> | |
| 35 | +			<?php else { | |
| 36 | + : ?> | |
| 36 | 37 | |
| 37 | - <?php get_template_part( 'partials/content', 'none' ); ?> | |
| 38 | + <?php get_template_part( 'partials/content', 'none' ); | |
| 39 | +} | |
| 40 | +?> | |
| 38 | 41 | |
| 39 | 42 | <?php endif; ?> | 
| 40 | 43 | |
| @@ -17,9 +17,9 @@ discard block | ||
| 17 | 17 | * | 
| 18 | 18 | * @param \WPSEO_Schema_Context $context A value object with context variables. | 
| 19 | 19 | */ | 
| 20 | -	public function __construct( WPSEO_Schema_Context $context ) { | |
| 20 | +	public function __construct(WPSEO_Schema_Context $context) { | |
| 21 | 21 | $this->post_type = 'review'; | 
| 22 | - parent::__construct( $context ); | |
| 22 | + parent::__construct($context); | |
| 23 | 23 | } | 
| 24 | 24 | |
| 25 | 25 | /** | 
| @@ -28,30 +28,30 @@ discard block | ||
| 28 | 28 | * @return array $data Review data. | 
| 29 | 29 | */ | 
| 30 | 30 |  	public function generate() { | 
| 31 | - $post = get_post( $this->context->id ); | |
| 32 | - $review_author = get_post_meta( $post->ID, 'reviewer_name', true ); | |
| 33 | - $review_email = get_post_meta( $post->ID, 'reviewer_email', true ); | |
| 34 | - $rating_value = get_post_meta( $post->ID, 'rating', true ); | |
| 35 | - $description = wp_strip_all_tags( get_the_content() ); | |
| 36 | - $tour_list = get_post_meta( get_the_ID(), 'tour_to_review', false ); | |
| 37 | - $accom_list = get_post_meta( get_the_ID(), 'accommodation_to_review', false ); | |
| 38 | - $comment_count = get_comment_count( $this->context->id ); | |
| 39 | - $review_author = get_post_meta( $post->ID, 'reviewer_name', true ); | |
| 40 | - $date_of_visit_start = get_post_meta( $post->ID, 'date_of_visit_start', true ); | |
| 41 | - $date_of_visit_end = get_post_meta( $post->ID, 'date_of_visit_end', true ); | |
| 31 | + $post = get_post($this->context->id); | |
| 32 | + $review_author = get_post_meta($post->ID, 'reviewer_name', true); | |
| 33 | + $review_email = get_post_meta($post->ID, 'reviewer_email', true); | |
| 34 | + $rating_value = get_post_meta($post->ID, 'rating', true); | |
| 35 | + $description = wp_strip_all_tags(get_the_content()); | |
| 36 | + $tour_list = get_post_meta(get_the_ID(), 'tour_to_review', false); | |
| 37 | + $accom_list = get_post_meta(get_the_ID(), 'accommodation_to_review', false); | |
| 38 | + $comment_count = get_comment_count($this->context->id); | |
| 39 | + $review_author = get_post_meta($post->ID, 'reviewer_name', true); | |
| 40 | + $date_of_visit_start = get_post_meta($post->ID, 'date_of_visit_start', true); | |
| 41 | + $date_of_visit_end = get_post_meta($post->ID, 'date_of_visit_end', true); | |
| 42 | 42 | |
| 43 | - $data = array( | |
| 43 | + $data = array( | |
| 44 | 44 | '@type' => 'Review', | 
| 45 | 45 | '@id' => $this->context->canonical . '#review', | 
| 46 | 46 | 'author' => array( | 
| 47 | 47 | '@type' => 'Person', | 
| 48 | - '@id' => \lsx\legacy\Schema_Utils::get_author_schema_id( $review_author, $review_email, $this->context ), | |
| 48 | + '@id' => \lsx\legacy\Schema_Utils::get_author_schema_id($review_author, $review_email, $this->context), | |
| 49 | 49 | 'name' => $review_author, | 
| 50 | 50 | 'email' => $review_email, | 
| 51 | 51 | ), | 
| 52 | 52 | 'headline' => get_the_title(), | 
| 53 | - 'datePublished' => mysql2date( DATE_W3C, $post->post_date_gmt, false ), | |
| 54 | - 'dateModified' => mysql2date( DATE_W3C, $post->post_modified_gmt, false ), | |
| 53 | + 'datePublished' => mysql2date(DATE_W3C, $post->post_date_gmt, false), | |
| 54 | + 'dateModified' => mysql2date(DATE_W3C, $post->post_modified_gmt, false), | |
| 55 | 55 | 'commentCount' => $comment_count['approved'], | 
| 56 | 56 | 'mainEntityOfPage' => array( | 
| 57 | 57 | '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH, | 
| @@ -62,23 +62,23 @@ discard block | ||
| 62 | 62 | 'bestRating' => $rating_value, | 
| 63 | 63 | ), | 
| 64 | 64 | 'reviewBody' => $description, | 
| 65 | - 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed( $tour_list, 'Product' ), | |
| 66 | - 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed( $accom_list, 'Product' ), | |
| 65 | + 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed($tour_list, 'Product'), | |
| 66 | + 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed($accom_list, 'Product'), | |
| 67 | 67 | ); | 
| 68 | 68 | |
| 69 | -		if ( $this->context->site_represents_reference ) { | |
| 69 | +		if ($this->context->site_represents_reference) { | |
| 70 | 70 | $data['publisher'] = $this->context->site_represents_reference; | 
| 71 | 71 | } | 
| 72 | 72 | |
| 73 | -		if ( '' !== $date_of_visit_start && '' !== $date_of_visit_end ) { | |
| 73 | +		if ('' !== $date_of_visit_start && '' !== $date_of_visit_end) { | |
| 74 | 74 | $data['temporalCoverage'] = $date_of_visit_start . ' - ' . $date_of_visit_end; | 
| 75 | 75 | } | 
| 76 | 76 | |
| 77 | - $data = \lsx\legacy\Schema_Utils::add_image( $data, $this->context ); | |
| 78 | - $data = $this->add_taxonomy_terms( $data, 'keywords', 'post_tag' ); | |
| 79 | - $data = $this->add_taxonomy_terms( $data, 'reviewSection', 'category' ); | |
| 80 | - $data = $this->add_offers( $data ); | |
| 81 | - $data = $this->add_destinations( $data ); | |
| 77 | + $data = \lsx\legacy\Schema_Utils::add_image($data, $this->context); | |
| 78 | + $data = $this->add_taxonomy_terms($data, 'keywords', 'post_tag'); | |
| 79 | + $data = $this->add_taxonomy_terms($data, 'reviewSection', 'category'); | |
| 80 | + $data = $this->add_offers($data); | |
| 81 | + $data = $this->add_destinations($data); | |
| 82 | 82 | return $data; | 
| 83 | 83 | } | 
| 84 | 84 | |
| @@ -89,21 +89,21 @@ discard block | ||
| 89 | 89 | * | 
| 90 | 90 | * @return array $data Country / State data. | 
| 91 | 91 | */ | 
| 92 | -	public function add_destinations( $data, $data_key = '' ) { | |
| 92 | +	public function add_destinations($data, $data_key = '') { | |
| 93 | 93 | $places_array = array(); | 
| 94 | - $destinations = get_post_meta( $this->context->id, 'destination_to_' . $this->post_type, false ); | |
| 95 | -		if ( ! empty( $destinations ) ) { | |
| 96 | -			foreach ( $destinations as $destination_id ) { | |
| 97 | -				if ( '' !== $destination_id ) { | |
| 98 | -					if ( 0 === wp_get_post_parent_id( $destination_id ) || false === wp_get_post_parent_id( $destination_id ) ) { | |
| 99 | - $places_array = \lsx\legacy\Schema_Utils::add_place( $places_array, 'Country', $destination_id, $this->context ); | |
| 100 | -					} else { | |
| 101 | - $places_array = \lsx\legacy\Schema_Utils::add_place( $places_array, 'State', $destination_id, $this->context ); | |
| 94 | + $destinations = get_post_meta($this->context->id, 'destination_to_' . $this->post_type, false); | |
| 95 | +		if ( ! empty($destinations)) { | |
| 96 | +			foreach ($destinations as $destination_id) { | |
| 97 | +				if ('' !== $destination_id) { | |
| 98 | +					if (0 === wp_get_post_parent_id($destination_id) || false === wp_get_post_parent_id($destination_id)) { | |
| 99 | + $places_array = \lsx\legacy\Schema_Utils::add_place($places_array, 'Country', $destination_id, $this->context); | |
| 100 | +					}else { | |
| 101 | + $places_array = \lsx\legacy\Schema_Utils::add_place($places_array, 'State', $destination_id, $this->context); | |
| 102 | 102 | } | 
| 103 | 103 | } | 
| 104 | 104 | } | 
| 105 | 105 | } | 
| 106 | -		if ( ! empty( $places_array ) ) { | |
| 106 | +		if ( ! empty($places_array)) { | |
| 107 | 107 | $data['spatialCoverage'] = $places_array; | 
| 108 | 108 | } | 
| 109 | 109 | return $data; | 
| @@ -12,100 +12,100 @@ | ||
| 12 | 12 | */ | 
| 13 | 13 |  class LSX_TO_Schema_Review extends LSX_TO_Schema_Graph_Piece { | 
| 14 | 14 | |
| 15 | - /** | |
| 16 | - * Constructor. | |
| 17 | - * | |
| 18 | - * @param \WPSEO_Schema_Context $context A value object with context variables. | |
| 19 | - */ | |
| 20 | -	public function __construct( WPSEO_Schema_Context $context ) { | |
| 21 | - $this->post_type = 'review'; | |
| 22 | - parent::__construct( $context ); | |
| 23 | - } | |
| 15 | + /** | |
| 16 | + * Constructor. | |
| 17 | + * | |
| 18 | + * @param \WPSEO_Schema_Context $context A value object with context variables. | |
| 19 | + */ | |
| 20 | +     public function __construct( WPSEO_Schema_Context $context ) { | |
| 21 | + $this->post_type = 'review'; | |
| 22 | + parent::__construct( $context ); | |
| 23 | + } | |
| 24 | 24 | |
| 25 | - /** | |
| 26 | - * Returns Review data. | |
| 27 | - * | |
| 28 | - * @return array $data Review data. | |
| 29 | - */ | |
| 30 | -	public function generate() { | |
| 31 | - $post = get_post( $this->context->id ); | |
| 32 | - $review_author = get_post_meta( $post->ID, 'reviewer_name', true ); | |
| 33 | - $review_email = get_post_meta( $post->ID, 'reviewer_email', true ); | |
| 34 | - $rating_value = get_post_meta( $post->ID, 'rating', true ); | |
| 35 | - $description = wp_strip_all_tags( get_the_content() ); | |
| 36 | - $tour_list = get_post_meta( get_the_ID(), 'tour_to_review', false ); | |
| 37 | - $accom_list = get_post_meta( get_the_ID(), 'accommodation_to_review', false ); | |
| 38 | - $comment_count = get_comment_count( $this->context->id ); | |
| 39 | - $review_author = get_post_meta( $post->ID, 'reviewer_name', true ); | |
| 40 | - $date_of_visit_start = get_post_meta( $post->ID, 'date_of_visit_start', true ); | |
| 41 | - $date_of_visit_end = get_post_meta( $post->ID, 'date_of_visit_end', true ); | |
| 25 | + /** | |
| 26 | + * Returns Review data. | |
| 27 | + * | |
| 28 | + * @return array $data Review data. | |
| 29 | + */ | |
| 30 | +     public function generate() { | |
| 31 | + $post = get_post( $this->context->id ); | |
| 32 | + $review_author = get_post_meta( $post->ID, 'reviewer_name', true ); | |
| 33 | + $review_email = get_post_meta( $post->ID, 'reviewer_email', true ); | |
| 34 | + $rating_value = get_post_meta( $post->ID, 'rating', true ); | |
| 35 | + $description = wp_strip_all_tags( get_the_content() ); | |
| 36 | + $tour_list = get_post_meta( get_the_ID(), 'tour_to_review', false ); | |
| 37 | + $accom_list = get_post_meta( get_the_ID(), 'accommodation_to_review', false ); | |
| 38 | + $comment_count = get_comment_count( $this->context->id ); | |
| 39 | + $review_author = get_post_meta( $post->ID, 'reviewer_name', true ); | |
| 40 | + $date_of_visit_start = get_post_meta( $post->ID, 'date_of_visit_start', true ); | |
| 41 | + $date_of_visit_end = get_post_meta( $post->ID, 'date_of_visit_end', true ); | |
| 42 | 42 | |
| 43 | - $data = array( | |
| 44 | - '@type' => 'Review', | |
| 45 | - '@id' => $this->context->canonical . '#review', | |
| 46 | - 'author' => array( | |
| 47 | - '@type' => 'Person', | |
| 48 | - '@id' => \lsx\legacy\Schema_Utils::get_author_schema_id( $review_author, $review_email, $this->context ), | |
| 49 | - 'name' => $review_author, | |
| 50 | - 'email' => $review_email, | |
| 51 | - ), | |
| 52 | - 'headline' => get_the_title(), | |
| 53 | - 'datePublished' => mysql2date( DATE_W3C, $post->post_date_gmt, false ), | |
| 54 | - 'dateModified' => mysql2date( DATE_W3C, $post->post_modified_gmt, false ), | |
| 55 | - 'commentCount' => $comment_count['approved'], | |
| 56 | - 'mainEntityOfPage' => array( | |
| 57 | - '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH, | |
| 58 | - ), | |
| 59 | - 'reviewRating' => array( | |
| 60 | - '@type' => 'Rating', | |
| 61 | - 'ratingValue' => $rating_value, | |
| 62 | - 'bestRating' => $rating_value, | |
| 63 | - ), | |
| 64 | - 'reviewBody' => $description, | |
| 65 | - 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed( $tour_list, 'Product' ), | |
| 66 | - 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed( $accom_list, 'Product' ), | |
| 67 | - ); | |
| 43 | + $data = array( | |
| 44 | + '@type' => 'Review', | |
| 45 | + '@id' => $this->context->canonical . '#review', | |
| 46 | + 'author' => array( | |
| 47 | + '@type' => 'Person', | |
| 48 | + '@id' => \lsx\legacy\Schema_Utils::get_author_schema_id( $review_author, $review_email, $this->context ), | |
| 49 | + 'name' => $review_author, | |
| 50 | + 'email' => $review_email, | |
| 51 | + ), | |
| 52 | + 'headline' => get_the_title(), | |
| 53 | + 'datePublished' => mysql2date( DATE_W3C, $post->post_date_gmt, false ), | |
| 54 | + 'dateModified' => mysql2date( DATE_W3C, $post->post_modified_gmt, false ), | |
| 55 | + 'commentCount' => $comment_count['approved'], | |
| 56 | + 'mainEntityOfPage' => array( | |
| 57 | + '@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH, | |
| 58 | + ), | |
| 59 | + 'reviewRating' => array( | |
| 60 | + '@type' => 'Rating', | |
| 61 | + 'ratingValue' => $rating_value, | |
| 62 | + 'bestRating' => $rating_value, | |
| 63 | + ), | |
| 64 | + 'reviewBody' => $description, | |
| 65 | + 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed( $tour_list, 'Product' ), | |
| 66 | + 'itemReviewed' => \lsx\legacy\Schema_Utils::get_item_reviewed( $accom_list, 'Product' ), | |
| 67 | + ); | |
| 68 | 68 | |
| 69 | -		if ( $this->context->site_represents_reference ) { | |
| 70 | - $data['publisher'] = $this->context->site_represents_reference; | |
| 71 | - } | |
| 69 | +          if ( $this->context->site_represents_reference ) { | |
| 70 | + $data['publisher'] = $this->context->site_represents_reference; | |
| 71 | + } | |
| 72 | 72 | |
| 73 | -		if ( '' !== $date_of_visit_start && '' !== $date_of_visit_end ) { | |
| 74 | - $data['temporalCoverage'] = $date_of_visit_start . ' - ' . $date_of_visit_end; | |
| 75 | - } | |
| 73 | +          if ( '' !== $date_of_visit_start && '' !== $date_of_visit_end ) { | |
| 74 | + $data['temporalCoverage'] = $date_of_visit_start . ' - ' . $date_of_visit_end; | |
| 75 | + } | |
| 76 | 76 | |
| 77 | - $data = \lsx\legacy\Schema_Utils::add_image( $data, $this->context ); | |
| 78 | - $data = $this->add_taxonomy_terms( $data, 'keywords', 'post_tag' ); | |
| 79 | - $data = $this->add_taxonomy_terms( $data, 'reviewSection', 'category' ); | |
| 80 | - $data = $this->add_offers( $data ); | |
| 81 | - $data = $this->add_destinations( $data ); | |
| 82 | - return $data; | |
| 83 | - } | |
| 77 | + $data = \lsx\legacy\Schema_Utils::add_image( $data, $this->context ); | |
| 78 | + $data = $this->add_taxonomy_terms( $data, 'keywords', 'post_tag' ); | |
| 79 | + $data = $this->add_taxonomy_terms( $data, 'reviewSection', 'category' ); | |
| 80 | + $data = $this->add_offers( $data ); | |
| 81 | + $data = $this->add_destinations( $data ); | |
| 82 | + return $data; | |
| 83 | + } | |
| 84 | 84 | |
| 85 | - /** | |
| 86 | - * Adds the Destinations attached to the review | |
| 87 | - * | |
| 88 | - * @param array $data Country / State data. | |
| 89 | - * | |
| 90 | - * @return array $data Country / State data. | |
| 91 | - */ | |
| 92 | -	public function add_destinations( $data, $data_key = '' ) { | |
| 93 | - $places_array = array(); | |
| 94 | - $destinations = get_post_meta( $this->context->id, 'destination_to_' . $this->post_type, false ); | |
| 95 | -		if ( ! empty( $destinations ) ) { | |
| 96 | -			foreach ( $destinations as $destination_id ) { | |
| 97 | -				if ( '' !== $destination_id ) { | |
| 98 | -					if ( 0 === wp_get_post_parent_id( $destination_id ) || false === wp_get_post_parent_id( $destination_id ) ) { | |
| 99 | - $places_array = \lsx\legacy\Schema_Utils::add_place( $places_array, 'Country', $destination_id, $this->context ); | |
| 100 | -					} else { | |
| 101 | - $places_array = \lsx\legacy\Schema_Utils::add_place( $places_array, 'State', $destination_id, $this->context ); | |
| 102 | - } | |
| 103 | - } | |
| 104 | - } | |
| 105 | - } | |
| 106 | -		if ( ! empty( $places_array ) ) { | |
| 107 | - $data['spatialCoverage'] = $places_array; | |
| 108 | - } | |
| 109 | - return $data; | |
| 110 | - } | |
| 85 | + /** | |
| 86 | + * Adds the Destinations attached to the review | |
| 87 | + * | |
| 88 | + * @param array $data Country / State data. | |
| 89 | + * | |
| 90 | + * @return array $data Country / State data. | |
| 91 | + */ | |
| 92 | +     public function add_destinations( $data, $data_key = '' ) { | |
| 93 | + $places_array = array(); | |
| 94 | + $destinations = get_post_meta( $this->context->id, 'destination_to_' . $this->post_type, false ); | |
| 95 | +          if ( ! empty( $destinations ) ) { | |
| 96 | +               foreach ( $destinations as $destination_id ) { | |
| 97 | +                    if ( '' !== $destination_id ) { | |
| 98 | +                         if ( 0 === wp_get_post_parent_id( $destination_id ) || false === wp_get_post_parent_id( $destination_id ) ) { | |
| 99 | + $places_array = \lsx\legacy\Schema_Utils::add_place( $places_array, 'Country', $destination_id, $this->context ); | |
| 100 | +                         } else { | |
| 101 | + $places_array = \lsx\legacy\Schema_Utils::add_place( $places_array, 'State', $destination_id, $this->context ); | |
| 102 | + } | |
| 103 | + } | |
| 104 | + } | |
| 105 | + } | |
| 106 | +          if ( ! empty( $places_array ) ) { | |
| 107 | + $data['spatialCoverage'] = $places_array; | |
| 108 | + } | |
| 109 | + return $data; | |
| 110 | + } | |
| 111 | 111 | } | 
| @@ -31,22 +31,22 @@ discard block | ||
| 31 | 31 | * @param array $post_types an array of the post types to redirect. | 
| 32 | 32 | * @param array $taxonomies an array of the taxonomies to redirect. | 
| 33 | 33 | */ | 
| 34 | -	public function __construct($plugin_path=false,$post_types=false,$taxonomies=false) { | |
| 35 | -		if(false !== $plugin_path){ | |
| 34 | +	public function __construct($plugin_path = false, $post_types = false, $taxonomies = false) { | |
| 35 | +		if (false !== $plugin_path) { | |
| 36 | 36 | $this->plugin_path = $plugin_path; | 
| 37 | 37 | |
| 38 | - add_filter( 'lsx_to_widget_path', array( $this, 'widget_path'), 10, 2 ); | |
| 39 | - add_filter( 'lsx_to_content_path', array( $this, 'content_path'), 10, 3 ); | |
| 38 | +			add_filter('lsx_to_widget_path', array($this, 'widget_path'), 10, 2); | |
| 39 | +			add_filter('lsx_to_content_path', array($this, 'content_path'), 10, 3); | |
| 40 | 40 | |
| 41 | -			if(false !== $post_types){ | |
| 41 | +			if (false !== $post_types) { | |
| 42 | 42 | $this->post_types = $post_types; | 
| 43 | - add_filter( 'template_include', array( $this, 'post_type_archive_template_include'), 99 ); | |
| 44 | - add_filter( 'template_include', array( $this, 'post_type_single_template_include'), 99 ); | |
| 45 | - add_filter( 'template_include', array( $this, 'search_template_include'), 99 ); | |
| 43 | +				add_filter('template_include', array($this, 'post_type_archive_template_include'), 99); | |
| 44 | +				add_filter('template_include', array($this, 'post_type_single_template_include'), 99);				 | |
| 45 | +				add_filter('template_include', array($this, 'search_template_include'), 99);				 | |
| 46 | 46 | } | 
| 47 | -			if(false !== $taxonomies){ | |
| 47 | +			if (false !== $taxonomies) { | |
| 48 | 48 | $this->taxonomies = $taxonomies; | 
| 49 | - add_filter( 'template_include', array( $this, 'taxonomy_template_include'), 99 ); | |
| 49 | +				add_filter('template_include', array($this, 'taxonomy_template_include'), 99);				 | |
| 50 | 50 | } | 
| 51 | 51 | } | 
| 52 | 52 | } | 
| @@ -57,12 +57,12 @@ discard block | ||
| 57 | 57 | * @param $template | 
| 58 | 58 | * @return $template | 
| 59 | 59 | */ | 
| 60 | -	public function post_type_archive_template_include( $template ) { | |
| 60 | +	public function post_type_archive_template_include($template) { | |
| 61 | 61 | |
| 62 | -		if ( is_main_query() && is_post_type_archive($this->post_types)) { | |
| 62 | +		if (is_main_query() && is_post_type_archive($this->post_types)) { | |
| 63 | 63 | $current_post_type = get_post_type(); | 
| 64 | -			if ( '' == locate_template( array( 'archive-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/archive-'.$current_post_type.'.php' )) { | |
| 65 | - $template = $this->plugin_path.'templates/archive-'.$current_post_type.'.php'; | |
| 64 | +			if ('' == locate_template(array('archive-' . $current_post_type . '.php')) && file_exists($this->plugin_path . 'templates/archive-' . $current_post_type . '.php')) { | |
| 65 | + $template = $this->plugin_path . 'templates/archive-' . $current_post_type . '.php'; | |
| 66 | 66 | } | 
| 67 | 67 | } | 
| 68 | 68 | return $template; | 
| @@ -76,11 +76,11 @@ discard block | ||
| 76 | 76 | * @return $template | 
| 77 | 77 | */ | 
| 78 | 78 |  	public function post_type_single_template_include($template) { | 
| 79 | -		if ( is_main_query() && is_singular($this->post_types) ) { | |
| 79 | +		if (is_main_query() && is_singular($this->post_types)) { | |
| 80 | 80 | $current_post_type = get_post_type(); | 
| 81 | 81 | |
| 82 | -			if ( '' == locate_template( array( 'single-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/single-'.$current_post_type.'.php') ) { | |
| 83 | - $template = $this->plugin_path.'templates/single-'.$current_post_type.'.php'; | |
| 82 | +			if ('' == locate_template(array('single-' . $current_post_type . '.php')) && file_exists($this->plugin_path . 'templates/single-' . $current_post_type . '.php')) { | |
| 83 | + $template = $this->plugin_path . 'templates/single-' . $current_post_type . '.php'; | |
| 84 | 84 | } | 
| 85 | 85 | } | 
| 86 | 86 | return $template; | 
| @@ -95,11 +95,11 @@ discard block | ||
| 95 | 95 | */ | 
| 96 | 96 |  	public function taxonomy_template_include($template) { | 
| 97 | 97 | |
| 98 | -		if ( is_main_query() && is_tax($this->taxonomies) ) { | |
| 98 | +		if (is_main_query() && is_tax($this->taxonomies)) { | |
| 99 | 99 |  			$current_taxonomy = get_query_var('taxonomy'); | 
| 100 | 100 | |
| 101 | -			if ( '' == locate_template( array( 'taxonomy-'.$current_taxonomy.'.php' ) ) && file_exists( $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php') ) { | |
| 102 | - $template = $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php'; | |
| 101 | +			if ('' == locate_template(array('taxonomy-' . $current_taxonomy . '.php')) && file_exists($this->plugin_path . 'templates/taxonomy-' . $current_taxonomy . '.php')) { | |
| 102 | + $template = $this->plugin_path . 'templates/taxonomy-' . $current_taxonomy . '.php'; | |
| 103 | 103 | } | 
| 104 | 104 | } | 
| 105 | 105 | return $template; | 
| @@ -112,11 +112,11 @@ discard block | ||
| 112 | 112 | * | 
| 113 | 113 | * @return $template | 
| 114 | 114 | */ | 
| 115 | -	public function search_template_include( $template ) { | |
| 115 | +	public function search_template_include($template) { | |
| 116 | 116 | |
| 117 | -		if ( is_main_query() && is_search() ) { | |
| 118 | -			if ( file_exists( $this->plugin_path.'templates/search.php' )) { | |
| 119 | - $template = $this->plugin_path.'templates/search.php'; | |
| 117 | +		if (is_main_query() && is_search()) { | |
| 118 | +			if (file_exists($this->plugin_path . 'templates/search.php')) { | |
| 119 | + $template = $this->plugin_path . 'templates/search.php'; | |
| 120 | 120 | } | 
| 121 | 121 | } | 
| 122 | 122 | return $template; | 
| @@ -132,26 +132,26 @@ discard block | ||
| 132 | 132 |  	public function content_part($slug, $name = null) { | 
| 133 | 133 | $template = array(); | 
| 134 | 134 | $name = (string) $name; | 
| 135 | -		if ( '' !== $name ){ | |
| 135 | +		if ('' !== $name) { | |
| 136 | 136 |  			$template = "{$slug}-{$name}.php"; | 
| 137 | -		}else{ | |
| 137 | +		}else { | |
| 138 | 138 |  			$template = "{$slug}.php"; | 
| 139 | 139 | } | 
| 140 | 140 | $original_name = $template; | 
| 141 | -		$path = apply_filters('lsx_to_content_path','',get_post_type()); | |
| 141 | +		$path = apply_filters('lsx_to_content_path', '', get_post_type()); | |
| 142 | 142 | |
| 143 | -		if ( '' == locate_template( array( $template ) ) && file_exists( $path.'templates/'.$template) ) { | |
| 144 | - $template = $path.'templates/'.$template; | |
| 145 | -		}elseif(file_exists( get_stylesheet_directory().'/'.$template)){ | |
| 146 | - $template = get_stylesheet_directory().'/'.$template; | |
| 147 | -		}else{ | |
| 143 | +		if ('' == locate_template(array($template)) && file_exists($path . 'templates/' . $template)) { | |
| 144 | + $template = $path . 'templates/' . $template; | |
| 145 | +		}elseif (file_exists(get_stylesheet_directory() . '/' . $template)) { | |
| 146 | + $template = get_stylesheet_directory() . '/' . $template; | |
| 147 | +		}else { | |
| 148 | 148 | $template = false; | 
| 149 | 149 | } | 
| 150 | 150 | |
| 151 | -		if(false !== $template){ | |
| 152 | - load_template( $template, false ); | |
| 151 | +		if (false !== $template) { | |
| 152 | + load_template($template, false); | |
| 153 | 153 |  		}else { | 
| 154 | -			echo wp_kses_post('<p>No '.$original_name.' can be found.</p>'); | |
| 154 | +			echo wp_kses_post('<p>No ' . $original_name . ' can be found.</p>'); | |
| 155 | 155 | } | 
| 156 | 156 | } | 
| 157 | 157 | |
| @@ -163,9 +163,9 @@ discard block | ||
| 163 | 163 | * | 
| 164 | 164 | * @return $path | 
| 165 | 165 | */ | 
| 166 | -	public function widget_path($path,$slug) { | |
| 167 | - if((false !== $this->post_types && in_array($slug,$this->post_types)) | |
| 168 | -		 || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){ | |
| 166 | +	public function widget_path($path, $slug) { | |
| 167 | + if ((false !== $this->post_types && in_array($slug, $this->post_types)) | |
| 168 | +		 || (false !== $this->taxonomies && in_array($slug, $this->taxonomies)) || 'post' === $slug) { | |
| 169 | 169 | $path = $this->plugin_path; | 
| 170 | 170 | } | 
| 171 | 171 | return $path; | 
| @@ -179,9 +179,9 @@ discard block | ||
| 179 | 179 | * | 
| 180 | 180 | * @return $path | 
| 181 | 181 | */ | 
| 182 | -	public function content_path($path,$slug) { | |
| 183 | - if((false !== $this->post_types && in_array($slug,$this->post_types)) | |
| 184 | -		 || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){ | |
| 182 | +	public function content_path($path, $slug) { | |
| 183 | + if ((false !== $this->post_types && in_array($slug, $this->post_types)) | |
| 184 | +		 || (false !== $this->taxonomies && in_array($slug, $this->taxonomies)) || 'post' === $slug) { | |
| 185 | 185 | $path = $this->plugin_path; | 
| 186 | 186 | } | 
| 187 | 187 | return $path; | 
| @@ -134,7 +134,7 @@ discard block | ||
| 134 | 134 | $name = (string) $name; | 
| 135 | 135 |  		if ( '' !== $name ){ | 
| 136 | 136 |  			$template = "{$slug}-{$name}.php"; | 
| 137 | -		}else{ | |
| 137 | +		} else{ | |
| 138 | 138 |  			$template = "{$slug}.php"; | 
| 139 | 139 | } | 
| 140 | 140 | $original_name = $template; | 
| @@ -142,15 +142,15 @@ discard block | ||
| 142 | 142 | |
| 143 | 143 |  		if ( '' == locate_template( array( $template ) ) && file_exists( $path.'templates/'.$template) ) { | 
| 144 | 144 | $template = $path.'templates/'.$template; | 
| 145 | -		}elseif(file_exists( get_stylesheet_directory().'/'.$template)){ | |
| 145 | +		} elseif(file_exists( get_stylesheet_directory().'/'.$template)){ | |
| 146 | 146 | $template = get_stylesheet_directory().'/'.$template; | 
| 147 | -		}else{ | |
| 147 | +		} else{ | |
| 148 | 148 | $template = false; | 
| 149 | 149 | } | 
| 150 | 150 | |
| 151 | 151 |  		if(false !== $template){ | 
| 152 | 152 | load_template( $template, false ); | 
| 153 | -		}else { | |
| 153 | +		} else { | |
| 154 | 154 |  			echo wp_kses_post('<p>No '.$original_name.' can be found.</p>'); | 
| 155 | 155 | } | 
| 156 | 156 | } | 
| @@ -10,180 +10,180 @@ | ||
| 10 | 10 | |
| 11 | 11 |  class LSX_TO_Template_Redirects { | 
| 12 | 12 | |
| 13 | - /** | |
| 14 | - * Plugin Path | |
| 15 | - */ | |
| 16 | - public $plugin_path = false; | |
| 13 | + /** | |
| 14 | + * Plugin Path | |
| 15 | + */ | |
| 16 | + public $plugin_path = false; | |
| 17 | 17 | |
| 18 | - /** | |
| 19 | - * Post Types | |
| 20 | - */ | |
| 21 | - public $post_types = false; | |
| 18 | + /** | |
| 19 | + * Post Types | |
| 20 | + */ | |
| 21 | + public $post_types = false; | |
| 22 | 22 | |
| 23 | - /** | |
| 24 | - * Taxonomies | |
| 25 | - */ | |
| 26 | - public $taxonomies = false; | |
| 23 | + /** | |
| 24 | + * Taxonomies | |
| 25 | + */ | |
| 26 | + public $taxonomies = false; | |
| 27 | 27 | |
| 28 | - /** | |
| 29 | - * Initialize the plugin by setting localization, filters, and administration functions. | |
| 30 | - * | |
| 31 | - * @param array $post_types an array of the post types to redirect. | |
| 32 | - * @param array $taxonomies an array of the taxonomies to redirect. | |
| 33 | - */ | |
| 34 | -	public function __construct($plugin_path=false,$post_types=false,$taxonomies=false) { | |
| 35 | -		if(false !== $plugin_path){ | |
| 36 | - $this->plugin_path = $plugin_path; | |
| 28 | + /** | |
| 29 | + * Initialize the plugin by setting localization, filters, and administration functions. | |
| 30 | + * | |
| 31 | + * @param array $post_types an array of the post types to redirect. | |
| 32 | + * @param array $taxonomies an array of the taxonomies to redirect. | |
| 33 | + */ | |
| 34 | +     public function __construct($plugin_path=false,$post_types=false,$taxonomies=false) { | |
| 35 | +          if(false !== $plugin_path){ | |
| 36 | + $this->plugin_path = $plugin_path; | |
| 37 | 37 | |
| 38 | - add_filter( 'lsx_to_widget_path', array( $this, 'widget_path'), 10, 2 ); | |
| 39 | - add_filter( 'lsx_to_content_path', array( $this, 'content_path'), 10, 3 ); | |
| 38 | + add_filter( 'lsx_to_widget_path', array( $this, 'widget_path'), 10, 2 ); | |
| 39 | + add_filter( 'lsx_to_content_path', array( $this, 'content_path'), 10, 3 ); | |
| 40 | 40 | |
| 41 | -			if(false !== $post_types){ | |
| 42 | - $this->post_types = $post_types; | |
| 43 | - add_filter( 'template_include', array( $this, 'post_type_archive_template_include'), 99 ); | |
| 44 | - add_filter( 'template_include', array( $this, 'post_type_single_template_include'), 99 ); | |
| 45 | - add_filter( 'template_include', array( $this, 'search_template_include'), 99 ); | |
| 46 | - } | |
| 47 | -			if(false !== $taxonomies){ | |
| 48 | - $this->taxonomies = $taxonomies; | |
| 49 | - add_filter( 'template_include', array( $this, 'taxonomy_template_include'), 99 ); | |
| 50 | - } | |
| 51 | - } | |
| 52 | - } | |
| 41 | +               if(false !== $post_types){ | |
| 42 | + $this->post_types = $post_types; | |
| 43 | + add_filter( 'template_include', array( $this, 'post_type_archive_template_include'), 99 ); | |
| 44 | + add_filter( 'template_include', array( $this, 'post_type_single_template_include'), 99 ); | |
| 45 | + add_filter( 'template_include', array( $this, 'search_template_include'), 99 ); | |
| 46 | + } | |
| 47 | +               if(false !== $taxonomies){ | |
| 48 | + $this->taxonomies = $taxonomies; | |
| 49 | + add_filter( 'template_include', array( $this, 'taxonomy_template_include'), 99 ); | |
| 50 | + } | |
| 51 | + } | |
| 52 | + } | |
| 53 | 53 | |
| 54 | - /** | |
| 55 | - * Redirect wordpress to the archive template located in the plugin | |
| 56 | - * | |
| 57 | - * @param $template | |
| 58 | - * @return $template | |
| 59 | - */ | |
| 60 | -	public function post_type_archive_template_include( $template ) { | |
| 54 | + /** | |
| 55 | + * Redirect wordpress to the archive template located in the plugin | |
| 56 | + * | |
| 57 | + * @param $template | |
| 58 | + * @return $template | |
| 59 | + */ | |
| 60 | +     public function post_type_archive_template_include( $template ) { | |
| 61 | 61 | |
| 62 | -		if ( is_main_query() && is_post_type_archive($this->post_types)) { | |
| 63 | - $current_post_type = get_post_type(); | |
| 64 | -			if ( '' == locate_template( array( 'archive-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/archive-'.$current_post_type.'.php' )) { | |
| 65 | - $template = $this->plugin_path.'templates/archive-'.$current_post_type.'.php'; | |
| 66 | - } | |
| 67 | - } | |
| 68 | - return $template; | |
| 69 | - } | |
| 62 | +          if ( is_main_query() && is_post_type_archive($this->post_types)) { | |
| 63 | + $current_post_type = get_post_type(); | |
| 64 | +               if ( '' == locate_template( array( 'archive-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/archive-'.$current_post_type.'.php' )) { | |
| 65 | + $template = $this->plugin_path.'templates/archive-'.$current_post_type.'.php'; | |
| 66 | + } | |
| 67 | + } | |
| 68 | + return $template; | |
| 69 | + } | |
| 70 | 70 | |
| 71 | - /** | |
| 72 | - * Redirect wordpress to the single template located in the plugin | |
| 73 | - * | |
| 74 | - * @param $template | |
| 75 | - * | |
| 76 | - * @return $template | |
| 77 | - */ | |
| 78 | -	public function post_type_single_template_include($template) { | |
| 79 | -		if ( is_main_query() && is_singular($this->post_types) ) { | |
| 80 | - $current_post_type = get_post_type(); | |
| 71 | + /** | |
| 72 | + * Redirect wordpress to the single template located in the plugin | |
| 73 | + * | |
| 74 | + * @param $template | |
| 75 | + * | |
| 76 | + * @return $template | |
| 77 | + */ | |
| 78 | +     public function post_type_single_template_include($template) { | |
| 79 | +          if ( is_main_query() && is_singular($this->post_types) ) { | |
| 80 | + $current_post_type = get_post_type(); | |
| 81 | 81 | |
| 82 | -			if ( '' == locate_template( array( 'single-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/single-'.$current_post_type.'.php') ) { | |
| 83 | - $template = $this->plugin_path.'templates/single-'.$current_post_type.'.php'; | |
| 84 | - } | |
| 85 | - } | |
| 86 | - return $template; | |
| 87 | - } | |
| 82 | +               if ( '' == locate_template( array( 'single-'.$current_post_type.'.php' ) )	&& file_exists( $this->plugin_path.'templates/single-'.$current_post_type.'.php') ) { | |
| 83 | + $template = $this->plugin_path.'templates/single-'.$current_post_type.'.php'; | |
| 84 | + } | |
| 85 | + } | |
| 86 | + return $template; | |
| 87 | + } | |
| 88 | 88 | |
| 89 | - /** | |
| 90 | - * Redirect wordpress to the taxonomy located in the plugin | |
| 91 | - * | |
| 92 | - * @param $template | |
| 93 | - * | |
| 94 | - * @return $template | |
| 95 | - */ | |
| 96 | -	public function taxonomy_template_include($template) { | |
| 89 | + /** | |
| 90 | + * Redirect wordpress to the taxonomy located in the plugin | |
| 91 | + * | |
| 92 | + * @param $template | |
| 93 | + * | |
| 94 | + * @return $template | |
| 95 | + */ | |
| 96 | +     public function taxonomy_template_include($template) { | |
| 97 | 97 | |
| 98 | -		if ( is_main_query() && is_tax($this->taxonomies) ) { | |
| 99 | -			$current_taxonomy = get_query_var('taxonomy'); | |
| 98 | +          if ( is_main_query() && is_tax($this->taxonomies) ) { | |
| 99 | +               $current_taxonomy = get_query_var('taxonomy'); | |
| 100 | 100 | |
| 101 | -			if ( '' == locate_template( array( 'taxonomy-'.$current_taxonomy.'.php' ) ) && file_exists( $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php') ) { | |
| 102 | - $template = $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php'; | |
| 103 | - } | |
| 104 | - } | |
| 105 | - return $template; | |
| 106 | - } | |
| 101 | +               if ( '' == locate_template( array( 'taxonomy-'.$current_taxonomy.'.php' ) ) && file_exists( $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php') ) { | |
| 102 | + $template = $this->plugin_path.'templates/taxonomy-'.$current_taxonomy.'.php'; | |
| 103 | + } | |
| 104 | + } | |
| 105 | + return $template; | |
| 106 | + } | |
| 107 | 107 | |
| 108 | - /** | |
| 109 | - * Redirect wordpress to the search template located in the plugin | |
| 110 | - * | |
| 111 | - * @param $template | |
| 112 | - * | |
| 113 | - * @return $template | |
| 114 | - */ | |
| 115 | -	public function search_template_include( $template ) { | |
| 108 | + /** | |
| 109 | + * Redirect wordpress to the search template located in the plugin | |
| 110 | + * | |
| 111 | + * @param $template | |
| 112 | + * | |
| 113 | + * @return $template | |
| 114 | + */ | |
| 115 | +     public function search_template_include( $template ) { | |
| 116 | 116 | |
| 117 | -		if ( is_main_query() && is_search() ) { | |
| 118 | -			if ( file_exists( $this->plugin_path.'templates/search.php' )) { | |
| 119 | - $template = $this->plugin_path.'templates/search.php'; | |
| 120 | - } | |
| 121 | - } | |
| 122 | - return $template; | |
| 123 | - } | |
| 117 | +          if ( is_main_query() && is_search() ) { | |
| 118 | +               if ( file_exists( $this->plugin_path.'templates/search.php' )) { | |
| 119 | + $template = $this->plugin_path.'templates/search.php'; | |
| 120 | + } | |
| 121 | + } | |
| 122 | + return $template; | |
| 123 | + } | |
| 124 | 124 | |
| 125 | - /** | |
| 126 | - * Redirect wordpress to the single template located in the plugin | |
| 127 | - * | |
| 128 | - * @param $template | |
| 129 | - * | |
| 130 | - * @return $template | |
| 131 | - */ | |
| 132 | -	public function content_part($slug, $name = null) { | |
| 133 | - $template = array(); | |
| 134 | - $name = (string) $name; | |
| 135 | -		if ( '' !== $name ){ | |
| 136 | -			$template = "{$slug}-{$name}.php"; | |
| 137 | -		}else{ | |
| 138 | -			$template = "{$slug}.php"; | |
| 139 | - } | |
| 140 | - $original_name = $template; | |
| 141 | -		$path = apply_filters('lsx_to_content_path','',get_post_type()); | |
| 125 | + /** | |
| 126 | + * Redirect wordpress to the single template located in the plugin | |
| 127 | + * | |
| 128 | + * @param $template | |
| 129 | + * | |
| 130 | + * @return $template | |
| 131 | + */ | |
| 132 | +     public function content_part($slug, $name = null) { | |
| 133 | + $template = array(); | |
| 134 | + $name = (string) $name; | |
| 135 | +          if ( '' !== $name ){ | |
| 136 | +               $template = "{$slug}-{$name}.php"; | |
| 137 | +          }else{ | |
| 138 | +               $template = "{$slug}.php"; | |
| 139 | + } | |
| 140 | + $original_name = $template; | |
| 141 | +          $path = apply_filters('lsx_to_content_path','',get_post_type()); | |
| 142 | 142 | |
| 143 | -		if ( '' == locate_template( array( $template ) ) && file_exists( $path.'templates/'.$template) ) { | |
| 144 | - $template = $path.'templates/'.$template; | |
| 145 | -		}elseif(file_exists( get_stylesheet_directory().'/'.$template)){ | |
| 146 | - $template = get_stylesheet_directory().'/'.$template; | |
| 147 | -		}else{ | |
| 148 | - $template = false; | |
| 149 | - } | |
| 143 | +          if ( '' == locate_template( array( $template ) ) && file_exists( $path.'templates/'.$template) ) { | |
| 144 | + $template = $path.'templates/'.$template; | |
| 145 | +          }elseif(file_exists( get_stylesheet_directory().'/'.$template)){ | |
| 146 | + $template = get_stylesheet_directory().'/'.$template; | |
| 147 | +          }else{ | |
| 148 | + $template = false; | |
| 149 | + } | |
| 150 | 150 | |
| 151 | -		if(false !== $template){ | |
| 152 | - load_template( $template, false ); | |
| 153 | -		}else { | |
| 154 | -			echo wp_kses_post('<p>No '.$original_name.' can be found.</p>'); | |
| 155 | - } | |
| 156 | - } | |
| 151 | +          if(false !== $template){ | |
| 152 | + load_template( $template, false ); | |
| 153 | +          }else { | |
| 154 | +               echo wp_kses_post('<p>No '.$original_name.' can be found.</p>'); | |
| 155 | + } | |
| 156 | + } | |
| 157 | 157 | |
| 158 | - /** | |
| 159 | - * Redirect wordpress to the widget template located in the plugin | |
| 160 | - * | |
| 161 | - * @param $path | |
| 162 | - * @param $post_type | |
| 163 | - * | |
| 164 | - * @return $path | |
| 165 | - */ | |
| 166 | -	public function widget_path($path,$slug) { | |
| 167 | - if((false !== $this->post_types && in_array($slug,$this->post_types)) | |
| 168 | -		 || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){ | |
| 169 | - $path = $this->plugin_path; | |
| 170 | - } | |
| 171 | - return $path; | |
| 172 | - } | |
| 158 | + /** | |
| 159 | + * Redirect wordpress to the widget template located in the plugin | |
| 160 | + * | |
| 161 | + * @param $path | |
| 162 | + * @param $post_type | |
| 163 | + * | |
| 164 | + * @return $path | |
| 165 | + */ | |
| 166 | +     public function widget_path($path,$slug) { | |
| 167 | + if((false !== $this->post_types && in_array($slug,$this->post_types)) | |
| 168 | +           || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){ | |
| 169 | + $path = $this->plugin_path; | |
| 170 | + } | |
| 171 | + return $path; | |
| 172 | + } | |
| 173 | 173 | |
| 174 | - /** | |
| 175 | - * Redirect wordpress to the single template located in the plugin | |
| 176 | - * | |
| 177 | - * @param $path | |
| 178 | - * @param $post_type | |
| 179 | - * | |
| 180 | - * @return $path | |
| 181 | - */ | |
| 182 | -	public function content_path($path,$slug) { | |
| 183 | - if((false !== $this->post_types && in_array($slug,$this->post_types)) | |
| 184 | -		 || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){ | |
| 185 | - $path = $this->plugin_path; | |
| 186 | - } | |
| 187 | - return $path; | |
| 188 | - } | |
| 174 | + /** | |
| 175 | + * Redirect wordpress to the single template located in the plugin | |
| 176 | + * | |
| 177 | + * @param $path | |
| 178 | + * @param $post_type | |
| 179 | + * | |
| 180 | + * @return $path | |
| 181 | + */ | |
| 182 | +     public function content_path($path,$slug) { | |
| 183 | + if((false !== $this->post_types && in_array($slug,$this->post_types)) | |
| 184 | +           || (false !== $this->taxonomies && in_array($slug,$this->taxonomies)) || 'post' === $slug){ | |
| 185 | + $path = $this->plugin_path; | |
| 186 | + } | |
| 187 | + return $path; | |
| 188 | + } | |
| 189 | 189 | } | 
| 190 | 190 | \ No newline at end of file |