get_post_meta giving errors while creating a metabox
i was following atutorial on how to make a custom metabox to wordpress post but
its giving errors
i was following atutorial on how to make a custom metabox to wordpress post but
its giving errors
In previous situations I have been able to add a custom meta field to posts, the code was this:
I have seen this question asked a bunch but nothing seems to work. I have a simple metabox within a CPT that needs to save two values. It needs to save a dropdown of pages and a url text field. I can get the text field to save and display but not the drop down. My class is being called on initialization. I think it has something to do with the $dropdown_args variable but I’m not too sure. I can see it saving in my database but it just doesn’t display the selection after saving. The description metabox saves and displays fine, it’s the landing page one that needs help. I have posted all my code and any help will be greatly appreciated.
What is the reason that $post->ID is not working in metabox_callback after adding a custom query. How can I avoid this? Should I use $post_id = isset( $_GET['post'] ) ? $_GET['post'] : ( isset( $_POST['post_ID'] ) ? $_POST['post_ID'] : false ); instead of $post->ID?
I’d like users to be able to create and remove additional meta box fields as needed.
I’d love to be able to hide meta boxes using screen options, instead of removing them or restricting them to user roles, the goal is to just “uncheck” the meta box for the user.
I have a custom meta box for a custom post type that my client wants placed between the title/permalink section and the post editor in the admin panel. Is this possible and if so is there a hook/filter/etc that I would need to use?
I have a custom post which has a meta tag that needs to be using a file upload (for video files). I am wondering, what is the correct way of adding an “Upload” button that points to the WordPress media uploader and sets the url of the selected uploaded file to the text field that caused that associates the upload button.
I am using register_taxonomy_for_object_type() to add the Category taxonomy field to Media uploads (attachments). I’m using this code to do so:
I’ve used add_meta_box() to add a custom meta box to the WordPress edit window on both pages and posts.