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

Preset custom fields

I'm creating a wordpress plugin which will create a custom post with custom fields like "time", "rating" etc whose will be fillable in admin. So far all tutorials I've seen only ...
0
votes
0answers
19 views

Add metabox if there is at least one post available

So I am building a WordPress Dashboard widget which will showcase all posts & pages where a Gutenberg Block is active. The below code does it's job and pulls in an array based on get_posts(). Here ...
1
vote
1answer
25 views

update post meta for checkbox in the admin when inserted in the front-end

Here's my problem, I allow a certain user type to create custom post type in the front-end of my site, with the wp_insert_post() function... users can put values within a form and there's couple of ...
0
votes
2answers
29 views

How to disable Author dropdown in Gutenberg's Status and Visibility panel

I recently noticed a new feature in the Gutenberg editor (I'm guessing introduced in Wordpress 5.8) that seemingly allows any user to post as any other user: I confirmed that using this new option, a ...
0
votes
1answer
35 views

submit two file input fields in the same form

I have a form which has two file input fields, each input should be submitted in different metabox in custom post type, when I try to submit the form it takes only the first one and ignore the second ...
0
votes
0answers
22 views

metabox upload multiple file

I have upload multiple file metabox, my problem is I need to display all files links attached to this post inside the post editor. when i upload the files it is already saved under the media but the ...
0
votes
0answers
20 views

Adding accordion-section to custom post type edit screen

I'm trying to add accordion-style meta boxes to the edit screen of a custom post type on the right hand side beneath the "Publish" meta box. Actually I'm kind of trying to replicate the Menu ...
1
vote
0answers
33 views

Unsaved changes in metabox inputs not detected in the block editor

I have added a custom field to the regular WP post type and added a meta box to the post editor as below (it is just an example with trivial checkbox): add_action( 'add_meta_boxes', '...
0
votes
0answers
10 views

Move Featured Image upload field into other meta box in custom post type

add_action('admin_menu', 'st_series_cpt_add_box'); function st_series_cpt_add_box() { global $fichead_meta_box; if( current_user_can('editor') || current_user_can('administrator') ) { ...
0
votes
1answer
31 views

I'm having trouble with Related Product "tax_query" 'terms' value

I have two custom page types. the first is "product" and the second is "accessories". On the product page, there is the accessories category "inputs" raleted post. Inputs ...
0
votes
0answers
21 views

How to make a complete Meta Box part of a complete Post Type?

I receive the code complete, but I don't know how to make the Post Type loads the MetaBox when creating a new Post, here is the Post Type: if ( ! function_exists('cpt_campaign_details') ) { // ...
0
votes
2answers
40 views

Show meta box only for default page template

I'm having an issue with one of my meta box. I want the meta box displayed only on the default page template editing page.php. The meta box doesn't show up on the editing page. add_action('...
0
votes
0answers
26 views

I want to create post inside custom post types

I try to make a theme for Movie Series and I want to create custom post types "Series" with make post "Episode" inside by custom field/metabox. And then url like: domain/series/...
0
votes
0answers
14 views

Metabox repeatable fields with select options

In my dashboard admin, I have two metaboxes with repeatable fields in the same page. The first metabox has only one input value $field[tag_filter]. The second metabox has a select tag to display ...
0
votes
0answers
15 views

Grab data Metabox repeatable fields to display inside other Metabox

In the admin dashboard, I have two Metaboxes with repeatable fields inside the same page. The first Metabox is a list of names of activities for teachers. Each activities is a row with only one input ...
0
votes
0answers
12 views

Metabox repeatable fields issue when adding second field

I have a Metabox with repeatable fields. My first input is $field[tag_filter], it works fine. What I'm trying to do is adding a second input $field[tag_ref]. Unfortunately with the second input the ...
0
votes
1answer
72 views

Illegal string offset in PHP function

I'm creating a metabox to upload PDF files. I have the following warning notice for this line of code: $this_file = $filearray['url']; Warning: Illegal string offset ‘url’ in... The complete function ...
0
votes
0answers
14 views

How to show error message in admin panel using WordPress?

I'm using WordPress and I want to add validation for the save_meta_data function and if the request isn't validated admin panel should show the error message. my code is here: public function ...
0
votes
0answers
25 views

Display metabox galleries on specific page template in admin editor

I'm building a Wordpress website with two metabox galleries displayed only on post type page in admin editor. What I'm trying to do is to display them only for a specific template page in the admin ...
0
votes
0answers
25 views

Add metabox to pages that use custom template in WordPress

I am trying to add custom metaboxes to only those pages that use a certain custom template that is applied to them. How can i do this? I based on this this guide: How to add add_meta_box to specific ...
1
vote
0answers
30 views

How to use custom form on add_meta_boxes callback

I am trying to trigger the echo when the form button will click. but not able to do this. if I don't use form and direct echo there. this is working. but when I use a form, it's not working. can ...
0
votes
1answer
17 views

How to 'clone' select metabox options with a callback function? [closed]

Here is my metabox array( 'id' => 'all_btns', 'name' => 'Button Select', 'type' => 'select', 'options' => array( 'button' =&...
1
vote
1answer
16 views

WP nonce field checkbox prints checked='checked' outside input field

I'm currently creating a custom post type in wich I want to add some custom meta boxes. All the fields just go as expected excepting a checkbox field wich prints on the html checked='checked' after ...
0
votes
0answers
31 views

Render metabox gallery in frontend

I'm building two metabox galleries on the same page with the help of a tutorial. The code works fine. However the galleries are automatically displayed after the content on the front end. What I would ...
0
votes
0answers
30 views

Making custom meta box required (with error message if not filled in) on Gutenberg

<input required name="myName" type="text" value="<?php echo $myValue; ?>" class="regular-text"> Does not produce an error message if the field is ...
1
vote
0answers
42 views

HTML for adding a meta box (basic text field) to page editor?

I am following this tutorial from to add a meta box to pages of a certain page template. Unfortunately the code omits the part on how to create the actual meta box on the page (the HTML). The code in ...
1
vote
0answers
18 views

Create custom Content Editor for CPT [closed]

Hi I'm new to Wordpress theme dev. I'm trying ro create a custom theme (child theme) in order to create a CPT for books. There I would like to have 3 separate WYSIWYG editors (english, french, german) ...
0
votes
0answers
20 views

how to only allow one selection to be made in meta box

Okay so I have one metabox for my CPT and it has multiple dropdowns in it. I need help in only allowing one selection to be made. if ( get_post_meta( $post->ID, 'item_type', true ) == 'page' ) { ...
0
votes
0answers
25 views

Remove Username and just show Name in Author Metabox in backend

In the Author Metaboxes for Posts / pages / custom types, it shows: Name (Username) Is there anyway to customize this to just show Name only? Or maybe Name and Role? I am pretty sure if it done with ...
0
votes
1answer
72 views

How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?

On the Edit Screen in the WP Admin there is a meta box for WP's built-in Category taxonomy. This meta box is built using post_categories_meta_box() (/wp-admin/includes/meta-boxes.php). This meta box ...
-1
votes
1answer
23 views

Remove action of an external plugin after checking if custom post meta is set

Edit:The problem were 2 folds - somehow the order list I found before indicated wp_head was before wp_enqueue_scripts but that is not the case. Found another more updated one and it is actually right ...
0
votes
1answer
42 views

How to hide metaboxes in WordPress Admin on WooCommerce "Add Product" page - Remove side sortables for a specific user role

How do I hide certain metaboxes in WordPress Admin screen options for specific user roles? For example, I allow the user role "Store Vendor" to access the WordPress admin to upload their ...
0
votes
0answers
10 views

How to add search to custom taxonomy boxes in non-gutenberg editor

I am using the latest version of WordPress (5.7) and have created a custom post type with custom taxonomies. I do not have the Gutenberg editor activated for the post type, so I do not have search for ...
0
votes
0answers
37 views

How to make a front end fields from metabox

I want to clarify that I am not a specialist, my query is how to insert a metabox in the front end, specifically I show you the image: I want to do this: But actually I have this: Those are the php ...
0
votes
0answers
67 views

Post and Pages section inside WordPress admin are completely blank

Meta Tags - Undefined array due to meta tags! I have created my own custom post meta tags but all works fine until I test my WordPress theme on the new WordPress Installation. What I came through ...
1
vote
0answers
19 views

Change the context of excerpt metabox for the 'New Post' page

With the Gutenberg layout, is it possible to adjust the context, or position, of the Excerpt metabox from the sidebar of the 'New Post' or 'Edit Post' admin page, to the main area, i.e. to a 'normal' ...
0
votes
0answers
10 views

Creation of a search page and event display with datepicker metaboxes

Being a beginner in the development of Wordpress theme, I'm currently trying to create a custom search filter on a dedicated event search page template. For this, I created custom fields of date ...
0
votes
0answers
43 views

remove metabox is not working for wp 5.7

Hi I am using wordpress 5.7 and Vidio theme, Here the theme have some plugins with it. Those plugins create a metabox with id haru_video_attached_directors. I want to remove this metabox from custom ...
0
votes
1answer
11 views

Unable to display selected post title in frontend from metabox wp_dropdown_pages()

I created a metabox in admin using wp_dropdown_pages() to display the list of posts from my custom post type workshop. The metabox dropdown works fine in admin, I can select the post title and save it....
0
votes
0answers
21 views

Load Dynamic Template Page by Metabox

Does anyone know how I can implement Wordpress as shown in the image below? I would like to have a unique url passing the company_name metabox as a parameter and from business_type create a function ...
1
vote
0answers
24 views

How to detect if metabox content was updated by the user

I am handling metaboxes and their updating process the standard way: // Attached to the save_post hook function the_save_stuff_handler($post_id, $post){ // Early return if(defined('...
0
votes
1answer
31 views

Show metabox value last post excerpt, title and link

I'm facing a problem I can't solve. I'd like to get the excerpt, title and link of the last post containing a particular meta-box button status. For example: I would like to retrieve the last post ...
0
votes
1answer
21 views

Move the metaboxes to the very top of post editor

I have this function that creates a custom metabox (with the metabox .io plugin), i would like the metabox to stay on top just below the title field this is the code i am using function generator_api()...
0
votes
0answers
22 views

Multisite Menu Metabox to list all sites in Network for Dynamic Network Site Menuitems

I don't understand why this functionality doesn't exist in Wordpress Multisite TBH. I have this working for Custom Menus and the List of Sites on the Nework is working in a Metabox also. However, I ...
1
vote
1answer
39 views

Using wp_editor tinyMCE in metabox cause form alert on leaving page

Using tinyMCE as wp_editor in a custom post type metabox create an alert when I try to submit or If I want to change location I don't have such behavior using Quicktags, but since TinyMCE is easier ...
1
vote
1answer
31 views

how to save and get selected item id list with add_meta_box

hi all i need create to metabox in page for the footer and header posttypes i created, in this code i tried for this but i cant save selected item and retrive id selected item in the frontend. ...
0
votes
0answers
17 views

Multiple header style under meta box

I am a wordpress developer. There is a problem I want add multiple headers through metabox in my theme but there is not working. Code: add_action("admin_init" , "multi_header_meta_box&...
0
votes
1answer
32 views

How to improve my non-unique metadata MySQL entries?

I'm working on a plugin for WooCommerce which uses a cpt called Restock. In a Restock post you can enter products ( id ) plus restock. The user can add as many product restock pairs as they want per ...
0
votes
0answers
8 views

display failed status on post edit

I created a meta box in the post edit interface that modifies a portion of a post on update (publish/pending/update/etc.) It's working great. I have tried a number of things to invoke a failed status ...
1
vote
1answer
24 views

how can i do metabox [closed]

how can I make a metabox like in the picture episode title : Episodes 1 Serie Name : The Seven Deadly Sins AirDate : gg.aa.yyyy

1
2 3 4 5
33