Menu
  • HOME
  • TAGS

Dropdown of existing posts in a metabox

wordpress,drop-down-menu,custom-fields,meta-boxes

There is a free plugin that will solve all of your woes. It's called ACF or Advanced Custom Fields. It has the ability to add a list of posts to a field and attach that field to pages. Here's how you'd do it: First install the plugin and navigate to...

Multiple check boxes metabox (wordpress)

wordpress,meta-boxes

Well, probem... solved...? I followed this tutorial on how to do multiple check boxes. The thing is, it does work as long as I don't use the words I used previously to indicate the options. I don't know if it's because the table field has already been created or something...

WordPress custom meta box using OOP way doesn't save data

php,wordpress,oop,meta-boxes

It is small logical mistake, you forgot to return true if the user submitted data for storing :) Your function iam_user_can_save code should look like: public function iam_user_can_save( $post_id, $nonce ){ var_dump( $post_id ); // Checks save status $is_autosave = wp_is_post_autosave( $post_id ); $is_revision = wp_is_post_revision( $post_id ); $is_valid_nonce =...

How to create meta box using clone ajax and jquery in wordpress

jquery,ajax,wordpress,post,meta-boxes

Hello Try this code I tried this in mine. Its working It creates Four Meta-boxes in Post(admin panel wordpress) add_action( 'add_meta_boxes', 'dynamic_add_custom_box' ); /* Do something with the data entered */ add_action( 'save_post', 'dynamic_save_postdata' ); /* Adds a box to the main column on the Post and Page edit screens...

How to show conditional custom fields using WordPress CMB2 plugin when a post is added new

php,jquery,wordpress,meta-boxes

First of all I made a function that only works on edit page - that means the show_on_cb (value: 'show_on_cb' => 'myproducts_product_typeA') will work only if the post is edited, because I used the get_current_screen() to dictate that. function myproducts_product_typeA( $field ) { global $post; $screen = get_current_screen(); if( $screen->action...

How do I make multiple image uploads with WordPress metabox?

wordpress,image-upload,meta-boxes

i find that code in site and did some modification on it //***************************** Start banner images metabox in page page *********************** function call_Multi_Image_Uploader() { new Multi_Image_Uploader(); } function get_images($post_id=null) { global $post; if ($post_id == null) { $post_id = $post->ID; } $value = get_post_meta($post_id, 'images', true); $images = unserialize($value); $result...

WordPress Custom Post Type Meta Box tinyMCE

php,wordpress,custom-post-type,meta-boxes

for function "display_missionary_meta_box", argument name should be $post instead of $missionaries in order to user $post->ID in the function // Put Fields In Missionary Meta Box function display_missionary_meta_box( $post ) { $missionary_contact_details = get_post_meta($post->ID, 'missionary_contact_details', true); ?> <table> <tr> <td><?php wp_editor($missionary_contact_details, 'missionary_contact_details', array( 'wpautop' => true, 'media_buttons' => false, 'textarea_name'...

how to do jquery function if wordpress metabox checkbox is checked Sync in add new post area

jquery,wordpress,checkbox,meta-boxes

You can achieve that using jQuery. !(function($){ $(document).ready(function(){ $('#categorychecklist').on('change', 'input[type=checkbox]', function(){ if ($(this).is(':checked')) alert('Category' + $(this).closest('label').text() + ' added.'); else alert('Category' + $(this).closest('label').text() + ' removed.'); }); }); })(window.jQuery); /wp-content/themes/themename/js/post-jquery.js I have this to say which category is added or removed after they are being ticked or unticked (change event)....