RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.74% (6.40%*) • Investment PI: 5.49% (6.32%*)

Force Rich WordPress Editor in WP Plugins

While building a plugin we wanted to force the rich editor for all users - even those that disabled it in their user options. While we used it in a plugin, it can obviously be used anywhere that the wp_editor is used.

1
<?php 
2
/*
3
 Overwrites user_can_richedit()
4
 @return bool
5
 http://www.beliefmedia.com/code/wp-snippets/force-rich-editor
6
*/
7
 
8
add_filter('user_can_richedit', 'beliefmedia_force_rich_editor', 999999);
9
wp_editor($content, $editor_id);
10
remove_filter('the_content', 'beliefmedia_force_rich_editor');
11
 
12
/*
13
 Overwrites user_can_richedit()
14
 @return bool
15
*/
16
 
17
function beliefmedia_force_rich_editor(){
18
  return true;
19
}

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment