Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Metabox Support. #2804

Merged
merged 5 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add @SInCE to the PHP docblocks
  • Loading branch information
pento committed Oct 19, 2017
commit 212d90d20513db01986df38e839130c01a708df1
14 changes: 14 additions & 0 deletions lib/meta-box-partial-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Renders a partial page of meta boxes.
*
* @since 1.5.0
*
* @param string $post_type Current post type.
* @param string $meta_box_context The context location of the meta box. Referred to as context in core.
Expand Down Expand Up @@ -134,6 +136,8 @@ function gutenberg_meta_box_partial_page( $post_type, $meta_box_context ) {
* The partial page needs to imitate aspects of admin-header.php.
*
* See wp-admin/admin-header.php at around line 70.
*
* @since 1.5.0
*
* @param string $hook_suffix Page hook suffix.
* @param WP_Screen $current_screen Current screen object.
Expand Down Expand Up @@ -328,6 +332,8 @@ function gutenberg_meta_box_partial_page_admin_header( $hook_suffix, $current_sc
* This matches the portion of creating a form found in edit-form-advanced.php.
*
* Code starts roughly around line 500.
*
* @since 1.5.0
*
* @param WP_Post $post Current post object.
* @param string $location Metabox location: one of 'normal', 'advanced', 'side'.
Expand Down Expand Up @@ -418,6 +424,8 @@ function gutenberg_meta_box_partial_page_post_form( $post, $location ) {

/**
* This matches the portion of creating a form found in edit-form-advanced.php.
*
* @since 1.5.0
*
* @param string $hook_suffix The hook suffix of the current page.
*/
Expand Down Expand Up @@ -487,6 +495,8 @@ function gutenberg_meta_box_partial_page_admin_footer( $hook_suffix ) {
/**
* Allows the meta box endpoint to correctly redirect to the meta box endpoint
* when a post is saved.
*
* @since 1.5.0
*
* @param string $location The location of the meta box, 'side', 'normal'.
* @param int $post_id Post ID.
Expand Down Expand Up @@ -516,6 +526,8 @@ function gutenberg_meta_box_save_redirect( $location, $post_id ) {

/**
* Filter out core meta boxes as well as the post thumbnail.
*
* @since 1.5.0
*
* @param array $meta_boxes Meta box data.
*/
Expand Down Expand Up @@ -568,6 +580,8 @@ function gutenberg_filter_meta_boxes( $meta_boxes ) {

/**
* Check whether a meta box is empty.
*
* @since 1.5.0
*
* @param array $meta_boxes Meta box data.
* @param string $context Location of meta box, one of side, advanced, normal.
Expand Down
4 changes: 4 additions & 0 deletions lib/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/**
* Set up global variables so that plugins will add meta boxes as if we were
* using the main editor.
*
* @since 1.5.0
*/
function gutenberg_trick_plugins_into_registering_meta_boxes() {
global $pagenow;
Expand All @@ -32,6 +34,8 @@ function gutenberg_trick_plugins_into_registering_meta_boxes() {
*
* This is used to tell React and Redux whether the meta box location has
* meta boxes.
*
* @since 1.5.0
*/
function gutenberg_collect_meta_box_data() {
global $_gutenberg_restore_globals_after_meta_boxes, $current_screen, $wp_meta_boxes, $post, $typenow;
Expand Down