@@ -98,69 +98,69 @@ |
||
98 | 98 | if ( ! empty($post_types) ) { |
99 | 99 | foreach ( $post_types as $post_type_key => $post_type_value ) { |
100 | 100 | switch ( $post_type_key ) { |
101 | - case 'post': |
|
102 | - $page_url = home_url(); |
|
103 | - $page_title = __('Home', 'lsx-search'); |
|
104 | - $show_on_front = get_option('show_on_front'); |
|
105 | - if ( 'page' === $show_on_front ) { |
|
106 | - $page_for_posts = get_option('page_for_posts'); |
|
107 | - if ( '' !== $page_for_posts ) { |
|
108 | - $page_title = get_the_title($page_for_posts); |
|
109 | - $page_url = get_permalink($page_for_posts); |
|
110 | - } |
|
111 | - } |
|
112 | - $description = sprintf( |
|
113 | - /* translators: %s: The subscription info */ |
|
114 | - __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> posts.', 'lsx-search'), |
|
115 | - $page_url, |
|
116 | - $page_title |
|
117 | - ); |
|
118 | - $archives[ $post_type_key ] = array( |
|
119 | - 'title' => __('Blog', 'lsx-search'), |
|
120 | - 'desc' => $description, |
|
121 | - ); |
|
122 | - break; |
|
101 | + case 'post': |
|
102 | + $page_url = home_url(); |
|
103 | + $page_title = __('Home', 'lsx-search'); |
|
104 | + $show_on_front = get_option('show_on_front'); |
|
105 | + if ( 'page' === $show_on_front ) { |
|
106 | + $page_for_posts = get_option('page_for_posts'); |
|
107 | + if ( '' !== $page_for_posts ) { |
|
108 | + $page_title = get_the_title($page_for_posts); |
|
109 | + $page_url = get_permalink($page_for_posts); |
|
110 | + } |
|
111 | + } |
|
112 | + $description = sprintf( |
|
113 | + /* translators: %s: The subscription info */ |
|
114 | + __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> posts.', 'lsx-search'), |
|
115 | + $page_url, |
|
116 | + $page_title |
|
117 | + ); |
|
118 | + $archives[ $post_type_key ] = array( |
|
119 | + 'title' => __('Blog', 'lsx-search'), |
|
120 | + 'desc' => $description, |
|
121 | + ); |
|
122 | + break; |
|
123 | 123 | |
124 | - case 'product': |
|
125 | - $page_url = home_url(); |
|
126 | - $page_title = __('Shop', 'lsx-search'); |
|
127 | - if ( function_exists('wc_get_page_id') ) { |
|
128 | - $shop_page = wc_get_page_id('shop'); |
|
129 | - $page_url = get_permalink($shop_page); |
|
130 | - $page_title = get_the_title($shop_page); |
|
131 | - } |
|
132 | - $description = sprintf( |
|
133 | - /* translators: %s: The subscription info */ |
|
134 | - __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> product pages.', 'lsx-search'), |
|
135 | - $page_url, |
|
136 | - $page_title |
|
137 | - ); |
|
138 | - $archives[ $post_type_key ] = array( |
|
139 | - 'title' => __('Shop', 'lsx-search'), |
|
140 | - 'desc' => $description, |
|
141 | - ); |
|
142 | - break; |
|
124 | + case 'product': |
|
125 | + $page_url = home_url(); |
|
126 | + $page_title = __('Shop', 'lsx-search'); |
|
127 | + if ( function_exists('wc_get_page_id') ) { |
|
128 | + $shop_page = wc_get_page_id('shop'); |
|
129 | + $page_url = get_permalink($shop_page); |
|
130 | + $page_title = get_the_title($shop_page); |
|
131 | + } |
|
132 | + $description = sprintf( |
|
133 | + /* translators: %s: The subscription info */ |
|
134 | + __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> product pages.', 'lsx-search'), |
|
135 | + $page_url, |
|
136 | + $page_title |
|
137 | + ); |
|
138 | + $archives[ $post_type_key ] = array( |
|
139 | + 'title' => __('Shop', 'lsx-search'), |
|
140 | + 'desc' => $description, |
|
141 | + ); |
|
142 | + break; |
|
143 | 143 | |
144 | - default: |
|
145 | - if ( in_array($post_type_key, \lsx\sharing\includes\functions\get_restricted_post_types()) ) { |
|
146 | - break; |
|
147 | - } |
|
148 | - $temp_post_type = get_post_type_object($post_type_key); |
|
149 | - if ( ! is_wp_error($temp_post_type) ) { |
|
150 | - $page_url = get_post_type_archive_link($temp_post_type->name); |
|
151 | - $description = sprintf( |
|
152 | - /* translators: %s: The subscription info */ |
|
153 | - __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> singles.', 'lsx-search'), |
|
154 | - $page_url, |
|
155 | - $temp_post_type->label |
|
156 | - ); |
|
144 | + default: |
|
145 | + if ( in_array($post_type_key, \lsx\sharing\includes\functions\get_restricted_post_types()) ) { |
|
146 | + break; |
|
147 | + } |
|
148 | + $temp_post_type = get_post_type_object($post_type_key); |
|
149 | + if ( ! is_wp_error($temp_post_type) ) { |
|
150 | + $page_url = get_post_type_archive_link($temp_post_type->name); |
|
151 | + $description = sprintf( |
|
152 | + /* translators: %s: The subscription info */ |
|
153 | + __('Control the filters which show on your <a target="_blank" href="%1$s">%2$s</a> singles.', 'lsx-search'), |
|
154 | + $page_url, |
|
155 | + $temp_post_type->label |
|
156 | + ); |
|
157 | 157 | |
158 | - $archives[ $post_type_key ] = array( |
|
159 | - 'title' => $temp_post_type->label, |
|
160 | - 'desc' => $description, |
|
161 | - ); |
|
162 | - } |
|
163 | - break; |
|
158 | + $archives[ $post_type_key ] = array( |
|
159 | + 'title' => $temp_post_type->label, |
|
160 | + 'desc' => $description, |
|
161 | + ); |
|
162 | + } |
|
163 | + break; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | } |