Tag Info

Hot answers tagged

1

I have solved this problem after many researches, just comment two lines in meta_box.php file at end. $sanitizer = isset( $field['sanitizer'] ) ? $field['sanitizer'] : 'sanitize_text_field'; to //$sanitizer = isset( $field['sanitizer'] ) ? $field['sanitizer'] : 'sanitize_text_field'; at line 692 and $new = meta_box_sanitize( $new, $sanitizer ); to ...


1

I've modified your code a little to check that the post type is a page, that the current user can edit that page, verify the nonce and verify the inserting attachment functions. The resulting code is working. It seems that don't checking the post type could be the reason of the issue. Also, you don't need to manually include 'wp-admin/includes/image.php': ...


1

One thing you might want to do is add this code to the output: <pre><?php print_r($meta); ?></pre> Then have a look and make sure you are accessing the correct array keys. Once your sure, I think you need to verify checkboxes against a value of on or off. So you may need to change this line: if ($meta['is_offered'][0]==true){ ... to ...



Only top voted, non community-wiki answers of a minimum length are eligible