From 209d13a1678aba2346dbb1cbead37c4680e9eff7 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 17 Mar 2016 15:28:40 +0100 Subject: [PATCH] refine excerpt move function --- functions/blog.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/functions/blog.php b/functions/blog.php index 3166c44..44bb409 100644 --- a/functions/blog.php +++ b/functions/blog.php @@ -23,11 +23,19 @@ add_filter('image_size_names_choose', 'ascribe_blog_image_sizes'); * Put excerpt meta-box before editor * */ -add_action( - 'admin_menu', function () { - remove_meta_box('postexcerpt', 'post', 'normal'); - }, 999 -); -add_action('edit_form_after_title', 'post_excerpt_meta_box'); +function ascribe_move_excerpt_meta_box( $post ) { + if ( in_array( $post->post_type, array( 'post' ) ) ) { + remove_meta_box( 'postexcerpt', $post->post_type, 'normal' ); + echo "

Excerpt

"; + post_excerpt_meta_box( $post ); + + echo ""; + } +} +add_action( 'edit_form_after_title', 'ascribe_move_excerpt_meta_box' ); ?>