Support

Account

Home Forums Backend Issues (wp-admin) Hide On Screen when page is User Edit

Solved

Hide On Screen when page is User Edit

  • An ACF field group has a “Hide On Screen” group to toggle up to 15 page components on or off. But none of them are present on a User Edit backend page; they are all the options visible on a content page.

    My current ACF field group will only appear on User edit backend pages.

    Can we get the ability to toggle off fields like Visual Editor, Admin coLOUR scheme, Keyboard Shortcuts, Toolbar, Language etc?

    At least it would seem prudent to hide the other options when they are not even present on the page where a field group will go.

    Thanks.

  • I think the reason you can’t adjust the user edit page like you can the others in ACF is because that page is pretty much completely hard coded in, meaning there’s not really a way for ACF to tell it not to output those fields.

    That said, you can use a plugin/snippet like the one below to hide them yourself.

    
    <?php
    /**
     * Plugin Name: ACF User Edit Page Adjustments
     */
    
    /**
     * Remove the admin colour scheme picker
     */
    remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    
    /**
     * Add CSS to the admin pages to adjust user-edit.php form
     */
    add_action( 'admin_head', 'remove_edit_profile_fields_css' );
    function remove_edit_profile_fields_css() {
    	echo '<style>
    	/** 
    	 * Remove Visual Editor Option
    	 */
        #profile-page .user-rich-editing-wrap {
        	display: none;
        }
        
        /** 
         * Remove Keyboard Shortcuts Option 
         */
        #profile-page .user-comment-shortcuts-wrap {
        	display: none;
        }
        
        /**
         * Remove Toolbar Option
         */
        #profile-page .user-admin-bar-front-wrap {
        	display: none;
        }
      	</style>';
    }
    
  • Switching off the rest with CSS? That’s so sneaky 🙂

    Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Hide On Screen when page is User Edit’ is closed to new replies.