Questions tagged [metabox]

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

418 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
1answer
666 views

'Preview Changes' for custom meta boxes?

How can I have the 'Preview Changes' working for custom meta boxes? For instance, I just want to test/ preview some text in a custom meta box but I don't want to save/ update because that post/ page ...
6
votes
1answer
1k views

Prevent sorting and dragging of specific postbox metabox

I'm attempting to limit the jQuery sortable functionality on certain postboxes/metaboxes when editing a post/page. So far I've enqueued my custom .js file in admin. wp_enqueue_script function ...
4
votes
0answers
600 views

How to reload a select box of posts dynamically?

I'm using custom meta boxes for a project. I have created a custom taxonomy (select box) and I have another select box populated with Posts. I need to only load the posts based on the selection of the ...
3
votes
0answers
40 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 ...
3
votes
0answers
275 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 ...
3
votes
0answers
583 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 ...
3
votes
0answers
39 views

How do I add custom_meta_box_id's value?

I have added custom meta boxes in post and I want to put Tag slug name in the meta box text field, and want to display the text field's texts (Tag slug name) like following this. <?php $my_query =...
3
votes
0answers
47 views

Render Selected Categories in Admin Edit Post Screen differently

Selected Categories for a post in the admin screen are rendered by: // Put checked cats on top $output .= call_user_func_array( array( $walker, 'walk' ), array( $checked_categories, 0, $args ) ); ...
3
votes
0answers
174 views

How to create a repeatable / reusable divs in the metabox?

I have a meta box: <?php function custom_meta_box_markup() { global $post; $meta_box_text = get_post_meta( $post->ID, 'meta-box-text', true ); $meta_box_text_day = get_post_meta( $...
3
votes
0answers
1k views

How to add meta boxes(repeater fields) from WordPress back end?

I have a custom post type 'service'. Each service will have items. For each item there would be 'name of item' and 'price'. Earlier i created meta boxes for 5 items i.e 10 meta boxes in total, which i ...
3
votes
2answers
4k views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using this:...
3
votes
1answer
94 views

Display Single Attachment Image file size, uploaded date, resolution, file-name etc in Sidebar

Sorry for any wrong details. I am totally new to WordPress development. I am running a photo site. On single attachment page, I want to show the details (i.e upload date, filename, size, resolution) ...
2
votes
0answers
1k views

Add a custom field to top attribute in WooCommerce

i kinda went crazy trying to solve this. I need to add a custom select field (and save it) to WooCommerce Attributes edit / insert new page - in each top level attribute - not the sub "terms"... ...
2
votes
1answer
313 views

Dynamically adding WYSIWYG to metaboxes

I've created a custom metabox area and need to add the option of multiple metaboxes. So far I found this guide https://jeremyhixon.com/repeating-wordpress-editor/ which works absolutely perfect up ...
2
votes
0answers
127 views

Edit single attachment on click (WP-admin)

I've created a custom media manager for a CPT I've created. I have everything functioning properly except an edit function. I want to have an edit button for each attachment that gets added to the ...
2
votes
1answer
879 views

Add custom buttons with custom actions in Edit Post screen in WordPress?

I am creating something for a client and I have a Class that I created with a Custom Post Type called 'PuSH Feeds' and when the user adds a new post and publishes it they can then click on one of two ...
2
votes
0answers
648 views

adding checkbox to meta

I have a custom post type that is working well and displaying/saving all the text fields. The issue is now I need to add 4 check boxes but not sure how to do that. Any ideas? function fitter_info() { ...
2
votes
1answer
4k views

add_meta_box does not go 'side'

I'm trying to add some metabox to my custom post type. So I add this: add_meta_box( 'my_custom_meta_box_id', 'My-meta-box-title', 'my_custom_meta_box_callback', 'my-custom-post-type'...
2
votes
0answers
429 views

WPAlchemy: How to output values?

I am using http://www.farinspace.com/wpalchemy-metabox/ and have created my meta boxes and the data is being saved successfully (See below) but I don't know how to output these 'ingredients' on the ...
1
vote
1answer
13 views

Adding custom fields to bbpress reply form

Referring to post "adding-custom-fields-bbpress-topic-form" with link https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/, I want to add custom fields to bbpress reply form ...
1
vote
0answers
29 views

what is the difference between these phares?

I have mutli input fields in custom metabox.However, only 2-3 array items show on page, others doesnt seem.For example, "text-ruby" shows but "textname" doesnt show.Why? What is the difference between ...
1
vote
0answers
13 views

Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?

I'm currently working on a website that has a custom post type ("schedules") that requires custom hierarchal taxonomies (named "location" and "servicetype" in this case) to be displayed as radio ...
1
vote
1answer
22 views

Plugin - Combine Meta Box Input Fields into single saveble record

Im a complete novice when it comes to coding. I have managed to build a theme with some custom post types. Within the custom post type i have used a generator tool to create a custom meta box. It ...
1
vote
1answer
27 views

How to convert the WordPress meta box Page Attributes->Page Template dropdown to radio buttons?

I would like to be able to change the Page Attribute "Templates" dropdown to radio buttons, to allow me to have corresponding thumbnails next to them. I have already removed and replaced the Page ...
1
vote
0answers
21 views

Add custom links like functionality

I want same functionality like WordPress provide for custom links but additionally I want to add some class to those links by default that is added by this feature (Other websites). I have tried to ...
1
vote
0answers
22 views

Getting Custom Post Type Meta on Publish

Can you please take a look at this code and let me know why I am not able to get the Custom Post Meta on publishing the post. I tried thses function get_cpt_meta($post_ID) { $post = get_post($...
1
vote
0answers
25 views

Adding meta box without add_meta_box - is this bad?

I noticed that a plugin I am using has this hook during its rendering of a meta box in one of its settings tabs: do_action( 'learndash_metabox_options_div_after', $metabox->settings_metabox_key ); ...
1
vote
0answers
29 views

Remove metabox from WordPress menu editor page?

I'm trying to remove meta boxes added to the WordPress menu editor page from a theme, but can't seem to figure out how to do it, I found this answer, but I must be doing something wrong as it isn't ...
1
vote
0answers
45 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, ...
1
vote
2answers
324 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 ...
1
vote
1answer
552 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
vote
0answers
197 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(...
1
vote
0answers
97 views

Remove anchor tag from meta box link

i've created my own metabx. You can select items (shortcodes) from my plugin und these shortcodes return html code. How can i remove the complete a-Tag from my own meta-box content? meta_box ...
1
vote
0answers
14 views

Grouping metadatas into one

I want to have some custom metadatas for my custom post type. I know how to add the metadatas one by one, but I need to some of them together, considered as a single metadata. For example lets assume ...
1
vote
1answer
626 views

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, ...
1
vote
0answers
58 views

Anon function and add_meta_box

I am building a WordPress management plugin (so far going really well) however I am having a slight issue below is what I am trying to acheive and the problem. I am building a Meta manager and for ...
1
vote
1answer
262 views

Meta value does not save for scheduled posts

I created a metabox into my posts, it's a checkbox that I checked. Here's the code for saving the data : add_action('save_post','save_metaboxes'); function save_metaboxes($post_ID){ if (...
1
vote
0answers
848 views

Metabox not show in categories custom post type cmb2

it is possible to add a field in the categories (tags) in taxonomy? this is my code in functions.php function post_types(){ register_post_type('products',array( 'labels' =&...
1
vote
1answer
138 views

How to remove plugin metaboxes from edit.php

I want to remove some metaboxes, that was added to page edit.php by thridparty plugins. I insert this code into functions.php: function vpm_remove_meta_box() { remove_meta_box( 'ortext-...
1
vote
1answer
18 views

How can I make my metabox appear?

I'm fairly new to plugin development but have experience in coding. I've looked into several tutorials and managed to get my post type as slideshows, but I wanted to add a metabox to put an URL in. ...
1
vote
0answers
335 views

Get updated meta value after post update or published (custom post type) using hook

function corp_210517_save_post($post_id, $post, $update) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return $post_id; } if( wp_is_post_revision( $post_id ) ) { ...
1
vote
2answers
288 views

Upload Button in meta box not opening library

First, thank you for your help. I have created a custom template, added two metaboxes in Pages using a 'Page_Fiche_Metier.php' template. One meta box is to upload an image. But the Upload Button is ...
1
vote
0answers
183 views

Store multiple textarea data in database from a metabox

I am building Metabox in WordPress, and I have added two TextArea with JSON Data . but When I Click on Save button than only first textarea data can be stored in database insted of both textarea. <...
1
vote
0answers
420 views

Repeatable Fields Metabox with Textarea (or wp_editor)

I have a metabox that is using repeatable fields, however I need to re-use the repeatable fields in a more user-friendly fashion than simply by showing an input bar. Ideally I would like to be able ...
1
vote
1answer
267 views

How to use TinyMCE Editor for one of my custom post meta field?

I'm registering a new post type register_post_type('datasheet', [ ...., 'register_meta_box_cb' => [ $this, "add_metaboxes" ] ]); Adding metaboxes function add_metaboxes ( $WP_Post ...
1
vote
0answers
44 views

Custom Attachment Caption Fields

I am looking to create a new field group in the gallery Attachment Details section. The field group would be called Project Tiles would contain the following fields: Caption Link (ideally this would ...
1
vote
1answer
116 views

Show preview of post changes on page

I've got a pretty unusual feature request or just don't know how to phrase it, since I couldn't find anybody else trying to do this. In the editor of the front page I've added a custom meta box to ...
1
vote
0answers
984 views

Add Metabox to settings / options page

I am looking to add a metabox to an options page I have created using ACF. I have tried just about everything without success. I have created many metaboxes with custom post types but never with an ...
1
vote
1answer
109 views

Create Connection Between two post types

I am creating a custom calendar plugin but I am stumped with the connection of post types. I have a 2 post types "Calendars" and "Events". I would like to create a metabox that contains a table just ...
1
vote
0answers
350 views

Edit woocommerce product post type

How can I add a metabox to woocommerce product post type from an existing plugin? The plugin author says its not currently supported, but it's a feature I need. I've tried different things to no ...

1
2 3 4 5
9