Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [metabox]

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

-1
votes
0answers
10 views

How to repeat meta key? [on hold]

How could I repeat meta_key and rename one of them? add_action('add_meta_boxes', 'change_meta_box_titles', 999);
0
votes
0answers
32 views

How to prevent other metaboxes from moving when inserting your own custom metabox?

This code below is making other fields all move to the side. I was only trying to make the new custom metabox move to the side. function vmo_code_enable_metabox() { $screens = ['post', 'page']; ...
1
vote
1answer
39 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
14 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
18 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
37 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
12 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
24 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
41 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
17 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
32 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
12 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
30 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
26 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
23 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
20 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
34 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
22 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
29 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
20 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
34 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
33 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
32 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
13 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 ...
0
votes
2answers
211 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
46 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
24 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
47 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
18 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
21 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
17 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
38 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
15 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
11 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
31 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 ...
2
votes
0answers
81 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
18 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 ^^ ...
1
vote
1answer
99 views

Custom Meta Box (SELECT) Not Saving

I am trying to create a meta box with select options for each page with home-page-template.php assigned to it. I have got that functionality working correctly. I also want it above the editor, below ...
0
votes
1answer
30 views

display all registered meta boxes

i want to display the list of all the meta boxes of each post. the global variable wp_meta_boxes would not print anything on the screen. how can i print the value of the array to get the list of all ...
0
votes
0answers
31 views

Get meta values from parent post and save in child post

I have a custom post type "E-Books" with two categories "E-Book Title" and "Chapter Page", and custom meta boxes (table of contents, etc). The E-Book post type uses one page template, and displays ...
0
votes
0answers
26 views

How to Remove/Edit CPT template Content with Custom Meta Box

I try to Remove CPT template(single-proucts.php) Content with Custom Meta Box. I created a Input select option for change content in my CPT metabox it's working then update post I need to change ...
-1
votes
1answer
30 views

Input select option Change Content in Metabox

I'm making a "Input select option" in Custom Metabox for my plugin, I'm not Expert in PHP I don;t know How to Save user "Input select option". Working perfectly plain PHP. public function ...
0
votes
1answer
18 views

add meta box considers the selected option as post parent

I have added a meta box that will list specific post type posts, and on save it will save a meta key with selected post id, but the problem is that it rewrites the permalink of the post to consider ...
0
votes
0answers
17 views

need admin metabox on frontend

See the photo that I uploaded. This box is admin meta box. and it shows while updating post from wordpress admin dashboard. I want same box on frontend. how to do this?
1
vote
0answers
128 views

Getting gutenberg (WordPress 5) to save TInymce data?

I'm using this function to add a tinymce meta box: add_action( 'add_meta_boxes', function(){ add_meta_box( 'test_tinymce', 'Test TinyMCE', function( $post ){ $field_value = get_post_meta(...
0
votes
1answer
58 views

Calculate Repeater Meta Box Input Field Values and Display Total

I have a repeater custom meta box for my custom post type. I am new to Javascript and can not figure out how to calculate the value for each repeated input field and display the total combined. I have ...