Example #1
0
 /**
  * Return an instance of this class.
  *
  * @since	 1.0.0
  *
  * @return	object	A single instance of this class.
  */
 public static function get_instance()
 {
     global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE, $is_edge;
     if (!isset($wp_rich_edit)) {
         $wp_rich_edit = false;
         if ('true' == @get_user_option('rich_editing') || !@is_user_logged_in()) {
             // default to 'true' for logged out users
             if ($is_safari) {
                 $wp_rich_edit = !wp_is_mobile() || preg_match('!AppleWebKit/(\\d+)!', $_SERVER['HTTP_USER_AGENT'], $match) && intval($match[1]) >= 534;
             } elseif ($is_gecko || $is_chrome || $is_IE || $is_edge || $is_opera && !wp_is_mobile()) {
                 $wp_rich_edit = true;
             }
         }
     }
     if ($wp_rich_edit) {
         // If the single instance hasn't been set, set it now.
         if (null == self::$instance) {
             self::$instance = new self();
         }
     } else {
         add_action('edit_form_after_title', 'add_notice_of_disabled_rich_editor');
     }
     return self::$instance;
 }
Example #2
0
 /**
  * Return an instance of this class.
  *
  * @since	 1.0.0
  *
  * @return	object	A single instance of this class.
  */
 public static function get_instance()
 {
     if (@user_can_richedit()) {
         // If the single instance hasn't been set, set it now.
         if (null == self::$instance) {
             self::$instance = new self();
         }
     } else {
         add_action('edit_form_after_title', 'add_notice_of_disabled_rich_editor');
     }
     return self::$instance;
 }
Example #3
0
 /**
  * Return an instance of this class.
  *
  * @since	 1.0.0
  *
  * @return	object	A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }