• Would these 2 fixes make sense to add? Logs seems to hint yes.

    First is “PHP Notice: Undefined index:”

    Around line 124 isset wrapping seems to work:

    if ( isset( $_POST['html_mode_lock'] ) ) {
    	$html_mode_lock = $_POST['html_mode_lock'];
    }

    Below one I could not figure out but someone could, see http://wordpress.stackexchange.com/a/123466 – or that is my translation…

    Without PHP spit out “PHP Notice: Trying to get property of non-object”

    add_filter('user_can_richedit', 'html_mode_lock_on');
    function html_mode_lock_on($wp_rich_edit){
    if (!is_singular()) return; // http://wordpress.stackexchange.com/a/123466
      global $post;
    
      $html_mode_lock = get_post_meta($post->ID,'html_mode_lock',true);
    
      if($html_mode_lock)
        return false;
    
      return $wp_rich_edit;
    }

    http://wordpress.org/plugins/html-mode-locker/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘A couple of PHP 5.4.x notices’ is closed to new replies.