Modules with meta box implementations

I recently published a meta box class named My Meta Box which takes care of most of the metabox creation and data saving and that was forked out of from Meta Box script by Rilwis. Using the class is simple eg: <?php require_once(“meta-box-class/my-meta-box-class.php”); if (is_admin()){ /* * prefix of meta keys, optional * use underscore … Read more

lock meta box position on post edit screen for contributors

Found this while trolling the internets… Works Perfectly add_action(‘admin_init’, ‘set_user_metaboxes’); //I want it to fire every time edit post screen comes up //add_action(‘user_register’, ‘set_user_metaboxes’); //You can also have it only set when a new user is created function set_user_metaboxes($user_id=NULL) { //These are the metakeys we will need to update $meta_key[‘order’] = ‘meta-box-order_events’; $meta_key[‘hidden’] = ‘metaboxhidden_events’; … Read more

Trying to limit access to custom meta box without success

As @totels says, just apply the condition when you add the box, rather than trying to remove it later (FYI, it’s not working because you call the removal on hooks that fire earlier!) add_action( ‘add_meta_boxes’, ‘assistant_editor_box’ ); function assistant_editor_box() { if ( current_user_can( ‘edit_others_posts’ ) ) add_meta_box( ‘assistant_editor_box’, … ) }

Get all meta boxes values

I tried to use WP_Query and it works fine. <?php $args = array(‘post_type’ => ‘institution’); $the_query = new WP_Query($args); while ( $the_query->have_posts() ) : $the_query->next_post(); $id= $the_query->post->ID; $location = get_post_meta($id, ‘institution_location’, true); echo $location; endwhile; ?>

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