Questions tagged [metabox]

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

0
votes
0answers
14 views

custom meta_box doesn't display in custom widget

I have some meta_box that display on single page correctly but when I use custom widget to display different category's posts,the meta_box doesn't display in main page. in below code I expect display ...
1
vote
0answers
18 views

How to have meta boxes save via REST in Gutenberg?

I have a number of meta boxes added to a site I'm building, and would like to have their data saved via the REST API rather than have the post save "twice" in Gutenberg (once via REST for the basics, ...
0
votes
1answer
31 views

Removing panels (meta boxes) in the Block Editor

When the Block Editor was added to WordPress, custom and core meta boxes became legacy, meaning, using the remove_meta_box() function won't work when removing meta boxes/panels displayed on the post ...
0
votes
0answers
19 views

Problem with multi checkboxes value in metabox?

I'm a beginner and I have a problem with a part of the script that I found in a post. Practically when printing the checkboxes it does it outside the table. I can't bring the content of the foreach ...
0
votes
0answers
16 views

why metabox wordpress will be removed after some time in some my post

I added this code in function.php for add metbox But sometimes, these metabox will be removed after some time in some of my posts. where is the problem from? function mycnt(){ global $post; ...
0
votes
1answer
19 views

metabox dosn't save with checkbox of post_type values order by taxonomy

Please me!!!! Itried thow weeks and I search but without any result I can't save meta box that has both checkbox i need your help as soon as possible this is my code callback my metabox : $terms = ...
0
votes
0answers
13 views

Metabox Upload custom MIME file type not show in Media Library

I have made a theme to allowing uploading of files like GLB format to be used in WEBGL 3D rendering in a post. Here's the code for adding supported file type: function my_myme_types( $mime_types ) { ...
2
votes
0answers
23 views

add_meta_boxes action with refresh on save

I've created a meta box using add_meta_boxes action and it works when I open any post to edit it. add_action('add_meta_boxes', function() { add_meta_box( ... ); }); When WP auto ...
0
votes
0answers
17 views

How to customize Metaboxes?

I found many articles concerning this question but I'm still having troubles with this because my understanding of how to create metaboxes is really primitive. So, in order to create metaboxes, I just ...
0
votes
2answers
34 views

wp_editor in add_meta_boxes does not show gallery

I have added a meta box in the page edit section: add_meta_box('custom_section_box', 'Sections', array($this, 'section_box'), 'page','normal','high'); Within the box, there is a wp_editor call: $...
0
votes
0answers
15 views

CMB2 Output Select Box Chosen Option

I have the following code for a metabox which allows the user to select a post category but I cant seem to ouput the chosen option on the front end. Any ideas ? Heres what I have so far : // Choose ...
1
vote
1answer
42 views

How to get Metabox custom field to show checked if value is updated using post meta query?

I have two radio buttons as custom metabox fields for pages/posts. One radio button has the value of "enable" and the other has the value of "disable". My radio buttons will stay checked only if I ...
0
votes
1answer
18 views

Access post title from custom meta box on title change

I have a custom meta box as part of my post editor. When the user changes the post title, I want to reflect this change in the content inside the meta box. I have seen plugins like Yoast do this but ...
0
votes
1answer
24 views

Wpautop in wp_editor not working

I recently added a custom meta box with Tinymce support. I wanted to output the data as html. If I code p tags manually inside Tinymce it works. But if I switch to Visual mode, the p tags aren't ...
1
vote
1answer
45 views

wp_editor() usage in custom meta box

i am building a custom meta box having a classic editor input rather than just input. The reason for using wp_editor is that I wanted to add paragraphs of text inside div but the simple input escaped ...
0
votes
0answers
13 views

Get String returned by function get_the_title () and show it in Metabox without clicking on “Update” or “Publish” Button

I have the following code in my functions.php that shows or replicates the same text in Capitals of the "Title" field of a WP entry, in a Metabox that appears when the same entry is edited. ...
0
votes
1answer
63 views

Wordpress Featured Image meta box not showing

For some reason, the Featured Image box is not showing. I checked under the screen options and it is not showing. Since it is an MU site, I even checked under the main dashboard and still, I'm not ...
0
votes
1answer
55 views

Allow HTML in Custom Metabox area

I know there are many questions related to my question, but sincerely i was unable to get solution. My question is simple, how can i allow html in textarea in custom metabox on post. So far i have ...
0
votes
1answer
23 views

How add multiple wp_editor_box to new post

I am trying to use multiple wp_editor_meta_box to my posts for custom post_meta but the problem is when I use the same codes for each of them there is an error Fatal error: Cannot redeclare ...
0
votes
1answer
49 views

How to search by metadata using REST API

I have a custom post type like this: register_post_type('horario_busao', [ 'labels' => [ 'name' => 'Horário Busões', 'singular_name' => 'Horário Busão' ], 'public'...
0
votes
1answer
14 views

add 'publish metabox' to Gravity forms edit page/form area

I am trying to add the same 'Publish Metabox' that is on top right sidebar of normal Wordpress posts and pages. Any thoughts? I just tried adding this'add_meta_box( 'submitdiv', __( 'Publish' ), '...
0
votes
1answer
32 views

Unable to show meta box data in frontend

I am able to show the featured image and the text in the editor but I made some additional custom post types and meta box to show some important data but I am unable to show(highlighted in red in this ...
0
votes
1answer
42 views

Getting data from dynamically allocated metaboxes within a custom post

I need to dynamically allocated metaboxes for a data entry type feature. Each Metabox represents a set of data associated with member such as name, address, city etc. Not sure what I am doing ...
0
votes
1answer
28 views

How to save multiple values in custom post type from front end to back end

i created a plugin in WordPress , i created custom post type called "invoices" here it's the code add_action('init', 'invoices_register'); function invoices_register() { $labels = array( '...
0
votes
0answers
16 views

Multiple useres editing specified content

I work for a nonprofit with weekly courses for kids. Every week the course teachers update where and when next weeks course will be. We have about 10 courses every week. So the teachers need to be ...
0
votes
1answer
25 views

How to alter static Page text through the Theme Customizer API

I am fairly new to Wordpress development so I apologize for my ignorance. How can I alter the static information on my pages (IE not entries or page content) through the Theme Customizer API? Is it ...
0
votes
0answers
16 views

Post Thumbnail: Is there a possibility to add a description to the meta box? [duplicate]

Probably many of you are using the Post Thumbnail feature: https://codex.wordpress.org/Post_Thumbnails I wonder if it is possible to add a description to the post thumbnail meta box in the admin area....
0
votes
0answers
21 views

How to create an relation between custom posts?

I have 2 custom post types : post (default cpt) and movie. Every movie have an imdb term that is an unique string for each movie. The post (default) can contains movies inside, so I'm using metabox to ...
0
votes
1answer
42 views

Topic won't save for a custom post type — how to debug?

In two of my site's custom post types, the topic (in the Topics meta box -- see screenshot below) won't save. This is not a custom meta box, I don't think. At least, I think it comes standard with ...
0
votes
1answer
24 views

Hide Page Title with Post Meta

I tried to write code to have a checkbox on Pages in the backend to check if I want to hide the title of the page in frontend. But I find that the post meta is sometimes reset to show the title even ...
0
votes
1answer
49 views

Custom post type suddenly stoped working after WordPress 5 update

I build a simple plugin that has a CPT and 1 metabox section that collect extra information from admin. It was working fine in the old version but when i just updated it to WordPress 5 it stopped ...
1
vote
1answer
22 views

Custom meta box not saving

I've created a custom meta box for a custom theme. The metabox appears but does not save any inputed values <?php /* @ PACKAGE 3KTECHS THEME ========================= CUSTOM POST TYPE PAGE =======...
0
votes
0answers
102 views

How to use Gutenberg in CMB2?

I am not able to get the Gutenberg editor in CMB2 (repo). I have follow the comment mentioned on the example file but not working. I have set the 'mb_callback_args' => [ '...
1
vote
1answer
42 views

Meta Query Filtering not working on Custom Meta Box using Radio Buttons

I have a custom post type called "bids". I'm trying to get the loop to filter posts according to a meta_query. The query should allow for only posts that have the radio button with the value "open" ...
0
votes
0answers
33 views

How do I save values from a foreach output on an options page?

I am creating a plugin that outputs a metabox on each page to be able to assign custom meta descriptions plus some other values. All of that works perfectly. However, I also have a "bulk editor" ...
0
votes
1answer
24 views

Get id from metabox dropdown

Im using Reusable Metaboxes (old but still works) and I created a metabox that allows the user to pick a post from a list of custom post types. Right now that works pretty well, I can see all the ...
0
votes
0answers
16 views

save meta data of custom post type: WP_Error has no effect, even if insufficient capabilities

The function should give the user a feedback, if the data changes of the meta box of a CPT couldn't be saved. In the following code the function returns a WP_Error if the current_user doesn't have ...
1
vote
2answers
590 views

Add metabox to document tab in gutenberg

How can I add custom metabox in document tab in gutenberg? There is documentation about adding plugin sidebar here, but I'm looking for adding custom metabox in existing document tab.
1
vote
2answers
74 views

Adding Meta Boxes while Registering a Post Type in a Class

I am trying to add a few meta boxes for a Custom Post Type through a Class. I am using the "register_meta_box_cb" parameter while registering the Custom Post Type to specify the callback function for ...
0
votes
0answers
26 views

$_POST from a Meta Box

From my reading, the editor page of a post is wrapped in a form tag meaning a standard HTML form won't work within a Meta Box. What I'm trying to achieve is a meta box with two fields e.g. Name & ...
0
votes
1answer
90 views

get_post_meta not working on my custom-function page

I have saved the meta key with the name writer_meta_key and want to retrieve it on my custom-functions page. I can get it on front page and single page but it doesn't work on my custom-function page. ...
0
votes
0answers
19 views

Moving a metabox - not obeying context or removing old

I have a custom taxonomy called "events category" that is in a custom post type called "events" - I want to move this metabox from the "side context to the "normal" context. add_action('do_meta_boxes'...
0
votes
0answers
23 views

How to use the meta box from edit media in attachment details for custom taxonomy

i've added a custom post Type for attachments in Wordpress and it works fine. My problem is the way of displaying (or not displaying) the terms in the attachment details of wordpress. It's only a ...
1
vote
1answer
19 views

How do I update a field of a meta box?

While parsing data from a CVS file into a custom post type, i would like to parse data into the fields of a meta box, that I created. The meta box fields are normally updated like this: function ...
0
votes
0answers
53 views

Metabox/Custom fields are not saving input data

I think I was doing everything right but my data doesn't save. What is wrong with this code? add_action( 'add_meta_boxes', 'niloyrudra_add_meta_boxes' ); add_action( 'save_post' 'save', 10, 2 ); ...
0
votes
0answers
19 views

Save post meta save as multi dimensional array

I want to make portfolio page using meta field, where clicking to image opening image slideshows. So I want to loop main clickable image in array and images of slideshow as an array of main image, ...
0
votes
0answers
12 views

add_meta_box does not display meta box in Admin

I have two wordpress sites: 1) running on localhost server (PHP7.3) 2) hosted on Bluehost.com (PHP7.2) The metabox gets added on my local website, but the same piece of code does not work on ...
0
votes
0answers
34 views

Unable to update the meta boxes with multiple fields

I successfully build a function, that is able to import data from a CSV into posts of a Custom Post Type (CPT). I am able to parse data into the native Title and Description fields, but it fails, when ...
3
votes
0answers
135 views

extend Meta Box / Document Panel

For a project, I'm trying to figure out the best way to implement a checkbox, related to a post type. What I'm trying to to: On the final website, there should be a dropdown-button, with upcoming ...
0
votes
0answers
22 views

Meta box not display if remove post title

I'm a newbie. I want to create a post type and each post has meta box. I don't need post title so I removed. But meta box is not display without post title. Help me! Sorry for my english! Thanks ^^ ...