Questions tagged [metabox]

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

428 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0 votes
0 answers
106 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 ...
Tom's user avatar
  • 13
0 votes
0 answers
29 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 & ...
Colin's user avatar
  • 113
0 votes
0 answers
175 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'...
user319940's user avatar
0 votes
0 answers
781 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 ); ...
Niloy Rudra's user avatar
0 votes
1 answer
196 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 ...
Morgan Janjua Crane's user avatar
0 votes
0 answers
246 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 ...
Dougless's user avatar
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 ...
Robert L's user avatar
0 votes
0 answers
192 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 ...
Kenneth Valinote's user avatar
0 votes
1 answer
266 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 ...
Mohamed Omar's user avatar
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 ...
bigant841's user avatar
  • 172
0 votes
1 answer
336 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 ...
vayderr's user avatar
0 votes
1 answer
66 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 ...
MFWebMaster's user avatar
0 votes
1 answer
198 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-...
Sal's user avatar
  • 153
0 votes
1 answer
51 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', '...
junaid TK's user avatar
0 votes
0 answers
100 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-...
Mona Coder's user avatar
0 votes
1 answer
251 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 ...
Aculine's user avatar
  • 13
0 votes
0 answers
87 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 ...
Someone's user avatar
0 votes
0 answers
287 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 : ...
user3309614's user avatar
0 votes
1 answer
245 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 ...
Luke's user avatar
  • 59
0 votes
2 answers
468 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 = ...
Luke's user avatar
  • 59
0 votes
0 answers
588 views

Programmatically create new post from a metabox button

Given a classic course-lesson structure, created by custom post types, I want to add a new empty lesson for a course, by using a simple html form on a metabox, in the course edit screen. I think I ...
Injaki's user avatar
  • 1
0 votes
1 answer
480 views

update_post_meta doesn't work

I've been drilling with codes for so long. I was trying to create a metabox with a simple textare on it. Been stuck for almost 10 hours tyring to solve this. Still up until right now my meta box ...
Marc Solva's user avatar
0 votes
1 answer
71 views

Wordpress admin area: select box with 12.000+ options

I have a custom post type that in admin area has a select custom meta box with 12.000+ options. So, in some cases, WordPress show an error message like memory exhausted. Which could be a good ...
Sebastian Villar's user avatar
0 votes
1 answer
25 views

Problem with adding exta field in metabox in custom post type

I am trying to add a new field in the metabox there is demo url field which is working fine i have created new field that is not storing or saving any datas which inserted into the field. Here is my ...
James Paul's user avatar
0 votes
0 answers
796 views

semantic ui dropdown for custom metabox

I'd like use Semantic UI Dropdown (https://semantic-ui.com/modules/dropdown.html) in my custom metabox for the plugin I making. I added the codes like that: // Styles wp_enqueue_style( 'semantic-ui', ...
Vincenzo Auriemma's user avatar
0 votes
1 answer
2k views

Add other all taxonomies as meta boxes to custom post type

I have a custom post type which comes with a category taxonomy. This taxonomy shows as a meta box at the side. Pretty basic so far. Now I want to add additional meta boxes below the content on the "...
xxtesaxx's user avatar
  • 101
0 votes
1 answer
133 views

featured image in custom poste type (backend)

I created a custom post type outside the wordpress loop. I want to integrate the featured image meta box in the backend for this post type. $this->add_meta_box('postimagediv','Beitragsbild', array(...
Andreas's user avatar
0 votes
1 answer
478 views

duplicate featured image functionality in custom meta box

I'm trying to figure out how to add a link/button that when clicked will open the set featured image modal and perform the same functions as if you clicked it in the original meta box. I am wanting to ...
lblankenship's user avatar
0 votes
3 answers
130 views

Displaying a Metabox linked to post settings for all users

Currently, I have a meta box that all Editors of my site can see. I want all contributers to see this meta box. I've used a user-role plugin and it looks like the meta box is linked to post settings....
Adam Turner's user avatar
0 votes
0 answers
242 views

Remove Custom metabox from particular page template is used

I have created custom metafields like the following and it was working fine. I want to show the metafield only when an particular page template is used. but it was not working. class ...
J. Shabu's user avatar
  • 167
0 votes
0 answers
38 views

Custom gallery displayin and sorting error

I am making frontand gallery uploader. Here is my example code: <?php //start of "for" loop $attach_id = media_handle_upload($key, $post_id); $attach_ids[] = $attach_id; ...
wpdev's user avatar
  • 539
0 votes
1 answer
217 views

Find callback function of custom meta box

I am reordering the default meta box layout in the following way: add_action('do_meta_boxes', 'move_meta_box'); function move_meta_box(){ remove_meta_box( 'my-itemsdiv', 'post', 'side' ); ...
angularchobo's user avatar
0 votes
1 answer
35 views

Is there default meta boxes types that handles types and sanitization?

I've been tasked with my first WordPress project. It's a project that involves custom plugin development. While looking over the documentation for adding custom post types I found the meta boxes ...
Magic Internet Money's user avatar
0 votes
1 answer
58 views

transfer two existing taxonomy terms into one custom metabox

Using this code I am able to add existing Terms from one taxonomy moviestax to my own created Metabox. function my_meta_box(){ add_meta_box( 'mymtx_div', 'This my own Meta box Only :-)', '...
Mona Coder's user avatar
0 votes
0 answers
77 views

set a custom post type to a taxonomy term programmatically in metabox

I have a Custom Post Type called Movies and it has a Custom Taxonomy called Genres. I also have 3 Terms under Genres called ['Action','Comedy','Horror'] Can you please let me know how I can Get and ...
Suffii's user avatar
  • 201
0 votes
0 answers
1k views

update_post_meta() not updating

I'm saving API data as metabox data, and I'm attempting to update metabox data on import. So the Title, content data will always update. But I can't seem to be able to use the ID to update the metabox!...
go_cuc's user avatar
  • 37
0 votes
0 answers
131 views

problem when uploading file by metaboxes

I want to upload pdf files via posts using metaboxes. I have this code: if ( is_admin() ) { add_action( 'load-post.php', 'call_MetaBoxClass' ); add_action( 'load-post-new.php', '...
saeid ezzati's user avatar
0 votes
0 answers
34 views

Dropdown of existing posts in a metabox

so i want to make a game profile System Like the one gamespot has on wordpress that shows every game's informations In all the posts related to that particular game. I Investigated and ended up ...
Poorya's user avatar
  • 13
0 votes
0 answers
279 views

delete post meta data in array WordPress

i want to delete post meta with same key like 'rtf_booking' but this key have store data in array like Array ( [0] => first booking [1] => second booking [2] => third booking ) ...
rahil ahmed's user avatar
0 votes
0 answers
282 views

Query by meta value (add a dropdown of all values)

I'm facing a problem I can't resolve alone. I have a custom meta field named 'processeur' for a custom post type names 'ordinateur'. What I need to to is get a list of all meta values, arrange them in ...
Samuel Haddad's user avatar
0 votes
1 answer
30 views

Wordpress CPT Url metabox collection

How can I set for my Custom Post Type 'company' different url's if this company have multiple locations. For example: CPT: "company" with slug http://example.com/company CPT Company Post:"Company ABC"...
Matt's user avatar
  • 1
0 votes
0 answers
414 views

How to display selected option from dropdown list in a metabox

I have this question that I have been looking for the answer to for over two weeks now and I finally decided to come here and ask. I have looked here as well and did not find an answer that helped. ...
tsquez's user avatar
  • 85
0 votes
1 answer
1k views

Get value of submit button in custom post type

I'm trying to make a quiz plugin. Using a custom post type, I've made a meta box, that has the following form table in it. <table class="form-table"> <tbody> <...
Mandu's user avatar
  • 7
0 votes
1 answer
187 views

Problems with file_exists() with metabox plugin in WordPress

I'm using metabox plugin (https://wordpress.org/plugins/meta-box/) and I get this warning message: Warning: file_exists(): File name is longer than the maximum allowed path length on this platform (...
user1443216's user avatar
0 votes
0 answers
792 views

Save, update, get and sanitize post meta as HTML not plain

My post meta always is plain text HTML striped from it I need to Save, update, get and sanitize post meta as HTML not plain here is all my related code to this post meta filed Retrieve from ...
adnan's user avatar
  • 323
0 votes
1 answer
232 views

$post->ID incorrect within meta box

I have a meta box and I am trying to get the current post id however I am getting the ID of a different post. Is there another way to get the ID? function global_notice_meta_box() { $screens = ...
Ben H's user avatar
  • 363
0 votes
0 answers
162 views

Wp Query sort order

Hey i have the following query sorting custom agendas posts on an archive page based on a metabox for the event date. $args = array( 'post_type' => 'agendas', 'posts_per_page' => $...
olivier's user avatar
  • 11
0 votes
1 answer
231 views

Metaboxes in Loop

I want to create metaboxes in foreach loop. The requirement is, I have an array of custom post types and I want to run a loop to add metaboxes for the post types that are as a key in an array. So far ...
saurav.rox's user avatar
0 votes
0 answers
335 views

meta box loop problem with a search filter

I've created a custom post type, and I added to it custom Taxonomies, As well as custom meta boxes, and I did an advanced search with several options. But I have a problem because of the duration loop ...
mhmd_bdr's user avatar
0 votes
1 answer
29 views

Dynamically getting tags in post edit screen

I am trying to dynamically get the post's tags as the user adds them while editting a post, but I have not found any hook related to that action. I know I can make my own hooks, but the thing is that ...
Zeko's user avatar
  • 1

1
3 4
5
6 7
9