slug = 'ultimatemember'; add_action( 'load-post.php', array(&$this, 'add_metabox'), 9 ); add_action( 'load-post-new.php', array(&$this, 'add_metabox'), 9 ); } /*** *** @add a helper tooltip ***/ function tooltip( $text, $e = false ){ ?> core_post_type( $post_type ) ) return; add_meta_box('um-admin-access-control', __('Access Control'), array(&$this, 'load_metabox_form'), $post_type, 'side', 'default'); } } /*** *** @save form metabox ***/ function save_metabox_form( $post_id, $post ) { global $wpdb; // validate nonce if ( !isset( $_POST['um_admin_save_metabox_access_nonce'] ) || !wp_verify_nonce( $_POST['um_admin_save_metabox_access_nonce'], basename( __FILE__ ) ) ) return $post_id; // validate user $post_type = get_post_type_object( $post->post_type ); if ( !current_user_can( $post_type->cap->edit_post, $post_id ) ) return $post_id; // save foreach( $_POST as $k => $v ) { if (strstr($k, '_um_')){ update_post_meta( $post_id, $k, $v); } } } }