Basic: How to Add Checkbox to New Post Interface? (4 posts)

  1. 3dom
    Posted 6 years ago #

    Good day! In plugin I have to add checkbox onto new post interface which is always checked (it's value doesn't have to be saved in database) - how to do that?

    Tried mumb-jumbo like

    function rt_post() {
    add_action('dbx_page_sidebar', 'rt_admin_sidebar');
    function rt_admin_sidebar() {
    echo 'Hello! Some content for admin here: <checkbox name="check-me" value="1" checked />';
    add_action( 'admin_init', "rt_post" );

    but it didn't work. Any ideas?

  2. Mark / t31os

    Posted 6 years ago #

    See function information on add_meta_box.

  3. 3dom
    Posted 6 years ago #

    Thanks alot! Too bad we cannot add rep here =) Solved - almost: section placed down below on post page.

    Anyone happen to know how to place checkbox into "Publish" widget/box?

  4. Mark / t31os

    Posted 6 years ago #

    Try adding an action onto .. post_submitbox_misc_actions or post_submitbox_start ...

    That's the only 2 hooks i can see available inside that box, if they're not suited i don't think there's any more i can suggest..

    Hope that helps..

Topic Closed

This topic has been closed to new replies.

About this Topic