Creating a WP Test site without /uploads etc

Create a hard or symbolic link. However, you would of course need to take care that testing doesn’t affect the contents of wp-content. Another approach would be to put wp-content (or a copy) into its own file system partition (or just make a .img file from it). Then dd (or its Windows analog) should duplicate … Read more

How to make image uploads default to full size?

It doesn’t look like that filter exists in WordPress core. That being said, I have the solution for you. That select uses an option to set the default size: get_option( ‘image_default_size’, ‘medium’ ); So all you have to do is update that option: update_option( ‘image_default_size’, ‘full’ ); For reference: media.php line 1296

Redirect user role to a specific page on login in a multisite network?

Here’s the solution if anyone’s interested: add_filter(‘login_redirect’, function( $url, $query, $user ) { $user_info = get_userdata($user->ID); return get_blogaddress_by_id($user_info->primary_blog) . ‘wp-admin/?login=1’; }, 10, 3); add_action(‘current_screen’, function ( $user ) { $userID = get_current_user_id(); $user_info = get_userdata($userID); if ($_GET[‘login’] == 1 && $user_info->primary_blog) { $primary_url = get_blogaddress_by_id($user_info->primary_blog) . ‘wp-admin/edit.php?post_type=visitor’; $site_id = $user_info->primary_blog; if (!current_user_can_for_blog($site_id, ‘create_users’)) { wp_redirect( … Read more