RW Meta Box ,Problem setting post title

Here’s a solution that take’s advantage of Rilwis’ action hook… so you can profit from his nonce checking without needing to add your own. add_action(‘rwmb_after_save_post’, ‘post_updated’); function post_updated($post_id) { // verify post is not a revision & not an autosave if (!wp_is_post_revision($post_id) && !(defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE)) { global $prefix; $prefix . ‘name’; // check that … Read more

List custom post types in metabox

<?php $args = array( ‘public’ => true, ‘_builtin’ => false ); $output=”names”; // names or objects, note names is the default $operator=”and”; // ‘and’ or ‘or’ $post_types = get_post_types( $args, $output, $operator ); foreach ( $post_types as $post_type ) { echo ‘<p>’ . $post_type . ‘</p>’; } ?> It will list of all public custom … Read more

Understanding and using metaboxes in posts

To save: // Update and save the field so it can be used in our template if ( isset( $_POST[‘input_name’] ) ) { $data = sanitize_text_field( $_POST[‘input_name’] ); update_post_meta( $post_id, ‘field_name’, $data ); } To read: $data = get_post_meta( $post_id, ‘field_name’, true ); // With post object, a leaner, cleaner method: $data = $post->field_name; There’s … Read more

advanced search forms with 3 input text and that the main problem 3 input text

As you’ve already get results with tag I’m going to give suggestion only for address and rating. For your current situation, the best option is to use WordPress post meta to store these values. Then you can use meta query to retrieve those posts. $args = array( ‘post_type’ => ‘hotel’, ‘meta_query’ => array( array( ‘key’ … Read more

window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes

I did similar thing recently but used the wp.media instead of ThickBox https://codex.wordpress.org/Javascript_Reference/wp.media with the same code from Codex. The only thing to make it work with multiple inputs is to move the frame variable from global scope to click function, so the ‘frame’ will be fresh for each click.

add wp_editor to custom_meta_box

To use wp_editor() you’ll need to replace your textarea tag with the output from wp_editor() like so: case ‘textarea’: wp_editor($meta, $field[‘id’]); echo ‘<br /><span class=”description”>’.$field[‘desc’].'</span>’; break; You don’t need to echo wp_editor() since it does it automatically. You can pass an array of settings as a 3rd argument to configure it’s behaviour. More info here: … Read more

How to rename “Publish” metabox title in post screen

The best way would be to remove the meta box and then add it back in with your new title: function change_publish_meta_box() { remove_meta_box( ‘submitdiv’, ‘post’, ‘side’ ); add_meta_box( ‘submitdiv’, ‘YOUR TITLE HERE’, ‘post_submit_meta_box’, null, ‘side’, ‘high’ ); } add_action( ‘add_meta_boxes_post’, ‘change_publish_meta_box’ ); (Change YOUR TITLE HERE to whatever you want)

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