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

learn more… | top users | synonyms (2)

-1
votes
0answers
30 views

Cannot save Meta Data in custom post

I am trying to wrap my head around Wordpress, and am really sturggling to understand how to save custom data. I have tried so many different ways, I have forgotten what I have even tried. // Custom ...
19
votes
5answers
12k views

How can I put a custom meta box above the editor but below the title section on the edit post page?

I have a custom meta box for a custom post type that my client wants placed between the title/permalink section and the post editor in the admin panel. Is this possible and if so is there a hook/...
2
votes
2answers
43 views

Metabox Not Showing on Custom Post Type But On Pages and Post

I have a Custom Post Type like function cpt_Projects() { $labels = array( 'name' => 'Projects', 'singular_name' => 'Project', 'menu_name' ...
0
votes
0answers
32 views

Color picker for posts and pages

I want to add color picker to wordpress posts and pages at admin menu. I have this code for color picker: add_action( 'admin_enqueue_scripts', 'add_color_picker' ); function add_color_picker( $hook )...
4
votes
2answers
110 views

esc before saving or before displaying does it matter?

In a lot of how to create a custom meta box tutorials, when saving data, i.e., update_post_meta the data is escaped: update_post_meta( $post_id, 'city', esc_attr( ucwords( $_POST['city'] ) ) ); ...
1
vote
1answer
31 views

Populate dropdown from one custom post type inside another custom post type

[Solved -> see last comment in this question] In custom post type CPT_A I am saving first_name and last_name via a custom metabox form field (they are not taxonomies): update_post_meta( $post_id, '...
0
votes
1answer
47 views

Meta box not saving

I am following Noel Tock's tutorial on making an Events CPT and so far I was able to show the custom columns and the custom meta box. The problem now is that I cannot save the data inside the meta ...
2
votes
0answers
19 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 ) ); ...
1
vote
5answers
1k views

How do I get attachment_id?

This is trivial, but I can't really find an answer, I've seen some hints like search in database etc., but this is madness. Basically, I have a metabox with upload button that allows you to upload or ...
1
vote
1answer
1k views

Using radio button meta data from a custom meta box

Very new to attempting PHP and am hacking together my first plugin using tutorials.. I have a custom meta box with a Yes/No radio button on all WordPress pages (in the editor). EDIT- I removed the ...
2
votes
3answers
815 views

Editing Screen: Make Update or Publish Button Follow The Page

The Problem: I am currently in the finishing stages of a premium theme I've been developing and all is mostly well. For pages I have a few custom meta boxes for adding in slideshows and other ...
1
vote
1answer
26 views

Metabox context for page post type

I would like to add a meta box underneath the title, but before the editor on a page post type in admin. I can add it to a post, but not to a page and I don't understand why. I've used this to add a ...
0
votes
1answer
29 views

Removing Meta Generator

I've noticed in the source of my page is shows in the meta generator Wow-Themes.com. I have been trying to remove this from the source using function rm_generator_filter() { return ''; } if (...
0
votes
0answers
18 views

WordPress loop by three meta values with random order

We have three custom fields with names plan_name1,plan_name2 and plan_name3. Need to check if these meta keys has values (1,2,3) OR (2,3,1) OR (1,3,2) OR (2,1,3) OR (3,2,1) OR (3,1,2) We mean ...
0
votes
1answer
36 views

How to Duplicate (multiple meta box)?

I've made a meta box field which works nice, but now i need to add one more. For the past few hours I've tried to mix every piece of it, to duplicate it, take some parts, google, search, and no luck. ...
20
votes
9answers
24k views

meta_query with meta values as serialize arrays

I'm working on a project in which I'm creating a custom post type and custom data entered via meta boxes associated with my custom post type. For whatever reason I decided to code the meta boxes in ...
0
votes
1answer
42 views

Problem with saving large amount of data in postmeta/usermeta

I am facing issues saving large amount of data in post meta field e.g. I have created a field Bio/description and put a huge amount of text in it. Now when I save it, it saves some of the text and ...
0
votes
1answer
38 views

Odd behaviour for the update button when displaying a WP_List_Table

I am currently trying to add a WP_List_Table to a metabox in the edit page of a custom type. The code is currently class Post_Table extends WP_List_Table { public function __construct() ...
0
votes
0answers
11 views

Time blocking for publishing a custom post type

I'm looking for a way to replace the "time" input boxes on the post meta box. When scheduling a post I want to replace the time inputs with a dropdown populated from the database. When someone selects ...
0
votes
0answers
29 views

Extend Metabox.io map field to sepearate lat long values

I am trying to separate the latitude and longitude values returned by the map field from the metabox.io plugin and save them as separate values. I have found a comment from the author (shown below)...
0
votes
1answer
65 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 ...
0
votes
1answer
57 views

Adding Meta Box to Specific Submenu Page

I've created this page: function wpdocs_register_my_setting() { add_submenu_page( 'edit.php?post_type=task', 'View Tasks', 'View Tasks', 'manage_options', '...
0
votes
2answers
44 views

Get custom term meta problem on single post type

I'm trying to display a custom field value added to custom taxonomy on single custom post type. I have articles post type with custom taxonomy called issue. I used the code from Tax-Meta-Class to add ...
1
vote
1answer
586 views

How to add meta box to plugin admin page?

There is the codes. add_action('admin_menu', 'test'); function test(){ add_menu_page( 'Test plugin', 'Test plugin', 'manage_options', 'test_plugin_options', 'test_plugin_admin_options' ); }...
0
votes
0answers
45 views

Redirect to an anchor after click update button in a metabox (CPT)

On my Custom Post Type (CPT), I had multi metabox and I need to have some buttons to update each metabox. I use jQuery to trigger the submit event when a different element is clicked (see this answer ...
3
votes
3answers
3k views

Adding submit or update button to custom metabox?

I have alot of custom meta boxes, and the user has to scroll to the top everytime he wants to save the meta info. Is there a way to put submit buttons at every meta box that does that same as the ...
0
votes
0answers
22 views

Add custom field for users

I am using Metabox for a while and is a great plugin but I was using in pages and posts. Now I want to add a simple checkbox to users profile page, is that possible with Metabox plugin? Can any ...
0
votes
1answer
52 views

Filter posts of custom post type by meta key in (List All Section)

How can I filter the posts which are displayed on the admin list all page of a custom post based on the value of the a value. So far I know how to do the following anywhere on the front end: $args = ...
1
vote
1answer
257 views

How to add tab which is visible only in admin side of product in woocommerce? [closed]

I am new in wordpress development. I want to do add settings in a product page in a new tab. How to I add settings code That I tried to add Tab //add product tab link in admin add_action(...
1
vote
1answer
30 views

Undefined 'post_type' error on Add new page

I created a meta box for page see the following code: add_action('add_meta_boxes', 'add_metaboxes'); function add_metaboxes() { add_meta_box( 'wpt_slider_meta', 'Add Slider ...
6
votes
3answers
4k views

Add the sidebar/widget editor to the post edit screen?

There are (among others) two common ways of customizing the sidebar on an individual post: Create a new sidebar for the post, using code or plugins like Custom sidebars, WP Custom Sidebar, Per Page ...
0
votes
1answer
32 views

Error when adding Meta Boxes, but only when adding 3 with the same callback

I have 2 functions, one which removes the original meta boxes for 3 custom taxonomies, and one which recreates them in the desired location. The problem is that with all 3 removed, NONE of the meta ...
12
votes
7answers
5k views

Disable dragging of meta boxes?

Anyone know how to disable this functionality so the meta boxes can't be repositioned?
1
vote
1answer
506 views

How to access global $wp_meta_boxes variable on front-end?

Is there a way to take the global $wp_meta_boxes variable to be used in the front-end? Currently the $wp_meta_boxes is accessible on specific admin pages only. I've found a similar question about ...
1
vote
1answer
56 views

How to select the contents in the text view textrea in wp_editor?

I am trying to count words among other text stats entered into the default post editor (wp_editor). Its supposed the write word count out to <div id="word count"> in the meta box immediately ...
35
votes
2answers
14k views

Create more Meta Boxes as needed

I'd like users to be able to create and remove additional meta box fields as needed. For example, say a music podcast with a variable amount of songs played per episode. The user should be able to ...
0
votes
1answer
23 views

Add URL to selected post in meta box

How can I change this code $posts = get_posts(array('post_type'=> 'lesson', 'post_status'=> 'publish', 'suppress_filters' => false, 'posts_per_page'=>-1)); //here you add the ...
0
votes
0answers
18 views

Wordpress Costums Field Comment Box on Admin Page (Post Editing)

can help me about wordpress comment field on post editing in admin page? i want to change the default form like picture above : to like this...
0
votes
0answers
35 views

Move Meta Boxes for Custom Post Type

I'm trying to move the metaboxes for a custom taxonomy from 'side' to 'normal'. Unfortunately, when I remove_meta_box for the 'side' position, it breaks the 'Add term' functionality and I can't figure ...
0
votes
2answers
67 views

Creating alternate meta box context locations

I am trying to create two additional add_meta_box context locations ('after_title' and 'after_editor') within posts. This doesn't appear to do what I think it should. The meta box does appear on the ...
0
votes
1answer
69 views

Change post template the proper way

I'm trying to create an option on edit posts screen (backend) to select different post template based the selection and I need your opinions guys if that is the proper way. Here is what I've tried so ...
0
votes
1answer
262 views

CMB2 metabox conditional logic

I am using CMB2 for metabox on custom posts. I am adding a metabox by using code below: $cmb_demo->add_field( array( 'name' => __( 'Test Text', 'cmb2' ), 'desc' => __( '...
2
votes
1answer
1k views

Metabox repeating fields - radio buttons not saving correctly

I have multiple radio buttons set up inside of a metabox in a custom post type. I have created the metabox like so: add_action('admin_init', 'add_meta_boxes', 1); function add_meta_boxes() { ...
0
votes
0answers
19 views

How can I create a dual drop down metabox?

I'd like the first dropdown to be for the terms of a taxonomy and the second to be for the posts associated with those terms. So far I have got: /* Hook meta box to just the 'place' post type. */ ...
1
vote
3answers
1k views

Setting multiple image urls using Wordpress' Media Uploader

I have set up a meta box to hold additional information that my client can put in, and it will appear in a different section of the page. The page shows up at http://96.125.170.106/~prestonp/?project=...
0
votes
0answers
29 views

Filter on page with meta box post values

it's possible create an filter using the values of the meta box posts? Example: Name of message: Message one Year of the message: 2016
1
vote
1answer
3k views

How to add a select menu to this metabox code?

I'm using a metabox script that works great for having absolute control over the design and placement of the metabox fields. There is one problem: I can't remember where I found the script and need to ...
2
votes
3answers
218 views

datetime_timestamp shows numbers only? need in date and time

I am using CMB2 and following code to select date & time: $cmb->add_field( array( 'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', 'cmb2' ), 'desc' => __( '...
0
votes
0answers
31 views

How to Display Audio File List Using Custom Post Type

Using this plugin, I've created a meta box for my custom post type to display a list of audio files for download, but the combined code does not output anything. single-promo.php <...
0
votes
0answers
26 views

modify my custom meta_value after change post status from future to publish

I write a custom metabox form my wordpress. This is a check-box to flag some posts and this is work perfectly. To day I've try to schedule my first post and I've flagged this. Well, after publications ...