| @@ 179-226 (lines=48) @@ | ||
| 176 | } |
|
| 177 | } |
|
| 178 | ||
| 179 | function register_post_types() { |
|
| 180 | if ( post_type_exists( self::MENU_ITEM_POST_TYPE ) ) { |
|
| 181 | return; |
|
| 182 | } |
|
| 183 | ||
| 184 | register_post_type( self::MENU_ITEM_POST_TYPE, array( |
|
| 185 | 'description' => __( "Items on your restaurant's menu", 'jetpack' ), |
|
| 186 | ||
| 187 | 'labels' => array( |
|
| 188 | 'name' => __( 'Menu Items', 'jetpack' ), |
|
| 189 | 'singular_name' => __( 'Menu Item', 'jetpack' ), |
|
| 190 | 'menu_name' => __( 'Food Menus', 'jetpack' ), |
|
| 191 | 'all_items' => __( 'Menu Items', 'jetpack' ), |
|
| 192 | 'add_new' => __( 'Add One Item', 'jetpack' ), |
|
| 193 | 'add_new_item' => __( 'Add Menu Item', 'jetpack' ), |
|
| 194 | 'edit_item' => __( 'Edit Menu Item', 'jetpack' ), |
|
| 195 | 'new_item' => __( 'New Menu Item', 'jetpack' ), |
|
| 196 | 'view_item' => __( 'View Menu Item', 'jetpack' ), |
|
| 197 | 'search_items' => __( 'Search Menu Items', 'jetpack' ), |
|
| 198 | 'not_found' => __( 'No Menu Items found', 'jetpack' ), |
|
| 199 | 'not_found_in_trash' => __( 'No Menu Items found in Trash', 'jetpack' ), |
|
| 200 | 'filter_items_list' => __( 'Filter menu items list', 'jetpack' ), |
|
| 201 | 'items_list_navigation' => __( 'Menu item list navigation', 'jetpack' ), |
|
| 202 | 'items_list' => __( 'Menu items list', 'jetpack' ), |
|
| 203 | ), |
|
| 204 | 'supports' => array( |
|
| 205 | 'title', |
|
| 206 | 'editor', |
|
| 207 | 'thumbnail', |
|
| 208 | 'excerpt', |
|
| 209 | ), |
|
| 210 | 'rewrite' => array( |
|
| 211 | 'slug' => 'item', |
|
| 212 | 'with_front' => false, |
|
| 213 | 'feeds' => false, |
|
| 214 | 'pages' => false, |
|
| 215 | ), |
|
| 216 | 'register_meta_box_cb' => array( $this, 'register_menu_item_meta_boxes' ), |
|
| 217 | ||
| 218 | 'public' => true, |
|
| 219 | 'show_ui' => true, // set to false to replace with custom UI |
|
| 220 | 'menu_position' => 20, // below Pages |
|
| 221 | 'capability_type' => 'page', |
|
| 222 | 'map_meta_cap' => true, |
|
| 223 | 'has_archive' => false, |
|
| 224 | 'query_var' => 'item', |
|
| 225 | ) ); |
|
| 226 | } |
|
| 227 | ||
| 228 | ||
| 229 | /** |
|
| @@ 283-328 (lines=46) @@ | ||
| 280 | /** |
|
| 281 | * Register Post Type |
|
| 282 | */ |
|
| 283 | function register_post_types() { |
|
| 284 | if ( post_type_exists( self::CUSTOM_POST_TYPE ) ) { |
|
| 285 | return; |
|
| 286 | } |
|
| 287 | ||
| 288 | register_post_type( self::CUSTOM_POST_TYPE, array( |
|
| 289 | 'description' => __( 'Customer Testimonials', 'jetpack' ), |
|
| 290 | 'labels' => array( |
|
| 291 | 'name' => esc_html__( 'Testimonials', 'jetpack' ), |
|
| 292 | 'singular_name' => esc_html__( 'Testimonial', 'jetpack' ), |
|
| 293 | 'menu_name' => esc_html__( 'Testimonials', 'jetpack' ), |
|
| 294 | 'all_items' => esc_html__( 'All Testimonials', 'jetpack' ), |
|
| 295 | 'add_new' => esc_html__( 'Add New', 'jetpack' ), |
|
| 296 | 'add_new_item' => esc_html__( 'Add New Testimonial', 'jetpack' ), |
|
| 297 | 'edit_item' => esc_html__( 'Edit Testimonial', 'jetpack' ), |
|
| 298 | 'new_item' => esc_html__( 'New Testimonial', 'jetpack' ), |
|
| 299 | 'view_item' => esc_html__( 'View Testimonial', 'jetpack' ), |
|
| 300 | 'search_items' => esc_html__( 'Search Testimonials', 'jetpack' ), |
|
| 301 | 'not_found' => esc_html__( 'No Testimonials found', 'jetpack' ), |
|
| 302 | 'not_found_in_trash' => esc_html__( 'No Testimonials found in Trash', 'jetpack' ), |
|
| 303 | 'filter_items_list' => esc_html__( 'Filter Testimonials list', 'jetpack' ), |
|
| 304 | 'items_list_navigation' => esc_html__( 'Testimonial list navigation', 'jetpack' ), |
|
| 305 | 'items_list' => esc_html__( 'Testimonials list', 'jetpack' ), |
|
| 306 | ), |
|
| 307 | 'supports' => array( |
|
| 308 | 'title', |
|
| 309 | 'editor', |
|
| 310 | 'thumbnail', |
|
| 311 | 'page-attributes', |
|
| 312 | ), |
|
| 313 | 'rewrite' => array( |
|
| 314 | 'slug' => 'testimonial', |
|
| 315 | 'with_front' => false, |
|
| 316 | 'feeds' => false, |
|
| 317 | 'pages' => true, |
|
| 318 | ), |
|
| 319 | 'public' => true, |
|
| 320 | 'show_ui' => true, |
|
| 321 | 'menu_position' => 20, // below Pages |
|
| 322 | 'menu_icon' => 'dashicons-testimonial', |
|
| 323 | 'capability_type' => 'page', |
|
| 324 | 'map_meta_cap' => true, |
|
| 325 | 'has_archive' => true, |
|
| 326 | 'query_var' => 'testimonial', |
|
| 327 | ) ); |
|
| 328 | } |
|
| 329 | ||
| 330 | /** |
|
| 331 | * Update messages for the Testimonial admin. |
|