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
0answers
9 views

Posts not showing first to last selected on feature post meta box

i having a problem on my theme.i created a custom meta box to select the post to be featured with a checkbox. in the loop its show the first checked posts,but i want to display just posted and ...
0
votes
2answers
358 views

Update Post Meta in Front End with a form

How I can update Existing (Back-End) metabox variable from front-End, I tried many times but I don't know why doesn't this work? Showing only old value not update, what i did wrong? This is my Front-...
1
vote
1answer
87 views

Remove meta box for specific page

I'm trying to conditionally remove the 'Page Attributes' meta box for a specific page (or multiple specific pages). For example: function remove_meta_boxes() { if (is_page('contact')) { ...
0
votes
1answer
106 views

Update Post meta with custom variable

I Just want to update (edit existing) the custom meta box variable from front-end. I got a form Front end post editing using a form & process things but in this code post-title i can edit & ...
0
votes
0answers
107 views

How to Edit & Update meta_box values from Front-End user Form

I'm trying to Edit & Update meta_box values from front-End, Following codes are back-end. The problom is i'm fully confused with update post & update meta box. I hardly trying to get $package ...
0
votes
1answer
158 views

How To Tell If a Custom Field Was Made with ACF, Metabox.io, Carbon Fields, Custom Built, etc?

I am working on a plugin that will be using custom fields, but was curious if there was a way to tell which plugin/library created those custom fields. The reason I am trying to find this distinction ...
0
votes
0answers
20 views

How to update a custom post types meta box on publish

I'm trying update a meta field on a custom post when it's published, but it isn't working for some reason. My code is as follows: function add_rand($post_id){ $result = update_post_meta($post_id, ...
-1
votes
1answer
210 views

Use a Variable in update_post_meta as the $meta_key

looking at the example on wordpress.org update_post_meta( $post_id, $meta_key, $meta_value, $prev_value ); I seem to be having a problem replacing $meta_key with a variable. here is my code ...
0
votes
1answer
42 views

Custom Meta Boxes - Nonce Issue - Move to trash issue

Recently after updating Wordpress from 4.9.2 to 5.2, I have had to change a good bit of code to get my custom post type listings(or posts) to function and save data correctly. Specifically, with the ...
0
votes
1answer
108 views

PHP Warning with Custom Fields

For the love of God can anyone help me? My theme I had built a year or so ago, I added custom meta boxes/fields. I have created numerous custom taxonomies. But I didn't want the custom taxonomies to ...
1
vote
0answers
49 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, ...
4
votes
3answers
2k 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
35 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
1answer
21 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 = ...
3
votes
0answers
44 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
18 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
100 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
72 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
127 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
55 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
92 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
346 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
1answer
376 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
566 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
29 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 ...
1
vote
1answer
1k 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
38 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
96 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
47 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
91 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
35 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
19 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
1answer
109 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
59 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
186 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
29 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
1answer
512 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
131 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
1answer
30 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
53 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 ...
2
votes
3answers
3k 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
353 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
514 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
35 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'...
1
vote
1answer
249 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
170 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
1answer
28 views

add_meta_box does not display meta box in Admin

I have two wordpress sites: running on localhost server (PHP7.3) hosted on Bluehost.com (PHP7.2) The metabox gets added on my local website, but the same piece of code does not work on bluehosted ...
0
votes
0answers
81 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 ...

1 2
3
4 5
32