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

Move 'Customize' link in Metadata metabox to inside metabox #590

Merged
merged 2 commits into from
Jan 30, 2020
Merged
Changes from all commits
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
11 changes: 6 additions & 5 deletions modules/editorial-metadata/editorial-metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ function register_taxonomy() {
*/
function handle_post_metaboxes() {
$title = __( 'Editorial Metadata', 'edit-flow' );
if ( current_user_can( 'manage_options' ) ) {
// Make the metabox title include a link to edit the Editorial Metadata terms. Logic similar to how Core dashboard widgets work.
$url = add_query_arg( 'page', 'ef-editorial-metadata-settings', get_admin_url( null, 'admin.php' ) );
$title .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
}

$supported_post_types = $this->get_post_types_for_module( $this->module );
foreach ( $supported_post_types as $post_type ) {
Expand All @@ -362,6 +357,12 @@ function display_meta_box( $post ) {
echo "<div id='" . self::metadata_taxonomy . "_meta_box'>";
// Add nonce for verification upon save
echo "<input type='hidden' name='" . self::metadata_taxonomy . "_nonce' value='" . wp_create_nonce( 'ef-save-metabox' ) . "' />";

if ( current_user_can( 'manage_options' ) ) {
// Make the metabox title include a link to edit the Editorial Metadata terms. Logic similar to how Core dashboard widgets work.
$url = add_query_arg( 'page', 'ef-editorial-metadata-settings', get_admin_url( null, 'admin.php' ) );
echo '<p><a href="'. $url . '">' . __( 'Configure', 'edit-flow' ) . '</a></p>';
}

$terms = $this->get_editorial_metadata_terms();
if ( !count( $terms ) ) {
Expand Down