@@ 287-334 (lines=48) @@ | ||
284 | /** |
|
285 | * Register Post Type |
|
286 | */ |
|
287 | function register_post_types() { |
|
288 | if ( post_type_exists( self::CUSTOM_POST_TYPE ) ) { |
|
289 | return; |
|
290 | } |
|
291 | ||
292 | register_post_type( self::CUSTOM_POST_TYPE, array( |
|
293 | 'description' => __( 'Customer Testimonials', 'jetpack' ), |
|
294 | 'labels' => array( |
|
295 | 'name' => esc_html__( 'Testimonials', 'jetpack' ), |
|
296 | 'singular_name' => esc_html__( 'Testimonial', 'jetpack' ), |
|
297 | 'menu_name' => esc_html__( 'Testimonials', 'jetpack' ), |
|
298 | 'all_items' => esc_html__( 'All Testimonials', 'jetpack' ), |
|
299 | 'add_new' => esc_html__( 'Add New', 'jetpack' ), |
|
300 | 'add_new_item' => esc_html__( 'Add New Testimonial', 'jetpack' ), |
|
301 | 'edit_item' => esc_html__( 'Edit Testimonial', 'jetpack' ), |
|
302 | 'new_item' => esc_html__( 'New Testimonial', 'jetpack' ), |
|
303 | 'view_item' => esc_html__( 'View Testimonial', 'jetpack' ), |
|
304 | 'search_items' => esc_html__( 'Search Testimonials', 'jetpack' ), |
|
305 | 'not_found' => esc_html__( 'No Testimonials found', 'jetpack' ), |
|
306 | 'not_found_in_trash' => esc_html__( 'No Testimonials found in Trash', 'jetpack' ), |
|
307 | 'filter_items_list' => esc_html__( 'Filter Testimonials list', 'jetpack' ), |
|
308 | 'items_list_navigation' => esc_html__( 'Testimonial list navigation', 'jetpack' ), |
|
309 | 'items_list' => esc_html__( 'Testimonials list', 'jetpack' ), |
|
310 | ), |
|
311 | 'supports' => array( |
|
312 | 'title', |
|
313 | 'editor', |
|
314 | 'thumbnail', |
|
315 | 'page-attributes', |
|
316 | 'revisions', |
|
317 | ), |
|
318 | 'rewrite' => array( |
|
319 | 'slug' => 'testimonial', |
|
320 | 'with_front' => false, |
|
321 | 'feeds' => false, |
|
322 | 'pages' => true, |
|
323 | ), |
|
324 | 'public' => true, |
|
325 | 'show_ui' => true, |
|
326 | 'menu_position' => 20, // below Pages |
|
327 | 'menu_icon' => 'dashicons-testimonial', |
|
328 | 'capability_type' => 'page', |
|
329 | 'map_meta_cap' => true, |
|
330 | 'has_archive' => true, |
|
331 | 'query_var' => 'testimonial', |
|
332 | 'show_in_rest' => true, |
|
333 | ) ); |
|
334 | } |
|
335 | ||
336 | /** |
|
337 | * Update messages for the Testimonial admin. |
@@ 199-258 (lines=60) @@ | ||
196 | } |
|
197 | } |
|
198 | ||
199 | function register_post_types() { |
|
200 | if ( post_type_exists( self::MENU_ITEM_POST_TYPE ) ) { |
|
201 | return; |
|
202 | } |
|
203 | ||
204 | register_post_type( self::MENU_ITEM_POST_TYPE, array( |
|
205 | 'description' => __( "Items on your restaurant's menu", 'jetpack' ), |
|
206 | ||
207 | 'labels' => array( |
|
208 | /* translators: this is about a food menu */ |
|
209 | 'name' => __( 'Menu Items', 'jetpack' ), |
|
210 | /* translators: this is about a food menu */ |
|
211 | 'singular_name' => __( 'Menu Item', 'jetpack' ), |
|
212 | /* translators: this is about a food menu */ |
|
213 | 'menu_name' => __( 'Food Menus', 'jetpack' ), |
|
214 | /* translators: this is about a food menu */ |
|
215 | 'all_items' => __( 'Menu Items', 'jetpack' ), |
|
216 | /* translators: this is about a food menu */ |
|
217 | 'add_new' => __( 'Add One Item', 'jetpack' ), |
|
218 | /* translators: this is about a food menu */ |
|
219 | 'add_new_item' => __( 'Add Menu Item', 'jetpack' ), |
|
220 | /* translators: this is about a food menu */ |
|
221 | 'edit_item' => __( 'Edit Menu Item', 'jetpack' ), |
|
222 | /* translators: this is about a food menu */ |
|
223 | 'new_item' => __( 'New Menu Item', 'jetpack' ), |
|
224 | /* translators: this is about a food menu */ |
|
225 | 'view_item' => __( 'View Menu Item', 'jetpack' ), |
|
226 | /* translators: this is about a food menu */ |
|
227 | 'search_items' => __( 'Search Menu Items', 'jetpack' ), |
|
228 | /* translators: this is about a food menu */ |
|
229 | 'not_found' => __( 'No Menu Items found', 'jetpack' ), |
|
230 | /* translators: this is about a food menu */ |
|
231 | 'not_found_in_trash' => __( 'No Menu Items found in Trash', 'jetpack' ), |
|
232 | 'filter_items_list' => __( 'Filter menu items list', 'jetpack' ), |
|
233 | 'items_list_navigation' => __( 'Menu item list navigation', 'jetpack' ), |
|
234 | 'items_list' => __( 'Menu items list', 'jetpack' ), |
|
235 | ), |
|
236 | 'supports' => array( |
|
237 | 'title', |
|
238 | 'editor', |
|
239 | 'thumbnail', |
|
240 | 'excerpt', |
|
241 | ), |
|
242 | 'rewrite' => array( |
|
243 | 'slug' => 'item', |
|
244 | 'with_front' => false, |
|
245 | 'feeds' => false, |
|
246 | 'pages' => false, |
|
247 | ), |
|
248 | 'register_meta_box_cb' => array( $this, 'register_menu_item_meta_boxes' ), |
|
249 | ||
250 | 'public' => true, |
|
251 | 'show_ui' => true, // set to false to replace with custom UI |
|
252 | 'menu_position' => 20, // below Pages |
|
253 | 'capability_type' => 'page', |
|
254 | 'map_meta_cap' => true, |
|
255 | 'has_archive' => false, |
|
256 | 'query_var' => 'item', |
|
257 | ) ); |
|
258 | } |
|
259 | ||
260 | ||
261 | /** |