Tag Info

New answers tagged

0

That code doesn't call the metaboxes of the good screen. Try this to call the metaboxes of the current screen. do_meta_boxes('', 'normal', 'saed');


0

You're update function asks for a request parameter named meta_box_nonce (which is by the way a bad name) but your meta box template does not provide such a field. It should work if you add the following line right at the end of your function author_book_meta_box(): wp_nonce_field( 'author_book_meta_box_nonce', 'meta_box_nonce' ); Please consider to ...


1

Using the "admin_post_thumbnail_html" thumbnail filter would be the best way to add text to the Featured Image metabox and avoids using JavaScript / jQuery: View the "admin_post_thumbnail_html" developer reference on wordpress.org You'd use it by adding something like this to functions.php: add_filter('admin_post_thumbnail_html', ...


1

If you wanna show or hide entire meta box when event date is change, you can try to use Conditional Logic plugin, so you can rewrite your code like so: $meta_boxes[] = array( 'id' => 'wr_event_review', 'title' => 'Event Review', 'pages' => array( 'wr_event', ), // Post type 'context' => 'normal', ...


0

get_queried_object_ID() will return the ID on the page for posts, or get_queried_object() will return the page object containing all its post fields. Alternately, the ID of the blog page is stored in the option page_for_posts, which is internally how get_queried_object gets the ID of the post object to load.


1

Use tis plugin https://wordpress.org/plugins/acategory-dropdown-list/ It may be help you


0

$change = get_post_meta($post->ID, $key, 'resume_change_location', true); From https://developer.wordpress.org/reference/functions/get_post_meta/ get_post_meta returns an array, not an object so you need to use $change['index'] The other thing is within your meta box you seem to be saving a string not an array so foreach is going to fail. The ...


2

If I am correct the style.css (your theme style.css) is not loaded in the admin area so creating a function solves this. Side note: The code you where looking for I found in wp-admin/css/edit.css at line 960 Below you find the function,hopefully this is what you where looking for. Make backup from functions.php (you know the drill) Add following ...


0

Are you sure it isn't saving the values to the DB? Perhaps it's just not displaying the previously saved values in your form? $values = get_post_custom( $post->ID ); This is what you are using to get your meta - but this returns a multi-dimensional array. Therefore when accessing your beef_meta_box_price value, you need to use ...


0

I believe the issue is this line: if( $post->post_type == 'startups' ) return; Won't your custom posts always have the type startups? Basically you are telling your code that whenever I save my custom post type, ignore my custom fields. You probably meant to have one of the WP reserved types (e.g. revision or attachment) that would prevent your ...


0

You forgot to declare the variable $main_detail. Since it's a meta field you need to retrieve it first before you add it. $main_detail = get_post_meta($post->ID, '_main_detail', true); Also, I can see that some errors in your code. echo '<label >';?><?php _e( 'short description:' );?></label> Should be.. echo '<label ...


1

In your wpt_save_performer_meta() function you are iterating through $performer_meta array and saving its values. But it has only one manually set key (_short_description) ... and its value is result of isset($_POST['_short_description']), which is probablay always true, and saved (or displayed) as 1. So it should be like this: ...


0

To use wp_editor() you'll need to replace your textarea tag with the output from wp_editor() like so: case 'textarea': wp_editor($meta, $field['id']); echo '<br /><span class="description">'.$field['desc'].'</span>'; break; You don't need to echo wp_editor() since it does it automatically. You can pass an array of settings as a ...



Top 50 recent answers are included