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
61 views

custom meta box data not saved

After two day of reasearch and questions without answer, today someone has suggested me a way to add a custom metabox field to the wordpress images. My scope is to add an url when the image are ...
0
votes
1answer
22 views

Add custom metabox to media library images

Is it possible to add a custom meta box for the images of the media library?How I achieve this using add_post_meta() function?
0
votes
0answers
19 views

I created a Custom Meta Box but it is not displaying the value on my post page

So i created a custom meta box, here is the code : add_action( 'add_meta_boxes', 'register_meta_box' ); function register_meta_box(){ add_meta_box( 'author_email', 'Author Email Id', '...
0
votes
0answers
15 views

Load meta box inside meta box.. is this possible?

Wondering if I might do this as I'm looking to create a To Do View like on github project view does. Any insight will be appreciated, I may just go for a completely custom solution but if someone ...
0
votes
0answers
11 views

Add Metabox based on select data in Custom Post Type

This will sound a bit strange at first, but it will make sense later on. So I have a metabox, and I am using Metabox.io to create Metaboxes. Now, I have a metabox which has a dropdown, and a ...
0
votes
0answers
8 views

Cannot clone group of Custom Fields in CPT

I have my CPT, and I am trying to clone the group of Custom Fields in my metabox named as Credits. I have these fields to be cloned each time, when the user hit on + Add Group button: Text ...
0
votes
1answer
21 views

WP_List_Table Inside Metabox Not Working on Clicking Search Button

I'm trying to display a WP_List_table inside a metabox. The metabox is for listing registered users to a course(LifterLMS Course Post Type). The table columns contain user_id, user_name, percentage &...
1
vote
1answer
21 views

How Meta Data is different from Custom Fields of POST/PAGE in WordPress

I am really looking forward to have a clear picture of Why Meta data is being used for the Posts/Pages? I have always been wondering on how Meta data is different from the Custom Fields of Posts. I ...
0
votes
1answer
21 views

Custom metabox with image gallery upload that won't attach images to post

I have created a custom metabox with an image uploader that will upload multiple images into a gallery that I can then query. It all works accept for the fact that the images don't show as attached to ...
0
votes
1answer
14 views

Modify Publish Metabox location on CPT

I've been struggling with how to do this properly and have yet to find a solution. I have a CPT with ACF fields. I can't use a front-end form because I'm synchronizing the CPT across several ...
0
votes
0answers
34 views

Adding a drop-down (select tag) option under Menu Settings in WordPress Admin

I looked (surfed) around a lot to get idea of how can I add custom field/drop-down under "Menu Settings" in WordPress Admin. I want a select tag with options from which I can get value based on the ...
0
votes
1answer
19 views

Custom Meta Box returns no HTML

I'm trying to write my first plugin and running into an issue with the callback in add_meta_box(). The meta box appears on the custom post type page however there is no content inside. Here is the ...
0
votes
1answer
15 views

Cannot add a class to metabox

I'm trying to add a class to the metabox, for doing so I have created the metabox element in this way: array( 'label' => esc_html__( 'Property Lot Size', 'zoacres' ), 'desc' => ...
0
votes
0answers
12 views

Metabox - update Post - save duplicated rows to database

I have created a custom_post_type with a Metabox where i can duplicate rows / items with jquery and i can sortable them. Now i want when i save the post, that the content (input fields) are saved. I ...
0
votes
0answers
14 views

Wordpress Plugin Development Code-Editor Codemirror include - Style-Error

I used the codemirror for my textarea. Strangely enough, the text starts behind the sidebar and you can't work with it. Is there a specific setting for this? In the CSS code I couldn't see anything ...
0
votes
0answers
17 views

Wordpress Filesystem create CSS-File - get Shortcode ID for Name

My Script creates an CSS File when i save the post with the shortcode ID at the end of the filename. e.g. (test-293.css) The Problem is, that i need to register this individual File in my frontend and ...
0
votes
0answers
26 views

wp_editor in custom post type is not saving formatted text like bold, italic etc

My custom post type has 5 custom meta boxes which use wp_editor. Visually I can format the content but when saved, all the formatting is gone. For example I made a portion of my content bold, but ...
0
votes
0answers
17 views

“Meta box” plugin does not save when using classic editor

I am building a plugin, which relies heavily on Meta Box -plugin. Everything works fine, except when using classic editor, ie. with Classic Editor or WP Bakery plugins. Then the changes to the fields ...
0
votes
0answers
10 views

How to create a custom metabox like the wordpress provided tag metabox?

I want to create a custom meta box like this: What's the code I should add and where file should i add it in? I'm using wordpress' 2017 theme
0
votes
0answers
24 views

update_post_meta() throws Uncaught error: Cannot create duplicate attribute

In my plugin I'm creating a post of a custom post type. Immediately after creation I'm trying to update some of the metadata that I've defined in metaboxes for this CPT. Upon execution of the code, ...
0
votes
1answer
28 views

Metabox multiple custom post select -> display selected items?

I'm building a theme that needs some cross-information(?) between custom post types. I have a metabox to select custom post types and display them inside the single page of another custom post type. ...
2
votes
4answers
148 views

Relate two custom post type using meta box

I've two custom post type: 1.products 2.seller Now I want to relate both the post types using the meta box. I want to display products in seller posts so that sellers can select the required ...
1
vote
1answer
20 views

MetaBox body is not showing (the callback function)

We're creating a plugin where, for example, it shows a metabox on all post types. To kick things off, I'm using the Starter Kit. <?php namespace PLUGIN_NAME; class Foo { public function ...
1
vote
1answer
49 views

Choosing a default page tempate (Classic => Gutenberg)

This code was working in the "Classic" era to set a default page template: /* Blank Page by default */ add_action('add_meta_boxes', 'blank_default_page_template', 1); function ...
0
votes
1answer
34 views

How to pass multiple custom fields as shortcode's parameters

I'm learning how to pass parameters in shorcode, I know the basic step after read through WP Codex. But for now, I have plugin come with custom fields and as the title, I want to know how to do it. ...
0
votes
1answer
26 views

How to save a Woocomerce metabox input as a metadata field

I have a plugin that adds videos in place of the featured image of Woocoemerce products. The plugin just adds the video URL and saves it within the product. I would like to provide the saved URL via ...
1
vote
1answer
53 views

WordPress nl2br is not converting newline to html line break when saving metabox value

I tried possible solutions to save \n as <br /> from my custom post type <textarea> metabox but it is not working. I am using a custom made theme and there is no additional plugin ...
0
votes
0answers
8 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
125 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
32 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
41 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
52 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
39 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
15 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
106 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
27 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
99 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 ...
0
votes
0answers
25 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
27 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
3answers
309 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
25 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
17 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
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 = ...
0
votes
0answers
17 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 ) { ...
3
votes
0answers
31 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
56 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
41 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
47 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
24 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 ...