• Hi – I’m making post meta boxes and I am stuck on the update piece. There is no sign of my meta en the database and I can’t see what is wrong with my code:

    add_action (‘save_post’, ‘rah_save_page_meta’);
    function rah_save_page_meta($post_ID) {
    update_post_meta( $post_ID, ‘_single-page-footer-text-1’, $_POST[‘single-page-footer-text-1’] );
    }

    the data is collected from here, in the add_meta_box defined function:

    <textarea style="width:50%; min-height:100px;" name="single-page-footer-text-1"><?php echo get_post_meta( $post->ID, '_single-page-footer-text-1', true ); ?></textarea>

    I don’t have to add the save_post action from within any other function do I?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    No, add_action() can be executed when your script page loads, as you have it now. There’s nothing wrong with the code you posted. I added your text area to my existing meta box and your save_post callback works fine. Whatever is wrong lies elsewhere.

    How to do not show author on Quicedit button on post page . my site http://www.itrongbd.com

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't save meta box input’ is closed to new replies.