| @@ 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 | /** |
|
| @@ 292-339 (lines=48) @@ | ||
| 289 | /** |
|
| 290 | * Register Post Type |
|
| 291 | */ |
|
| 292 | function register_post_types() { |
|
| 293 | if ( post_type_exists( self::CUSTOM_POST_TYPE ) ) { |
|
| 294 | return; |
|
| 295 | } |
|
| 296 | ||
| 297 | register_post_type( self::CUSTOM_POST_TYPE, array( |
|
| 298 | 'description' => __( 'Customer Testimonials', 'jetpack' ), |
|
| 299 | 'labels' => array( |
|
| 300 | 'name' => esc_html__( 'Testimonials', 'jetpack' ), |
|
| 301 | 'singular_name' => esc_html__( 'Testimonial', 'jetpack' ), |
|
| 302 | 'menu_name' => esc_html__( 'Testimonials', 'jetpack' ), |
|
| 303 | 'all_items' => esc_html__( 'All Testimonials', 'jetpack' ), |
|
| 304 | 'add_new' => esc_html__( 'Add New', 'jetpack' ), |
|
| 305 | 'add_new_item' => esc_html__( 'Add New Testimonial', 'jetpack' ), |
|
| 306 | 'edit_item' => esc_html__( 'Edit Testimonial', 'jetpack' ), |
|
| 307 | 'new_item' => esc_html__( 'New Testimonial', 'jetpack' ), |
|
| 308 | 'view_item' => esc_html__( 'View Testimonial', 'jetpack' ), |
|
| 309 | 'search_items' => esc_html__( 'Search Testimonials', 'jetpack' ), |
|
| 310 | 'not_found' => esc_html__( 'No Testimonials found', 'jetpack' ), |
|
| 311 | 'not_found_in_trash' => esc_html__( 'No Testimonials found in Trash', 'jetpack' ), |
|
| 312 | 'filter_items_list' => esc_html__( 'Filter Testimonials list', 'jetpack' ), |
|
| 313 | 'items_list_navigation' => esc_html__( 'Testimonial list navigation', 'jetpack' ), |
|
| 314 | 'items_list' => esc_html__( 'Testimonials list', 'jetpack' ), |
|
| 315 | ), |
|
| 316 | 'supports' => array( |
|
| 317 | 'title', |
|
| 318 | 'editor', |
|
| 319 | 'thumbnail', |
|
| 320 | 'page-attributes', |
|
| 321 | 'revisions', |
|
| 322 | ), |
|
| 323 | 'rewrite' => array( |
|
| 324 | 'slug' => 'testimonial', |
|
| 325 | 'with_front' => false, |
|
| 326 | 'feeds' => false, |
|
| 327 | 'pages' => true, |
|
| 328 | ), |
|
| 329 | 'public' => true, |
|
| 330 | 'show_ui' => true, |
|
| 331 | 'menu_position' => 20, // below Pages |
|
| 332 | 'menu_icon' => 'dashicons-testimonial', |
|
| 333 | 'capability_type' => 'page', |
|
| 334 | 'map_meta_cap' => true, |
|
| 335 | 'has_archive' => true, |
|
| 336 | 'query_var' => 'testimonial', |
|
| 337 | 'show_in_rest' => true, |
|
| 338 | ) ); |
|
| 339 | } |
|
| 340 | ||
| 341 | /** |
|
| 342 | * Update messages for the Testimonial admin. |
|