0

I have two wordpress sites:

  1. running on localhost server (PHP7.3)
  2. hosted on Bluehost.com (PHP7.2)

The metabox gets added on my local website, but the same piece of code does not work on bluehosted website.

What is wrong?

add_action( 'add_meta_boxes', 'add_mu_address_meta_box' );

function add_mu_address_meta_box() {
    add_meta_box(
        'your_fields_meta_box', // $id
        'mu Address', // $title
        'show_mu_address_meta_box', // $callback
        'post', // $screen
        'advanced', // $context
        'high' // $priority
    );
}



function show_mb_address_meta_box() {
    global $post;  
        $meta = get_post_meta( $post->ID, 'your_fields', true ); ?>

    <input type="hidden" name="your_meta_box_nonce" value="<?php echo wp_create_nonce( basename(__FILE__) ); ?>">

            <?php }

1 Answer 1

0
add_action( 'add_meta_boxes', 'add_mu_address_meta_box' );

function add_mu_address_meta_box() {
$screens = array( 'post', 'page' );
    add_meta_box(
        'your_fields_meta_box','mu Address','show_mb_address_meta_box',$screens,'advanced','high' 
    );
}
1
  • 1
    Code only answers are generally not useful to future visitors. Can you please edit your answer to explain how it solves the users question? Thank you. Aug 10, 2019 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.