Add metabox with media uploader in a custom post type [duplicate]

I am working on something similar. This is for a podcast upload meta-box. Returns the url to the file. Here is what I have so far: //Add Metabox add_action(‘add_meta_boxes’, ‘add_upload_file_metaboxes’); function add_upload_file_metaboxes() { add_meta_box(‘swp_file_upload’, ‘File Upload’, ‘swp_file_upload’, ‘podcasts’, ‘normal’, ‘default’); } function swp_file_upload() { global $post; // Noncename needed to verify where the data originated … Read more

How to pass variable via $callback_args for add_meta_box

Sometimes an example says more than a thousand words. Here’s a small plugin that will guide you: <?php ! defined( ‘ABSPATH’ ) AND exit; /** * Plugin Name: (#65981) »kaiser« Meta Box example * Plugin URI: http://goo.gl/ls6Q6 * Description: Example showing how to add a meta box with callback args * Author: Franz Josef Kaiser … Read more

Admin Panel – Disable Moving Selected Terms To Top of Metabox

Try adding this in your functions.php file: // Let’s stop WordPress re-ordering my categories/taxonomies when I select them function stop_reordering_my_categories($args) { $args[‘checked_ontop’] = false; return $args; } // Let’s initiate it by hooking into the Terms Checklist arguments with our function above add_filter(‘wp_terms_checklist_args’,’stop_reordering_my_categories’);

How to Move the Author Metabox into the “Publish” metabox?

I somewhat suck with admin stuff so test this carefully. I had some issues with users not coming up in dropdown, but it fails with default meta box as well – probably because of my messed up test stack. add_action( ‘admin_menu’, ‘remove_author_box’ ); add_action( ‘post_submitbox_misc_actions’, ‘author_in_publish’ ); function remove_author_box() { remove_meta_box( ‘authordiv’, ‘post’, ‘normal’ ); … Read more

Custom post type metabox array

Your code make no sense, anyway here is a nice way to do it and you get: function Print_price_fileds($cnt, $p = null) { if ($p === null){ $a = $b = $c=””; }else{ $a = $p[‘n’]; $b = $p[‘d’]; $c = $p[‘p’]; } return <<<HTML <li> <label>Nr :</label> <input type=”text” name=”price_data[$cnt][n]” size=”10″ value=”$a”/> <label>Description :</label> … Read more

Adding submit or update button to custom metabox?

Don’t know if i agree with EarnestoDev answer which is more of an opinion then an answer based on facts and not true in all cases, since you can use jQuery to trigger the submit event when a different element is clicked, so just add this js code once <script> jQuery(‘.metabox_submit’).click(function(e) { e.preventDefault(); jQuery(‘#publish’).click(); }); … Read more

How do I create a meta box for dates?

If you’re in need of Meta Boxes for WordPress, check out the amazing code in github by jaredatch. https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress This allows you to add all sorts of metaboxes to your WP theme (or plugin). Date Picker, file upload, wysiwyg, text areas, text boxes…it’s really amazing and saves lots of time.

Tinymce/WordPress is removing all line-breaks?

You may need to use one of the following configuration parameters: // Don’t remove line breaks ‘remove_linebreaks’ => false; // Convert newline characters to BR tags ‘convert_newlines_to_brs’ => true; WordPress passes an $init argument array to TinyMCE that sets the opposite value for each of these parameters. I assume you can pass them directly in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)