Check if any meta on the post has value then display content
Check if any meta on the post has value then display content
Check if any meta on the post has value then display content
Custom Metabox Info Not Saving
I add a show contents part referring to a workable previous post with link https://bbpress.org/forums/topic/add-custom-text-fields-to-reply-form/. The below code can provide options for the user to selection. But the selection result could not be shown. I am not sure whether the selection result was added into metabox properly because I can not use the debug function. … Read more
Ok silly me… I missed this crucial line: add_action( ‘save_post’, ‘save_date_meta_box’ ); It now seems to save the date values
It looks like the variable you’re using to set the selected item is not defined in that scope. In your constructor: public function __construct() { if ( is_admin() ) { add_action( ‘load-post.php’, array( $this, ‘init_metabox’ ) ); add_action( ‘load-post-new.php’, array( $this, ‘init_metabox’ ) ); } $this->dropdown_args = [ ‘show_option_none’ => ‘- select a page -‘, … Read more
Add forms dynamically in admin pages?
How to Grab Anime info using Jikan API and fill the value in Metabox
The thing you’re talking about is called a custom meta box. They can be used to save post specific settings and data. You can create your own meta boxes with the help of add_meta_box() function. Here’s a quick example. This would go to your (child) theme’s functions.php file. Alternatively if you want to make the … Read more
How to avoid duplicate posts queried from custom meta?
The error there clearly says that there’s an undefined variable (post) in your metabox callback function. So you need to define $post in your function head: // The $post variable is passed by WordPress. function diwp_post_metabox_callback( $post ) And you should also do the same to diwp_save_custom_metabox() function (which is hooked to save_post): // Here, … Read more