¿Quieres mover tu metabox de autor desde la parte inferior de la página al metabox de publicar post? Esto es útil si tienes un blog con varios autores y publicas la mayoría de tus artículos como Equipo Editorial. De esta forma puedes cambiar fácilmente el autor sin tener que desplazarte hacia abajo para ver el metabox de autor. Este fragmento también le recuerda que debe cambiar el autor antes de publicar el artículo.
Instrucciones:
Todo lo que tienes que hacer es añadir este código al archivo functions.php de tu tema o en un plugin específico del sitio:
add_action( 'admin_menu', 'remove_author_metabox' ); add_action( 'post_submitbox_misc_actions', 'move_author_to_publish_metabox' ); function remove_author_metabox() { remove_meta_box( 'authordiv', 'post', 'normal' ); } function move_author_to_publish_metabox() { global $post_ID; $post = get_post( $post_ID ); echo '<div id="author" class="misc-pub-section" style="border-top-style:solid; border-top-width:1px; border-top-color:#EEEEEE; border-bottom-width:0px;">Author: '; post_author_meta_box( $post ); echo '</div>'; }
Nota: Si es la primera vez que añade fragmentos de código en WordPress, consulte nuestra guía sobre cómo copiar / pegar correctamente fragmentos de código en WordPress, para no romper accidentalmente su sitio.
Si le gustó este fragmento de código, por favor considere revisar nuestros otros artículos en el sitio como: Los mejores constructores de páginas de WordPress (Comparados).
Got a way to open all publish metabos options by default so status, visibility and publish date are completely viewable by default?
Got a way to open all publish metabos options by default so status, visibility and publish date are completely viewable by default?
Got a way to open all publish metabos options by default so status, visibility and publish date are completely viewable by default?
Got a way to open all publish metabos options by default so status, visibility and publish date are completely viewable by default?
Got a way to open all publish metabos options by default so status, visibility and publish date are completely viewable by default?
Got a way to open all publish metabos options by default so status, visibility and publish date are completely viewable by default?
Hi Kevin. I tried this snippet and the author box displays in the metabox as intended, but when I save, it doesn’t ‘stick’. Maybe it’s conflicting with another plugin or function, maybe not. Just wanted to report that.
thanks for the snippet. However, I tried this snippet on a multisite test site and discovered that all authors in the WP site are also included in the drop downmenu, when moved to the publish post metabox. However, I may select any author name I like but do not have permission to publish anything. Just can save a post.
Hi Zeb,
I never tested this out on wpmu but it works great within single user wordpress version. Saves time rather then scrolling to the bottom of the page. However that it good to know that it will not work properly on MU.
Yes, Kevin thats why I liked it and tried to implement it to save time. It’s great and I’ll definitly use it in my single installation (thanks to you) 🙂 , but in MU, I have to wait for an improved version.
Hi Zeb agreed, I’m sure ill post an update in the near future.