Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50275 closed defect (bug) (worksforme)

Visual and text editor issue. Not switchable on current post editor

Reported by: ysgmesh's profile ysgmesh Owned by: ysgmesh's profile ysgmesh
Milestone: Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords:
Focuses: Cc:

Description

I posted this before but is like that was in the wrong place.
I have been trying to fix this issue and now I think its this like of code that is causing it.

I am looking for a way to change below line of code to supported one...as my sites says it is depreciated.

add_filter( 'wp_default_editor', create_function(, 'return "tinymce";') );

My https://daily4mative.com I need help with

The whole issue started when Ii migrated from sharehosting to Linode server...My visual editor and text editor cannot be switched from one to the other.
Please help me out of this.

Change History (3)

#1 in reply to: ↑ description @ysgmesh
4 years ago

Replying to ysgmesh:

I posted this before but is like that was in the wrong place.
I have been trying to fix this issue and now I think its this like of code that is causing it.

I am looking for a way to change below line of code to supported one...as my sites says it is depreciated.

add_filter( 'wp_default_editor', create_function(, 'return "tinymce";') );

My https://daily4mative.com I need help with

The whole issue started when Ii migrated from sharehosting to Linode server...My visual editor and text editor cannot be switched from one to the other.
Please help me out of this.

I found the way to solve depreciated function by changing this

add_filter('wp_default_editor', create_function('', 'return "tinymce";'));

to

add_filter('wp_default_editor', function() { return 'tinymce'; } );

But the issue remains as I cannot toggle between visual and text editor.
Please I really need help.

#2 @ysgmesh
4 years ago

Hello friends! I have found a workaround or possibly the solution if you dont want to go deep into codes.

This is the fix:

  1. Install Visual Composer(Wpbackery or others)
  2. Go to => Role manager => Post type => custom => Select both for post and page.

Thats all.

Thanks. I have found a workaround that is very good and can work in other case.

#3 @azaozz
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from assigned to closed

Hi, thanks for the ticket.

But the issue remains as I cannot toggle between visual and text editor.

Assuming you're talking about the classic editor, the ability to switch from Visual to Text and back doesn't depend on the wp_default_editor filter. It is either restricted by a plugin or there is a js error on the page (just confirmed it is working properly).

In both cases it would be best to search through the support forums for similar problems and eventual solutions.

Closing as worksforme since this doesn't seem to be a bug in core.

Note: See TracTickets for help on using tickets.