Questions tagged [metabox]

Refers to a box-like reusable user-interface component common in the WordPress backend.

Filter by
Sorted by
Tagged with
0
votes
1answer
247 views

update_post_meta doesn't work

I've been drilling with codes for so long. I was trying to create a metabox with a simple textare on it. Been stuck for almost 10 hours tyring to solve this. Still up until right now my meta box ...
0
votes
1answer
844 views

Show metabox only for homepage

I'll try to add metabox to homepage with setting fields, but something went wrong, help me please. The metabox don't appear in page editor, when i remove if statement it shows on all pages. ...
1
vote
0answers
14 views

Grouping metadatas into one

I want to have some custom metadatas for my custom post type. I know how to add the metadatas one by one, but I need to some of them together, considered as a single metadata. For example lets assume ...
0
votes
2answers
568 views

Updating post meta for checkbox

<div class="vp-field vp-checkbox vp-checked-field vp-meta-single" data-vp-type="vp-checkbox" id="_custom_meta[category][]"> <div class="label"> <label>Categories</label> &...
3
votes
1answer
672 views

How to limit the pages displayed for choosing parent page on page attribute's menu?

I have a site with a lot of pages. I would like to know if there is a method to display only the pages that I want to be displayed on the menu for choosing the parent page. A lot of them are child ...
0
votes
1answer
59 views

Wordpress admin area: select box with 12.000+ options

I have a custom post type that in admin area has a select custom meta box with 12.000+ options. So, in some cases, WordPress show an error message like memory exhausted. Which could be a good ...
0
votes
1answer
28 views

Saving metabox content not working

I'm trying to save a metabox input but it doesn't seem to work. I'm working with arrays (as I need my metabox to have 60 rows), so I assume the problem lies within them. This is my metabox function ...
0
votes
1answer
51 views

How to verify nonces in bulk?

Hey I'm relatively new to WP, and I'm trying to get a handle on nonces since they're a good security check. I'm having difficulty verifying my nonces in save_post however. The checks fail on the $...
0
votes
1answer
20 views

Problem with adding exta field in metabox in custom post type

I am trying to add a new field in the metabox there is demo url field which is working fine i have created new field that is not storing or saving any datas which inserted into the field. Here is my ...
1
vote
1answer
693 views

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, ...
1
vote
2answers
69 views

Wordpress custom meta field for custom post not storing data

I have created custom post type named as freebie in that i have created a custom meta section in that added a input field. Which is not storing the data which entered in that field also not displaying ...
0
votes
0answers
621 views

semantic ui dropdown for custom metabox

I'd like use Semantic UI Dropdown (https://semantic-ui.com/modules/dropdown.html) in my custom metabox for the plugin I making. I added the codes like that: // Styles wp_enqueue_style( 'semantic-ui', ...
0
votes
1answer
368 views

edit_page or edit-pages for current_user_can()?

The more I read Wordpress Codex the more often I wonder if tutorials you can find on the net are actually correct. I've found several tutorials about creating metaboxes where user capabilities (when ...
0
votes
1answer
895 views

Add other all taxonomies as meta boxes to custom post type

I have a custom post type which comes with a category taxonomy. This taxonomy shows as a meta box at the side. Pretty basic so far. Now I want to add additional meta boxes below the content on the "...
0
votes
1answer
820 views

How do I display a custom field in an existing form on the front end?

I just have one custom field (from metabox.io) that I need added to the front end of an existing form. Can someone just clarify the steps. I tried following this tutorial: https://voodoopress.com/add-...
0
votes
1answer
109 views

featured image in custom poste type (backend)

I created a custom post type outside the wordpress loop. I want to integrate the featured image meta box in the backend for this post type. $this->add_meta_box('postimagediv','Beitragsbild', array(...
-1
votes
1answer
195 views

Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]

I currently have a metabox with a custom date field but I'm wondering how do I customize it to save multiple dates instead of just one? (I need it to function similar to the tags metabox)?
1
vote
0answers
58 views

Anon function and add_meta_box

I am building a WordPress management plugin (so far going really well) however I am having a slight issue below is what I am trying to acheive and the problem. I am building a Meta manager and for ...
3
votes
1answer
939 views

Add search to list of categories in post editor

I have many categories in my WordPress website. Each time I am adding new post it is very hard to find specific category that I need this time. It would be much easier if I had search field right ...
0
votes
1answer
249 views

Simple Data picker meta box

Hello everybody I tried to follow many post and guides but with results not according to my needs. I need a simple meta box that catches a data timestamp like the standard one in Wordpress posts or ...
2
votes
1answer
26 views

Appending a value to metabox before and after saving

when I click upload a file, select the file, then click choose file. I want to be able to click upload file again, either before or after I click update, and add the selected files to the existing ...
1
vote
1answer
93 views

Save or update data when custom post published

I have metabox on my custom post screen. How to save them when any of them are checked and then use or echo those checked offers to display on single.php? my code for metabox is function ...
0
votes
1answer
260 views

duplicate featured image functionality in custom meta box

I'm trying to figure out how to add a link/button that when clicked will open the set featured image modal and perform the same functions as if you clicked it in the original meta box. I am wanting to ...
1
vote
1answer
80 views

custom meta box for page default template

I'm having issues getting some custom meta boxes to display on the page default template. I want these meta boxes to only display on the default template and disappear when the user chooses a ...
1
vote
1answer
53 views

A good strategy to print custom posts (offer) that are checked inside the metabox of a post?

the code for getting the metabox in image is: function op_register_menu_meta_box() { add_meta_box( 'op-menu-meta-box-id', esc_html__( 'Custom offers Checklist (select any 2)', 'text-domain' ), '...
0
votes
1answer
57 views

How to save the checked boxes?

What i am trying to achieve is this I have created a custom post(offer), i have another custom post created (listing). I want to add a metabox in listing, which will recieve check list of all offers ...
1
vote
1answer
23 views

What's the difference between same wp functions get_posts(); functions in different form?

get_posts('post_type=post&numberposts=-1') and the get_posts( array( 'post_type' => 'post', 'posts_per_page' => -1 ) ); Are they the same?
2
votes
2answers
798 views

How can i add a metabox to pull list of custom posts (any two) on edit or add post screen?

I want to add metabox to pull list of custom posts and select any two of them on edit or add post screen. And At last when the post is published display them on single post page. Please help me! Any ...
0
votes
3answers
73 views

Displaying a Metabox linked to post settings for all users

Currently, I have a meta box that all Editors of my site can see. I want all contributers to see this meta box. I've used a user-role plugin and it looks like the meta box is linked to post settings....
-1
votes
1answer
38 views

CPT Template Option to Top

I edited the following core file because I was unable to make the change in my child theme. I need my CPT Template option to appear first in the Post Attributes -- Template drop down list. I made it ...
0
votes
0answers
132 views

Remove Custom metabox from particular page template is used

I have created custom metafields like the following and it was working fine. I want to show the metafield only when an particular page template is used. but it was not working. class ...
0
votes
0answers
32 views

Custom gallery displayin and sorting error

I am making frontand gallery uploader. Here is my example code: <?php //start of "for" loop $attach_id = media_handle_upload($key, $post_id); $attach_ids[] = $attach_id; ...
0
votes
1answer
232 views

Add editor toolbar to Metabox

I have multiples Metaboxes like this one : function initialisation_metaboxes_home(){ add_meta_box('home_extract_meta', 'Affichage home', 'ma_meta_function_home', 'produit_fr', 'normal', 'high');...
3
votes
1answer
564 views

Find callback function for custom taxonomy metabox

I'm looking for a way to move my custom taxonomy metabox (on the right side) to the post area (the middle). I'm aware you can simply drag and drop it, but I want it in the post area by default for new ...
0
votes
1answer
291 views

Posts query according to meta box date

I'm struggling to get a working solution with wp_query for Event management, Currently post order by event start date & time work well. Now I want some custom settings. Have two meta boxes ...
0
votes
1answer
150 views

Find callback function of custom meta box

I am reordering the default meta box layout in the following way: add_action('do_meta_boxes', 'move_meta_box'); function move_meta_box(){ remove_meta_box( 'my-itemsdiv', 'post', 'side' ); ...
0
votes
1answer
23 views

Is there default meta boxes types that handles types and sanitization?

I've been tasked with my first WordPress project. It's a project that involves custom plugin development. While looking over the documentation for adding custom post types I found the meta boxes ...
0
votes
1answer
66 views

How to I retrieve the ID from the Posts page?

I am creating some custom meta boxes in my theme to allow user to insert their own custom meta description and keywords overrides (no I will not use a plugin for it). I am having an issue with the ...
0
votes
1answer
327 views

Save meta value as an array of arrays

How to save metavalue in the following format: array( array( 'title' => 'something', 'price' => 'something', ), array( 'title' => 'something', 'price' => '...
-2
votes
2answers
148 views

iframe not showing on frontend when using a CMB2 field

I have a custom field manually coded using CMB2: https://cmb2.io/. Here is the code: $cmb_pages_customtext->add_field( array( 'name' => esc_html__( 'Content', 'defaulttheme' ), ...
0
votes
1answer
51 views

transfer two existing taxonomy terms into one custom metabox

Using this code I am able to add existing Terms from one taxonomy moviestax to my own created Metabox. function my_meta_box(){ add_meta_box( 'mymtx_div', 'This my own Meta box Only :-)', '...
0
votes
1answer
209 views

create metabox to activate slider

I want to create a checkbox on the Add Post page to enable the slider When the checkbox is activated, that post displayed in the slider, and i want to just write code i don't want to use any plugin.
0
votes
0answers
62 views

set a custom post type to a taxonomy term programmatically in metabox

I have a Custom Post Type called Movies and it has a Custom Taxonomy called Genres. I also have 3 Terms under Genres called ['Action','Comedy','Horror'] Can you please let me know how I can Get and ...
0
votes
0answers
390 views

update_post_meta() not updating

I'm saving API data as metabox data, and I'm attempting to update metabox data on import. So the Title, content data will always update. But I can't seem to be able to use the ID to update the metabox!...
0
votes
0answers
90 views

problem when uploading file by metaboxes

I want to upload pdf files via posts using metaboxes. I have this code: if ( is_admin() ) { add_action( 'load-post.php', 'call_MetaBoxClass' ); add_action( 'load-post-new.php', '...
0
votes
0answers
33 views

Dropdown of existing posts in a metabox

so i want to make a game profile System Like the one gamespot has on wordpress that shows every game's informations In all the posts related to that particular game. I Investigated and ended up ...
0
votes
0answers
171 views

delete post meta data in array WordPress

i want to delete post meta with same key like 'rtf_booking' but this key have store data in array like Array ( [0] => first booking [1] => second booking [2] => third booking ) ...
-1
votes
1answer
216 views

send meta box input data without publish button

I want to add meta-box in my plugin but i want add two inputs and one button like submit button when i click on submit button then input fields data send to database and received but how this is ...
1
vote
2answers
136 views

Automatic value for custom fields for posts

I have created custom fields for posts by using the add_meta_box action. I want to create my own WP Query based on my custom field, to make sure I will only load a post collection with the correct ...
0
votes
0answers
162 views

Query by meta value (add a dropdown of all values)

I'm facing a problem I can't resolve alone. I have a custom meta field named 'processeur' for a custom post type names 'ordinateur'. What I need to to is get a list of all meta values, arrange them in ...

1
3 4
5
6 7
32