• Hey all,

    I’m extending wordpress functionality to enable a “movie review” capability. I have an extension to the tinyMCE editor working properly and decided to add a sidebar widget to display recent reviews (where a review is defined as a post containing a specific tag [customizable by the widget]).

    When the widget is enabled, it displays properly on the site. However, it causes a javascript error stating that “realTinyMCE” in tiny_mce_gzip.php cannot be found.

    The code is virtually identical to the recent_posts widget (albeit, I know there’s an error SOMEWHERE in mine).

    The function to display the recent reviews is as follows:

    [code]
    echo $before_widget;
    echo $before_title . $title . $after_title;
    echo "

      ";
      foreach($posts as $post) {
      setup_postdata($post);
      $posttags = get_the_tags();
      if($posttags) {
      $found = false;
      foreach($posttags as $t) {
      if($t->name == $tag) {
      $found = true;
      break;
      }
      }
      if($found) {
      echo "

    • <a href=\"";
      the_permalink();
      echo "\">";
      the_title();
      echo "
    • ";
      }
      }
      }
      echo "

    ";
    echo $after_widget;
    [/code]

    (if there’s an easier way to do this, I’d love to know!)

    I’ve found that if I comment out the code within the conditional statement against the “$found” variable, it does not cause any errors with the editor. However, when that block is reachable, the javascript error is seen.

    To be more specific:

    Line: 44
    Char: 2

    Error: ‘realTinyMCE’ is undefined
    Code: 0
    URL: http://site/wp-admin/post-new.php

    Any help is greatly appreciated :).

  • The topic ‘Widget output disabling Post Editor’ is closed to new replies.