Placing explanatory boxes within the Wordpress administration?

Asked

Viewed 46 times

1

I would like to help the system users by placing a box with explanatory text within each part of the administration of Wordpress, for example in posts, pages and even in custom post types.

Does anyone know a solution in plugin or functions that can help me?

inserir a descrição da imagem aqui

  • 1

    Milestones, just one note: Please, Please, don’t use code formatting to highlight. It’s nice to have a pattern on the site because it makes it easier to read. It would be nice if you could do a quick reading on How we should format questions and answers?. Thanks!

  • Vdd well remembered não fazer isso if you do not want to express programming. I will improve.

1 answer

3


For these specific pages you quote, what you’re looking for is a Meta Box. You have to set the post type, location and priority:

add_action( 'add_meta_boxes', 'add_box_sopt_38791' );

function add_box_sopt_38791() {
    add_meta_box( 
        'sectionid',
        'Custom box',
        'inner_box_sopt_38791',
        'product',  // Tipo de post
        'side',     // Localização 
        'high'      // Prioridade
    );
}

function inner_box_sopt_38791( $post )
{
    ?>
    <h1>Help</h1>
    <?php
}

Will appear on Products screens, new or existing (http://example.com/wp-admin/post.php and http://example.com/wp-admin/post-new.php:

To apply in several post types:

foreach( array('post','page','product') as $cpt )
    add_meta_box( $argumentos ); // Usar $cpt no tipo de post

See example of Meta Box that saves information: Extracting a Woocommerce Attribute and Put it in Google Book Viewer Script

If the intention is a Help box on other pages, then you will have to do gambiarra with jQuery:

foreach( array('post.php', 'post-new.php', 'profile.php', 'settings.php' ) as $page )
    add_action( "admin_footer-$page", 'jquery_magica' );

function jquery_magica() {
    // imprimir mágica
}

Finally, you can use a standard feature that are the Help Tabs that appear at the top of each page:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.