WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] Remove editor only for author role (3 posts)

  1. David Klhufek
    Member
    Posted 1 year ago #

    Hi there, i set up advanced custom field editor for my custom type posts.. now i'm develeoping how to hide native editor for the only author role..

    This code works, but for every role..((

    // Remove editor
    function remove_editor() {
      remove_post_type_support('post','editor');
    }
    add_action('admin_init','remove_editor');

    anyone know how to trim only for authors?

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. David Klhufek
    Member
    Posted 1 year ago #

    Found it, this code works fine..

    // Remove editor only if author
    function remove_editor() {
    if( current_user_can( 'author' ) ){
    remove_post_type_support('post','editor');
    } // only if author
    }
    add_action('admin_init','remove_editor');
  3. David Klhufek
    Member
    Posted 1 year ago #

    :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic