Questions tagged [metabox]
Refers to a box-like reusable user-interface component common in the WordPress backend.
1,647 questions
1
vote
1
answer
4k
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
1
answer
70
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' ), '...
1
vote
1
answer
1k
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
1
answer
55
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
1
answer
398
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
0
answers
24
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
1
answer
87
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
0
answers
25
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
1
answer
368
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 ...
1
vote
1
answer
369
views
Hide individual page title using checkbox in custom meta box?
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
1
answer
475
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
1
answer
50
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
1
answer
2k
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
1
answer
472
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
1
answer
59
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
0
answers
114
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 ...
7
votes
3
answers
8k
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.
2
votes
2
answers
1k
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
0
answers
30
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
1
answer
2k
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
0
answers
182
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
1
answer
2k
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
0
answers
791
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
1
answer
237
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
0
answers
248
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 ...
4
votes
0
answers
442
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
1
answer
1k
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 ...
-1
votes
1
answer
913
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
0
answers
197
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 ...
-1
votes
1
answer
2k
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
1
answer
274
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 ...
1
vote
0
answers
240
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
1
answer
705
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 ...
0
votes
1
answer
387
views
Metabox with checkbox is not working true!
please help me. i want to show display name of users in a meta box as checkbox. then i can choose many users to display some content in the post by:
if (in_array('special userID', get_post_meta($post-...
1
vote
1
answer
1k
views
Register non hierarchical taxonomy and the show meta box in the post type
I am trying to show a meta box in my product post type, but I'm getting this warning error...
Warning error...
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or ...
0
votes
1
answer
1k
views
Wp Query sort order from custom MetaBox
I am trying to sort a list of post based of the meta_key deal amount, which would be to display the highest deal first and work its way down to smaller deal amounts. The deal amount would be anywhere ...
0
votes
1
answer
359
views
Change meta-box title- "LearnDash Quiz Settings" to "Quiz Settings"
I want to change a meta-box title on the create question page from- "LearnDash Quiz Settings" to "Quiz Settings" on create question page.
I have seen a few posts that explain changing custom posts ...
3
votes
1
answer
906
views
Show or hide custom meta box not work with Gutenberg
I’m on WordPress 5 beta 4,
the problem is that meta boxes can not hide them when selecting a specific template chosen by page attributes.
To make them appear or hide, you have to update the browser ...
1
vote
1
answer
466
views
Serving a custom featured image for mobile
is it a good approach to serve multiple featured images to have a proper scaling?
Right now the featured image size on "Desktop" is up to 1140x250. Pretty wide and will shrink way too far on ...
0
votes
1
answer
183
views
Add Wordpress Meta Box saved form input to Wordpress RSS feed [duplicate]
I'm teaching myself how to build Wordpress plugins. I found a great guide to creating a Wordpress Meta Box and saving the form input from it.
https://themefoundation.com/wordpress-meta-boxes-guide/
...
0
votes
1
answer
78
views
Using meta boxes as the title of a custom post type
I have a custom post type with some meta boxes added to the post type.
The code for the CPT meta boxes works fine.
I then added the following code to use the meta boxes as the title of the post. The ...
16
votes
6
answers
15k
views
Trigger Javascript on Gutenberg (Block Editor) Save
So I have a metabox which I want to trigger some Javascript when a post is saved (to refresh the page in this use case.)
In Classic Editor, this can be done via a simple redirect hooked to save_post ...
2
votes
1
answer
2k
views
How do I migrate meta boxes from the Classic Editor to the "side area" in Gutenberg Editor?
I don't know what the new side area is called for the Gutenberg Editor. On the editing screen, it's the side bar on the right side with "Publish" button, and other post related settings such as ...
0
votes
1
answer
24
views
Meta Box clears saved field content
I'm new in WP developing. I added metabox field to page, all works fine, but last one, which is similar with others, when I press save page button it clears all fields, even fields which were saved ...
5
votes
2
answers
4k
views
Custom field metabox not showing in back-end
I recently updated my website after a while, and the custom fields meta box is not showing in the editor anymore. It isn't showing under "Screen Options" either. Any ideas why this could be, and how ...
0
votes
1
answer
216
views
Add Cancel Button to a Custom Meta Box
Any ideas how I could add a cancel button, like the default one in the Publish meta box, to a custom meta box?
The standard code is <a href="#visibility" class="cancel-post-visibility hide-if-no-...
0
votes
1
answer
57
views
where can i see the registered new field for posts using register_meta() ?
Where we can see the registered new field using
add_action( 'admin_init', 'register_my_sample_meta' );
function register_my_sample_meta() {
register_meta( 'post', 'my_registered_meta', '...
0
votes
2
answers
1k
views
Starting with tabbed metabox
I need a tabbed metabox for my plugin.
Actually they are 5 metaboxes each one in a tab.
I found these scripts:
https://speckyboy.com/10-simple-code-snippets-creating-beautiful-tabs/
Which one is ...
2
votes
1
answer
320
views
How can I filter the contents of a metafield before it's displayed in the admin?
With the cmb2 plugin I created a metabox with a textarea metafield this way:
function myprefix_register_metabox() {
$prefix = 'myprefix_';
$cmb = new_cmb2_box( array(
'id' => $...
0
votes
1
answer
344
views
Admin metabox with custom post type dropdown option not update choosed input after saving
I'm trying to build a little plugin for wp that add a button to custom post type page http://example.com/events that have a link to another custom post type page that I can choose from a dropdown menu ...