Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Second featured image only shows in metabox preview after saving a post in the wordpress editor

I am trying to add a second featured image to the Wordpress post editor, and it seems all be working. When I select and image from the mediauploader the first time the image shows in the preview of ...
Brango's user avatar
  • 1
1 vote
0 answers
143 views

How to get meta box labels?

I know how to add a meta box, and I know how to retrieve meta box values. That's not what I need; I just want to clarify that first. What I need is to get meta box labels by id. I am adding links to ...
Aristocles's user avatar
1 vote
0 answers
108 views

Save Meta when custom Taxonomy Saves

I am in need of some advice, we are setting up a custom tag for Movies. We want to have it pull from the OMDB Api when it is saved. We have the function setup, but it is not firing, and I am stumped. ...
Bfrye26's user avatar
  • 11
0 votes
2 answers
223 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('...
Mathieu Préaud's user avatar
0 votes
1 answer
1k 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 ...
Mathieu Préaud's user avatar
0 votes
0 answers
82 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 ...
Mathieu Préaud's user avatar
0 votes
0 answers
237 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 ...
Mathieu Préaud's user avatar
0 votes
1 answer
45 views

Wordpress default post categories meta box widget

I have a plugin that automatically selects the categories in the wordpress post editor, sadly after installing the Rank Math - SEO plugin the default metabox of the post editor has changed and the ...
Vincenzo Piromalli's user avatar
0 votes
0 answers
45 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 ...
manu wide's user avatar
1 vote
1 answer
2k views

How do I update a field of a meta box?

While parsing data from a CVS file into a custom post type, i would like to parse data into the fields of a meta box, that I created. The meta box fields are normally updated like this: function ...
Dougless's user avatar
0 votes
0 answers
88 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
1 vote
0 answers
62 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 ...
Trixxy's user avatar
  • 11
1 vote
1 answer
62 views

A good strategy to print custom posts (offer) that are checked inside the metabox of a post?

the code for getting the metabox in image is: function op_register_menu_meta_box() { add_meta_box( 'op-menu-meta-box-id', esc_html__( 'Custom offers Checklist (select any 2)', 'text-domain' ), '...
Nimesh's user avatar
  • 441
1 vote
1 answer
30 views

What's the difference between same wp functions get_posts(); functions in different form?

get_posts('post_type=post&numberposts=-1') and the get_posts( array( 'post_type' => 'post', 'posts_per_page' => -1 ) ); Are they the same?
Nimesh's user avatar
  • 441
3 votes
1 answer
2k views

Find callback function for custom taxonomy metabox

I'm looking for a way to move my custom taxonomy metabox (on the right side) to the post area (the middle). I'm aware you can simply drag and drop it, but I want it in the post area by default for new ...
stacked-cabbages's user avatar
-1 votes
1 answer
424 views

Decimal stripped from metabox number

I am working on a Wordpress website for a client to show several property listings and their associated prices. When I enter the number in the metabox created by the developer it strips out all ...
Kristin P's user avatar
2 votes
4 answers
58k views

radio button is checked but display not check

im trying to save different value of radio buttons on same name, it works and was able to make checked appear if the correct value is saved. As you can see on the screenshot ABOVE (which is taken on ...
Archangel17's user avatar
1 vote
0 answers
69 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 ...
user2798841's user avatar
0 votes
1 answer
1k views

Why does this update_post_meta function not delete the custom field itself?

I'm trying to set a meta key value of either "yes" or null with the checkbox so I can select posts using a query that checks if the meta key exists and not use the value of the meta_key. I don't want ...
BlueDogRanch's user avatar
5 votes
1 answer
4k views

Detect meta value changes when post is updated (post_updated)

In my theme, I want to create the function that when a metabox value is changed, the author is notified. Effectively, I have a custom metabox that loops through a certain level of user role (custom ...
markb's user avatar
  • 299
2 votes
2 answers
515 views

How to: add option to add more checkboxes on custom post type

I have created a custom post type where in one of the metaboxes I have checkboxes where author can select what he would like to add on the post. Now, if the author wants to add something that is not ...
Abdul Qadeer's user avatar
0 votes
1 answer
4k views

Warning: call_user_func() expects parameter 1 to be a valid callback, function

I keep getting this error when. I am trying to insert a dashboard widget and I don't know what's causing the error. Warning: call_user_func() expects parameter 1 to be a valid callback, function '...
Stephen Afam-Osemene's user avatar
1 vote
1 answer
240 views

Cannot save CPT meta box

I swear I have tried every tutorial, and looked through every Stack Overflow thread to figure out what I'm doing wrong... I'm creating a custom wordpress backend for a church that includes a place for ...
AJ Fick's user avatar
  • 13
1 vote
1 answer
1k views

get_post_type() in in_array doesn't work for some reason

I am trying to create some function for metaboxes and some reason i can't get get_post_type to work in in_array. Everything else seems to work in testing but in_array nope. This is the function that ...
lonerunner's user avatar
1 vote
1 answer
749 views

How to rename "Publish" metabox title in post screen

I've looked everywhere trying to find how to rename the "Publish" metabox title in the WordPress backend post screen. There's help for every other metabox for changing titles and there's help for ...
Pete's user avatar
  • 1,048
4 votes
1 answer
5k views

echo value from 'select' field type into page template using cmb2?

I'm using CMB2 plugin to add metaboxes into a custom post type. I'm adding the additional metaboxes via functions.php onto child theme. It may worth to mention that parent theme/custom post already ...
VA-YVR's user avatar
  • 41
0 votes
1 answer
152 views

Custom meta box save values issues - Deprecated: Function ereg() and more

I'm a WP theme dev nobie and I have problems with saving custom meta boxes values. I found some tutorial where its explained how to do this. I have included a file called custom-meta-boxes-save.php ...
Damir's user avatar
  • 113
1 vote
1 answer
748 views

Custom Post Type with Templates using Meta Boxes?

I have this issue where I need a CPT to have several layout options and use templates. Originally, WP does not support templates for custom posts, however I know its possible to do it manually via ...
nerijusgood's user avatar
0 votes
1 answer
7k views

Adding jQuery datepicker to Custom Post Type Metabox [closed]

I've created a custom post type metabox which displays and functions fine. The problem is with the datepicker it just doesn't seem to work, when clicking the metabox youre able to type in it rather ...
dannyw24's user avatar
  • 451
0 votes
0 answers
98 views

Display a post based on its metabox selection

I created a client portal where a client can view their projects. I have two user accounts "Clients" and "Administrator. Both clients and administrator are redirected to the frontend of the site to a ...
user3756781's user avatar
0 votes
3 answers
1k views

Custom meta box in custom post type not working

As a wordpress newbie I am having problems in adding custom meta box in my "slider" custom post type which I used in some old wp theme. I'm getting a warning: Warning: call_user_func() expects ...
Damir's user avatar
  • 113
0 votes
1 answer
105 views

Meta Box value not been pulled in

Here is the code that creates my metabox on my CPT named clients it displays fine and seems to keep the value input upon clicking update. The problem is with displaying the value saved within the ...
dannyw24's user avatar
  • 451
0 votes
1 answer
44 views

Unable to Call More than One Meta Box Output

I have a custom meta box with multiple text fields. I use this to call the information in the first box: <?php the_post(); echo get_post_meta( get_the_ID(), 'dbt_text', true ); ?> And this to ...
AndrettiMilas's user avatar
0 votes
1 answer
5k views

Meta box not appearing in my custom post type

I followed this tutorial on how to create a metabox on a custom post type I made and, at the time, it worked perfectly. the fist time worked like a charm. This time though, In a very similar ...
GuiHarrison's user avatar
0 votes
2 answers
4k views

Display custom meta box in my template file

Need help displaying my custom meta boxes on a template file. Following a tutorial Here's the code from my functions.php: function get_custom_field( $value ) { global $post; $custom_field = ...
SPS's user avatar
  • 115
2 votes
1 answer
4k views

How to hide, and not to remove the attributes metabox?

I need to hide, and not to remove the attributes meta box in the backend. The following code is removing the metabox: function hide_meta_box_attributes() { remove_meta_box('pageparentdiv', 'post', '...
Traveler's user avatar
  • 307
0 votes
1 answer
434 views

Help with my first Metabox helper class

I'm working on a metabox helper class and everything works well, but the radio image field. The images show up, but they aren't clickable. // Print radio_image input. private function ...
Daniel's user avatar
  • 1,216
0 votes
1 answer
394 views

Metabox Data not saving

My Metabox data doesn't appear once I've saved the page, I tried vardump() on both getextra_mbe_date and getextra_mbe_time which returned null my code is <?php /* Plugin Name: Events CPT Plugin ...
dannyw24's user avatar
  • 451
1 vote
1 answer
133 views

Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?

I'm in the process of creating a leveled tutorial structure in WordPress and want to build it so that it sets up the front-end with no code needed from the user. So far, I have a custom post type ...
RachieVee's user avatar
  • 830
1 vote
1 answer
2k views

Image media upload metabox

I've created my first image upload metabox but seem to be having problems. The data doesn't get saved when I add an image then update the page - I'm sure this is a typo on my end which I'm failing to ...
Dannyw24's user avatar
0 votes
1 answer
130 views

Metabox Input Not saving

I haven't made any meta-box's in quite some time so quickly threw together this one for a website I'm developing. My problem is that when I input some text in the box's and hit save the text ...
dannyw24's user avatar
  • 451
3 votes
2 answers
2k views

How to remove a metabox from menu editor page?

I am not sure if it is much different for any page but I am wondering how to remove a metabox from the appearance>menu page without having to go into the wordpress core files and remove it. Is there ...
user1632018's user avatar
0 votes
1 answer
137 views

How can I create a menu items from meta box based on users input

I have created a metabox that takes a name that the user can give as an additional name of their post. I am wondering how I can automatically create a menu item based on the name the user input into ...
user1632018's user avatar
1 vote
1 answer
54 views

Trying to retrieve post meta

I have created a meta box that allows users to add an additional name/id to their post. From what I can tell it is adding the meta information correctly because when I edit a post that has a custom ...
user1632018's user avatar
0 votes
1 answer
2k views

Get post meta retrieving wrong value

I created a custom meta box with a textbox where the user can enter a custom value in as an additional identification tag. I thought I had it right but when I try to retrieve the value it is giving me ...
user1632018's user avatar
0 votes
1 answer
2k views

Saving multiple Metabox contents

I'm putting together a fairly simple Custom Page for a friend on their WordPress site, but I'm having some real difficulties getting the contents of the Metaboxes to save correctly. WordPress doesn't ...
Django Reinhardt's user avatar
4 votes
3 answers
4k views

Auto close (hide) custom metabox / set default state

I am using the WordPress function add_meta_box() to add my own custom metabox. So how can I auto close/hide on page open ? Currently, I just add a CSS class closed to metabox's <div> element ...
l2aelba's user avatar
  • 857
1 vote
1 answer
2k views

How to hide a plugin metabox for non admins when a user adds a new post

I've been able to disable all the meta boxes for non admin in their backend but I'm having problems with Facebook AWD All in one which creates a widget seen by all the users when they create new posts....
user27309's user avatar
  • 359
1 vote
1 answer
957 views

Custom Metabox Not Saving

I've simplified a problem of saving custom metaboxes on update and still can't get the box to save the custom-field input to the database. This is the call from functions.php to an external file /...
tigre's user avatar
  • 155
0 votes
1 answer
2k views

Custom metabox not working

Morning! I have a call in my functions.php file to include a custom meta-box php file in my theme's directory called: /metaboxes/home-meta.php The code is as follows for the call: add_action( '...
tigre's user avatar
  • 155