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

learn more… | top users | synonyms (2)

1
vote
1answer
325 views

Populate Custom Fields in a Custom Post Type?

I want to set up a basic 'post rating' system for my site - I don't want to use a plugin - so I want to add the custom field 'rating' to each new custom post and populate this field with the number 1. ...
0
votes
1answer
570 views

add a “list” into add meta box : problem

i found a code searching through stackexchange --> to create a "list" inside a meta box of a custom type, BUT, i don't see anything appearing in this meta box, except the input field (which comes from ...
0
votes
1answer
323 views

Custom field values get deleted

I created a custom post type:products which also has custom fields: price & shipping. Occasionally, if I leave the edit product window open or refresh it, I lose the values inside price and ...
1
vote
1answer
190 views

Multiple Meta Boxes in separate files

So here's the problem, I want to have a few different meta boxes on my sites, but I'd like to be able to store each of them in separate files and included them into functions, so I can just copy ...
0
votes
2answers
139 views

ShortCut on meta boxes

There any way to run a shortcut that is in a meta box? I'm trying to execute the shortcut but does nothing, is that if the code comes from the wordpress editor does not have any problem
12
votes
6answers
9k 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 ...
2
votes
1answer
2k views

Best way to arrange custom post types by Attributes -> Order metabox value?

I have my front page setup to display a custom post type via: add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) { if ( is_home() && false == ...
3
votes
2answers
648 views

Why can't I hook into save_posts after admin_init?

I'm trying to hook into the "save_post" action from an AJAX callback in my plugin, but it doesn't seem to work. In fact, hooking into "save_posts" only seems to work from a few key action execution ...
0
votes
1answer
515 views

Wordpress 3.1.2 Bug: add_theme_support() and video post format registering twice

Ive been experiencing a problem with the new WordPress 3.1.2 update. When i use add_theme_support(); and register an array of post formats, it registers all of them fine, but when it comes to the ...
7
votes
3answers
4k views

Sample code for validating custom metabox?

I've found very little on this site or in Google searches for examples of validating metabox custom fields. If anyone wants to give examples, here are some cases that would be useful 1) Date entered ...
0
votes
1answer
539 views

Add a menu metabox to post edit page

I have a basic understanding of how to create meta boxes, and I have an understanding of how and where to put wordpress menus on the front end. I am a wordpress theme developer but NOT a wordpress ...
1
vote
1answer
73 views

Where did the Add New Custom Field go?

In the latest version of WP it's gone. Why?
4
votes
1answer
607 views

Display content from custom meta boxes in revisions

When I see a "revision" for a given post type, I only see the title, the content and the excerpt. How can I see the content of a custom meta box (or any other field, for that matter)?
0
votes
2answers
591 views

How to recover the post ID earlier in the WP admin hook action “firing” sequence?

I am creating a WP plugin based around Custom Post Types (CPT), where you can dynamically specify a CPT, complete with any number of associated dynamic Meta Boxes and form elements such as radio ...
3
votes
1answer
2k views

upload image in a meta box

im trying to implement uploading via a meta box without using the media manager, but i want it to add as a post attachment. im currently doing it just uploading and saving to the server. <?php ...
1
vote
1answer
187 views

Dashboard - get status and position of metaboxes and pass them to ajax method

I'm wondering if it's possible to get status and position of metaboxes added to a dashboard-like page. The main page of my plugin has several metaboxes laying in a two-columns page and a "table of ...
0
votes
1answer
359 views

Add box with custom per-page properties

Hey, I'm stuck trying to add a box with settings for all pages (the ones users create/edit). What I'm attempting to do is add 6, 7 check boxes and an input field for all pages that alters the ...
1
vote
1answer
907 views

post-excerpt not one of the options under screen options

I want to turn the post-excerpt function on but it doesn't even show as an option under 'screen options' for posts. How do I get it to display as a check box under screen options? I have tried ...
0
votes
1answer
185 views

conditionally echo <br /> in meta box data loop

I am working on a Thematic child theme and using the WPAlchemy Meta Box Class to create an 'Artwork Info' meta box that I want to conditionally echo like this at the end of each post: Title Medium ...
1
vote
3answers
2k views

Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types

Post save functions are conflicting with each other when adding them to the save_post action hook. 2 different custom post types with 2 different (one for each post type) custom meta boxes. I'm ...
7
votes
4answers
8k views

How to set default screen options?

I'd love to be able to hide meta boxes using screen options, instead of removing them or restricting them to user roles, the goal is to just "uncheck" the meta box for the user. I see how this would ...
9
votes
3answers
5k views

Passing error/warning messages from a meta box to “admin_notices”

I have a simple meta box that updates the post custom fields (using update_post_meta()). How can I send a error or warning message to the next page after the user publishes/updates the post and ...
0
votes
1answer
91 views

Prevent custom post type from showing up in custom menus

How do I do that? Any custom post type I register shows up as a meta box on the menu page...
3
votes
2answers
2k views

Add filter 'wpautop' to meta box textarea

I'm using -this tutorial- to add simple meta boxes to a custom post type. But the textarea meta boxes are spitting out content all as one big paragraph, with no <p> formatting applied. What ...
0
votes
3answers
1k views

Wordpress global variables?

I've got page with metabox called "something". It can have two values "value" and "value2". I'm using a shortcode at this page and want it to display something's value. The problem is I don't know ...
5
votes
1answer
2k views

Action hook on Edit custom post type?

Is there an explicit action hook that will fire when (or just before) the admin Edit page renders for a custom post type? Something similar to {$new_status}_{$post->post_type}? I'm trying to find the ...
0
votes
1answer
943 views

meta box & callback function

Situation I got a class where i add a meta box to the post edit screen. EDIT: This is the working version now /** * Calls the class on the post edit screen */ function call_someClass() { ...
7
votes
2answers
2k views

post formats - how to switch meta boxes when changing format?

Problem After realizing that post formats are pretty popular, but only a extremly rough drawn concept, i see that users will run into possible traps. Post format ... uses post meta fields & ...
2
votes
6answers
3k views

Dynamically Creating Meta Boxes

So I was wondering if it's possible to dynamically create meta boxes in the post admin. I have a lot of data but don't want to hardcode every meta box needed in functions.php. An example would be a ...
3
votes
4answers
4k views

custom fields for attachments?

is it possible to add extra fields via the functions.php script for attachments in wordpress? Tried loads of examples but none seem to work. Worried an existing plugin might be affecting my attempts ...
0
votes
1answer
646 views

How to add a textarea to only one of the fields of this custom metabox?

This is the code I used to create the meta boxes: <?php $key = "project"; $meta_boxes = array( "project_services" => array( "name" => "project_services", "title" => ...
1
vote
2answers
5k views

Custom Post Type Metabox - Not Saving

I've added a custom post type, which is working great; I've also added two metaboxes, which appear to work well, but the content in them always disappears after a few minutes. If anyone could help ...
1
vote
2answers
713 views

Metabox saves on Update or Publish, but not on Saving Draft

I have created custom post types that also have custom meta_boxes I've created. Currently, they save when I publish or update a post, but they don't save when I'm in draft mode making changes. ...
1
vote
1answer
1k views

Why is save_post hook not running?

I am trying to save my meta box, I have something like function xxx_meta_box_callback() { add_meta_box('xxx-meta', 'xxx Details', 'xxx_meta_box', 'xxx-post-type', 'side', 'default'); ...
0
votes
1answer
440 views

Custom sidebars - get_sidebar() problems

I want to have different sidebars on different pages. So firstly I registered a few basic sidebars in functions.php. So they will be always there no matter where I move my theme. Let's name them ...
2
votes
3answers
430 views

validate a metabox based on the category that is selected

Ok Let's say I have 2 Categories. If a user select category A, they have to fill in metabox A and similarly for category B, it's metabox B. So my question is, I want to do a validate check, whereby if ...
0
votes
1answer
1k views

Metadata in loops

I have a standard Wordpress loop displaying items: $loop = new WP_Query( array( 'post_type' => 'images', 'orderby' => 'menu_order', ) ); while ...
1
vote
1answer
774 views

Automatically exclude categories from metabox based on title

I am designing a website which will be used as a school PA system. Users will be posting entries into categories named for specific dates that correspond to school assemblies. We have two assemblies a ...
0
votes
1answer
5k views

Getting metabox value?

I have a custom metabox made using the code from Wordpress Reference: http://codex.wordpress.org/Function_Reference/add_meta_box <?php /* Define the custom box */ // WP 3.0+ // ...
0
votes
2answers
458 views

Moving/dragging a metabox removes TinyMCE's content

I added a TinyMCE editor to my plugin settings page, but once I move (drag) the metabox, editor's content get lost. (the TinyMCE editor is completely not editable until refresh) Here is how I added ...
3
votes
2answers
3k views

Dashboard like meta boxes in my plugin - how to save their position and open/closed state?

I am trying to mimic the dashboard meta boxes UI in my WP plugin - the small metaboxes. I have already styled them and also the drag & drop feature works as I loaded the following script and ...
5
votes
1answer
2k views

Put the media uploader in a metabox

I find it very unnecessary to have an "add image" button that brings me to yet another screen that will let me upload content to my post. Ideally I would like to have a meta box with the option to ...
1
vote
1answer
1k views

How to add a “custom” date field to a custom post type?

Hey guys, I'm building a portfolio (which is a custom post type) and I want to store the date of the projects. I can achieve it the "regular" way with a meta box but I would like a "datepicker" or ...
0
votes
1answer
193 views

Move title “meta box” in post mode

I've created a custom post type with my own custom meta boxes. Now I want to move the title box to the side or simply remove it and place the same content in a custom meta box. How do I go about to ...
3
votes
3answers
264 views

How can I avoid re-inventing the Custom Fields wheel in my Plugin's Metabox?

Here's the scenario: In my plugin, I want to have a metabox show up on the post / page editor. I want the metabox to be -exactly- like WordPress' 'Custom Fields' metabox, ( Add another, delete, ...
1
vote
2answers
3k views

How to store multiple input values with same meta_key

is there a way to store the input value from multiple custom meta box fields with the same meta_key? I use the following code to store ONE value for the meta_key 'startdate': function startdate() { ...
1
vote
1answer
374 views

Change meta box when the page's template is changed

For my WordPress theme I have a custom portfolio post type and a portfolio page template to display them. What I want to do is add a meta box to the edit page area, but only when the page has the ...
0
votes
1answer
421 views

Post edit screen: How to check if meta_box is registered?

I got some custom post types where i deregistered the "title" meta box. Now i always get "Auto Draft" as title. To avoid this i'd like to add the name of a taxonomy as the title. But how would i check ...
2
votes
2answers
1k views

WP 3.0.5: Best way to add custom metaboxes for post categories?

I haven't been working with WP for a while and noticed that there are some new features in WP 3+ such as creating meta data for taxonomies. I'd like to be able to add unique meta data setups for ...
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 ...