A plugin inserts users into a database. If the user is an author, the visual editor isn't showing until the user saves their profile. I'm trying to figure out what setting isn't being added to the database and found the deprecated rich_edit_exists().

Is there a replacement?


This is stored in the user meta table under the rich_editing meta key for each user.

You could one of these (untested):

1) Add it for your specific users, e.g. via

`add_user_meta( $user_id, 'rich_editing', 'true', true );`

2) Within the wp_default_editor() function, that determines the default editor, the user_can_richedit() function is applied.

It checks for get_user_option( 'rich_editing' ) === 'true', among other things.

It's filterable through the user_can_richedit filter:

     * Filters whether the user can access the rich (Visual) editor.
     * @since 2.1.0
     * @param bool $wp_rich_edit Whether the user can access to the rich (Visual) editor.
    return apply_filters( 'user_can_richedit', $wp_rich_edit );

3) Try to filter the get_user_option( 'rich_editing' ); if it's missing.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.