Australia's Leading Digital Marketing Experts. T. 1300 235 433  |  Aggregation Enquires Welcome

Example Interest Rates: Home Loan Variable: 2.54% (2.74%*) • Home Loan Fixed: 3.74% (3.8%*) • Fixed: 2.48% (2.94%*) • Variable: 2.54% (2.74%*) • Investment IO: 2.3% (3.76%*) • Investment PI: 2.04% (3.8%*)

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.

  AUS Eastern Standard Time (Washington)

  Want to have a chat?
 

Like this article?

Share on facebook
Share on Facebook
Share on twitter
Share on Twitter
Share on linkedin
Share on Linkdin
Share on pinterest
Share on Pinterest

Leave a comment