Custom Fields – Taller editing area

Large »Custom Field« Textareas. Gladly those are easy to target. Wrapped up in a small plugin: <?php ! defined( ‘ABSPATH’ ) AND exit; /* Plugin Name: (#65922) »kaiser« Bigger custom field textarea */ function wpse65922_big_customfield_textarea() { ?> <style type=”text/css”> #the-list textarea, #newmeta textarea { height: 200px; } </style> <?php } add_action( ‘admin_head-post.php’, ‘wpse65922_big_customfield_textarea’ ); add_action( … Read more

How can i change the name order in the admin?

You can’t alter the default Name column, but what you can do is hide it and create your own custom column. First, we add the action and filter on admin_init that will add and manage our new column: function wpa66544_user_custom_column_init(){ add_filter( ‘manage_users_columns’, ‘wpa66544_user_add_column’ ); add_action( ‘manage_users_custom_column’, ‘wpa66544_user_manage_column’, 100, 3 ); } add_action( ‘admin_init’, ‘wpa66544_user_custom_column_init’ ); … Read more

How to read individual user’s directory and display content to that specific user?

First an observation, using $upload_dir.’/USER_PHOTOS’.$user->user_login may lead to a mess of folders in wp-content/. I suggest wp-content/user-photos/user-login/. And the following example considers it this way. In your case, you already have the menu item, for completeness this is the submenu used for development: add_action( ‘admin_menu’, ‘wpse_75873_folder_menu’ ); function wpse_75873_folder_menu() { add_media_page( ‘User Photos Media’, ‘User … Read more

Allow public to post on blog

If you don’t want to give users access to the WordPress admin screens and you don’t want to use a premium plugin, you should create a form in a page and use wp_insert_post with the submitted data. In your case, the “post_status” parameter could be used to “moderate”: $post = array( ‘post_title’ => $_POST[‘title_field’], ‘post_content’ … Read more

Roles for Custom Post Types

I’m sure you could specify some capabilities while registering the Post Type itself. Although, here is a more robust version that can be used widely across the administration dashboard. /** * Hide dashboard administrator menus from disallowed user roles. * * @author Michael Ecklund * @author_url https://www.michaelbrentecklund.com/ * * @return void */ function mbe_hide_menus() { … Read more