0

I am learning WordPress Plugin Development. I have custom post type News. I am taking input using meta-boxes for this custom post.

I added metabox using below code.

add_meta_box('news_settings', 'News Settings', [ $this, 'news_settings_html' ], 'News', 'normal', 'default');

My meta box code is like below.

public function news_settings_html()
{
    <?php
        <label for="location">
            <?php _e('Location', 'textdomain');?>
        </label>            
        <input type="text" name="location"/>
    ?>
}

How can I save this meta-boxes values ?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.