forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
2,804 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* Dataviews custom post type and taxonomy. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* Registers the `wp_dataviews` post type and the `wp_dataviews_type` taxonomy. | ||
*/ | ||
function _gutenberg_register_data_views_post_type() { | ||
register_post_type( | ||
'wp_dataviews', | ||
array( | ||
'label' => _x( 'Dataviews', 'post type general name', 'gutenberg' ), | ||
'description' => __( 'Post which stores the different data views configurations', 'gutenberg' ), | ||
'public' => false, | ||
'show_ui' => false, | ||
'show_in_rest' => true, | ||
'rewrite' => false, | ||
'capabilities' => array( | ||
'read' => 'edit_published_posts', | ||
// 'create_posts' => 'edit_published_posts', | ||
// 'edit_posts' => 'edit_published_posts', | ||
// 'edit_published_posts' => 'edit_published_posts', | ||
// 'delete_published_posts' => 'delete_published_posts', | ||
// 'edit_others_posts' => 'edit_others_posts', | ||
// 'delete_others_posts' => 'edit_theme_options', | ||
), | ||
'map_meta_cap' => true, | ||
'supports' => array( 'title', 'slug', 'editor' ), | ||
) | ||
); | ||
|
||
register_taxonomy( | ||
'wp_dataviews_type', | ||
array( 'wp_dataviews' ), | ||
array( | ||
'public' => true, | ||
'hierarchical' => false, | ||
'labels' => array( | ||
'name' => __( 'Dataview types', 'gutenberg' ), | ||
'singular_name' => __( 'Dataview type', 'gutenberg' ), | ||
), | ||
'rewrite' => false, | ||
'show_ui' => false, | ||
'show_in_nav_menus' => false, | ||
'show_in_rest' => true, | ||
) | ||
); | ||
} | ||
|
||
add_action( 'init', '_gutenberg_register_data_views_post_type' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.