" class="post-planner-assignment"> <option value="-1"<?php echo $mb->the_select_state(-1); ?> ><?php esc_attr_e('None', 'post-planner'); ?> </option> <?php if (PostPlanner_Loader::$settings['user_roles'] == '') { $roles = array('contributor', 'author', 'editor', 'administrator'); } else { $roles = explode(',', PostPlanner_Loader::$settings['user_roles']); } foreach ($roles as $role) { $role_users = PostPlanner_Lib::get_users($role); foreach ($role_users as $role_user) { $user_info = get_userdata($role_user->ID); ?> <option value="<?php echo absint($role_user->ID); ?> "<?php echo $mb->the_select_state($role_user->ID); ?> ><?php echo sanitize_text_field($user_info->display_name); ?> </option> <?php }
/** * Set up the Assignment Quick Edit field for Planner listings * @static * @param $column_name * @param $post_type * @return mixed * @since 1.0 */ public static function add_assignment_quick_edit($column_name, $post_type) { if ($column_name != 'assignments' || $post_type != 'planner') { return; } static $printNonce = TRUE; if ($printNonce) { $printNonce = FALSE; wp_nonce_field(plugin_basename(__FILE__), 'planner_edit_nonce'); } ?> <fieldset class="inline-edit-col-left inline-edit-custom"> <div class="inline-edit-col"> <span class="title"><?php echo apply_filters('post_planner_assignments', esc_attr__('Assign To', 'post-planner')); ?> </span> <select name="_pp_assignment" class="assignment" id="_pp_assignment"> <option value="-1"><?php esc_attr_e('None', 'post-planner'); ?> </option> <?php if (PostPlanner_Loader::$settings['user_roles'] == '') { $roles = array('contributor', 'author', 'editor', 'administrator'); } else { $roles = explode(",", PostPlanner_Loader::$settings['user_roles']); } foreach ($roles as $role) { $role_users = PostPlanner_Lib::get_users($role); foreach ($role_users as $role_user) { $user_info = get_userdata($role_user->ID); ?> <option value="<?php echo absint($role_user->ID); ?> "><?php echo sanitize_text_field($user_info->display_name); ?> </option> <?php } } ?> </select> </div> </fieldset> <?php }