| |
| <?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| defined( 'ABSPATH' ) || exit;
|
|
|
| add_action( 'init', function() {
|
| $labels = [
|
| 'name' => 'GravityView Views',
|
| 'singular_name' => 'View',
|
| 'menu_name' => 'GV Views Sync',
|
| 'all_items' => 'All Views',
|
| 'add_new' => 'Add New',
|
| 'add_new_item' => 'Add New View',
|
| 'edit_item' => 'Edit View',
|
| 'new_item' => 'New View',
|
| 'view_item' => 'View Details',
|
| 'search_items' => 'Search Views',
|
| 'not_found' => 'No views found',
|
| 'not_found_in_trash' => 'No views found in Trash',
|
| 'item_updated' => 'View updated',
|
| ];
|
|
|
| register_post_type( 'gv_views_sync', [
|
| 'labels' => $labels,
|
| 'description' => 'GravityView configurations with layouts, settings, and field mappings',
|
| 'public' => false,
|
| 'show_ui' => true,
|
| 'show_in_menu' => true,
|
| 'menu_position' => 32,
|
| 'menu_icon' => 'dashicons-editor-table',
|
|
|
|
|
| 'show_in_rest' => true,
|
| 'rest_base' => 'gv-views-sync',
|
| 'rest_controller_class' => 'WP_REST_Posts_Controller',
|
|
|
|
|
| 'capability_type' => 'post',
|
| 'map_meta_cap' => true,
|
|
|
|
|
| 'supports' => [ 'title', 'custom-fields', 'revisions' ],
|
| 'hierarchical' => false,
|
| 'has_archive' => false,
|
| 'rewrite' => false,
|
| 'query_var' => true,
|
| 'exclude_from_search' => true,
|
| 'can_export' => true,
|
| 'delete_with_user' => false,
|
| ] );
|
| } );
|
| |
| |
Comments