Last active
April 14, 2020 06:05
-
-
Save zogot/5477119 to your computer and use it in GitHub Desktop.
WordPress Meta Boxes above the Editor. Including a sortable content area.
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
<?php | |
/** | |
* Prints all metaboxes with the above context | |
* above the editor | |
*/ | |
function themeplugin_prefix_meta_box_above() { | |
global $post; | |
echo '<div id="postbox-container-3" class="postbox-container">'; | |
do_meta_boxes( get_current_screen(), 'above', $post ); | |
echo '</div>'; | |
} | |
add_action( 'edit_form_after_title', 'themeplugin_prefix_meta_box_above' ); | |
// In the add_meta_box call, in the context parameter, | |
// which normally allows 'normal', 'advanced' or 'side' instead use 'above' |
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
#postbox-container-3 { | |
float:none; | |
} | |
#post-body #above-sortables { | |
min-height:50px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment