Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
9 views

Shortcode of Custom Post Type Metabox Array

I have an Custom Post Type which dynamically creates 2 textboxes, one for date and one for description. In my single-template I use the following code, which functions perfect. But when I use it in a ...
0
votes
0answers
21 views

Creating a simple metabox to the editor menu page

Right now I'm stuck creating a metabox to the menu section in a custom Wordpress Theme. I am using the hook load-nav-menus.php and this is what I have so far based on research and trying to learn ...
0
votes
1answer
37 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-...
0
votes
0answers
11 views

How to add a checkbox (or extend in any way) to Menu Custom Link metabox?

I'd like to add a checkbox to the Custom Links metabox. User will be able to select true/false. Based on the value, the front end will or will not display data. I've tried extending Walker_Nav_Menu ...
0
votes
1answer
23 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
1answer
22 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
1answer
57 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 ...
0
votes
0answers
79 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 ...
0
votes
1answer
22 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 "Mobile ...
0
votes
1answer
19 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
0answers
18 views

Problem registering a custom meta box

Hi I'm struggling with registering a custom meta box. I have registered post types and a taxonomy as follows: add_action('init', 'gws_lt_register_cpts'); //register custom post types function ...
0
votes
1answer
18 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 ...
2
votes
1answer
168 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 ...
0
votes
0answers
11 views

Meta box built with loop have 1 error in input

I am making a loop to build metabox with several inputs. It is working , but there is something strange happening. When loop runs. all inputs are working fine except one. always the same one. ...
0
votes
0answers
17 views

Post Meta deletion ajax not working

I am trying to remove function in the backend of post like plugin. In the post like plugin they are storing values in the following manner that is User Id , Post id and comment (or) Post . ...
2
votes
1answer
53 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
0answers
10 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 ...
0
votes
0answers
20 views

issues with Custom Post Type retaining page template value after publishing

As the title of this post implies, I am having issues creating/editing posts of a Custom Post Type, assigning it a page template via the 'Attributes' metabox and having that page template display as ...
3
votes
2answers
77 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
1answer
13 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
0answers
19 views

How to add custom checkbox fields on woo-commerce product and products categories?

How to add custom checkbox fields on woo-commerce product and products categories, if checked in checkbox This product can't show without admin.
0
votes
1answer
17 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
0answers
11 views

Hide excerpt note [duplicate]

Under the WordPress excerpt meta box is a note: Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Learn more about manual excerpts. Is it possible to ...
0
votes
0answers
10 views

How retrieve custom meta box user input value to another admin page

In my plugin I made a custom metabox, inside metabox have a input field(users can submit) , I think i need to use post id it's a custom post type called products. I did it many ways but it's not ...
0
votes
1answer
30 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 ...
1
vote
1answer
18 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
1answer
33 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 ...
1
vote
2answers
39 views

Outputing a metabox textarea and avoid line breaks inside li tags

I have added a custom metabox that holds string from a textarea in database. Now if I just simply echo the meta box like this: $post_meta = get_post_meta($pid); $answer = $post_meta["answer"][0]; ...
0
votes
0answers
16 views

Issue on Creating Checkbox Field On Custom Post type

Can you please look at this demo let me know how I can create and save a checkbox as a custom field in Custom Post Type? function render_metas( $post ) { $we_productMetas = get_post_custom( $post-...
0
votes
0answers
15 views

Custom taxonomy to display in dropdown in custom meta box

I have a custom taxonomy associated with a custom post type. I would like to be able to display it in a dropdown menu (so you can only select one taxonomy type) and also would like to have the ...
0
votes
1answer
23 views

Woocommerce add a text field if specific option is selected

I need to make active/visible a new filed before 'Add to cart' button, only if user select a specific option. The case is simple: I sell t-shirt with options: "Small", "Medium", "Large", "Size upon ...
0
votes
1answer
21 views

Custom meta box data array: foreach not working correctly?

I have written a plugin to create a new custom post type named gardener, and have added a custom taxonomy called region, in addition to a meta box with several fields called _gardener_address. The ...
1
vote
0answers
23 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 ...
0
votes
1answer
32 views

Woocommerce wp-admin search products through custom meta value too

Right now I can search only through title and content. How can I search also through a custom meta box value?
0
votes
0answers
15 views

metabox images outside post (wordpress)

i have a little problem while getting images from a post to an external page, ex: i want to use lastest post images inside a slider used as header placed to the homepage (i'm using metabox to insert ...
0
votes
0answers
81 views

Creating a “Related Meta” type field?

I need a unique meta box which can contain auto-updating elements similar to how a tag cloud would appear. Example. identifier id : animals identifier data : Dog, Cat, Horse, Pig I need to know ...
0
votes
1answer
25 views

How to Use Custom Meta Field Instead of CPT Title in Post URL

I have a custom Post Type which is not using any of WP builtin supports like( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ). Instead I am using my own metaboxes to publish the CPT. ...
0
votes
0answers
51 views

How to Upload CSV Data into Custom Post Type Data with Metabox programmatically

I have a Custom Post Type called movies which had only title enabled from post support and 3 custom field of metabax as box office, year, and director like now I have like 150 rows CSV formatted ...
0
votes
2answers
80 views

Scripts and tags will not save or output from my custom meta box

I am copying this tutorial to make my own custom meta box https://www.sitepoint.com/adding-meta-boxes-post-types-wordpress/ It works perfectly, however I need to be able to enter script tags into ...
0
votes
1answer
20 views

How to store multiple custom meta box

I am trying to store a multidimensional array of a Quiz where I dynamically add question box. But I am not able to figure out how to store dynamically added question box. The code is below function ...
1
vote
2answers
35 views

Undefined Variable - Custom Post Type Meta

I've read many related questions and have tried all that I could so make sure it's actually a duplicate before flagging please. I've been using WordPress for about 6 years so when I say I'm stuck, I ...
0
votes
0answers
35 views

Featured Gallery to custom post type

I want to show Featured Gallery metabox in my custom post type. I have it only in article page, and i want to add it to my custom post type. How i can do it ? I tried with this, but not work : ...
0
votes
1answer
35 views

Custom taxonomy with custom post type archive page

I created a sustom taxonomy and a custom post type via Metabox plugin. I am able to create custom post type posts and assign them to the custom taxonomies. But when I am trying to list them on an ...
0
votes
2answers
34 views

Meta Box: display single image on an archive-template

I'm trying to get the url of an image from a MetaBox (plugin) filed on an archive-page. <?php if ( rwmb_meta( 'field-id' ) ) { // Get images $img_srcset_large = ...
1
vote
1answer
29 views

Having trouble getting my meta data to save

All I'm doing is creating a simple meta box for my posts that calls the existing tags, then displays them in a select drop down list for the editor to choose. I feel I'm so close in making this done.....
0
votes
2answers
24 views

How to set Post meta-box defaults based on the choices made by user in Customizer?

I have a radio control in the theme customizer. The code for that control is like below: $wp_customize->add_setting( 'post_layout', array( 'capability' => 'edit_theme_options', 'default' =&...
3
votes
1answer
29 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) ...
0
votes
1answer
19 views

How many meta-query fields support WordPress search at a time?

I am new developer. I want know How many meta-query fields support WordPress search at a time? I saw that its getting (500 time out) errors after nine fields.
0
votes
0answers
12 views

Styling the post author meta box without editing the wp core

I'm using Advanced custom fields so that I could place a checkbox 'Certified' in user panel. I look at the user profile and check the box if the user meets certain criteria. I would like to style the ...
2
votes
1answer
436 views

Gutenberg add a custom metabox to default blocks

Is it possible to add custom meta boxes to the default blocks in Gutenberg? I would need to add a user-defined data-attribute to each block. This data-attribute then would be printed on the frontend ...