Support » Plugin: Comment Extra Fields » [Plugin: Comment Extra Fields] Breaks admin area

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    the same here with wp 3.3


    I have not tested the plugin in WP 3.3, just on 3.2.1, but I found a bug that may affect you.

    The problem: some javascript is output out of context, so we can find it above the RSS feed or the theme HTML output breaking them -they don’t validate-, for example.

    The solution: put the javascript in context. How?

    1. Look into the plugins folder and open there the comment-extra-fields.php
    2. Between the lines 58 and 64 you will find the next code:
      if(!isset($_POST['action'])) :
      <script type="text/javascript">
          var plugin_url = "<?php echo CEF_FULL_PLUGIN_PATH;?>";
      <?php endif;

      You should replace that with this:

      if(!isset($_POST['action'])) :
          	wp_enqueue_script('comment-extra-fields-js-php-scripts', CEF_FULL_PLUGIN_PATH . 'js/scripts.php?cef_full_plugin_path='.urlencode(CEF_FULL_PLUGIN_PATH));

    3. Now, create a file in the “js” folder that is in the plugins one. This file should be named “scripts.php” and contain this code:
      $cef_full_plugin_path = urldecode($_GET['cef_full_plugin_path']);
      var plugin_url = "<?php echo $cef_full_plugin_path;?>";

    All done! It seems that everything is working fine now 🙂

    Plugin Author SimonaIlie


    thank you for your feedback
    released a new version (1.5) in which I removed the tooltips javascript (now, when you click the information icon the text is displayed above the add/edit form), implemented the suggested solution for js variable and added a new field (Where) to show fields on defined custom post types.

    I’d just like to say that I contacted this developer today and the support I received has been AWESOME, thanks for this great plugin AND the support Simonallie!

    Plugin Author SimonaIlie


    You welcome 🙂

    Working with a client today, I found a javascript bug in scripts.js that kept another plugin from working in the backend.

    It was reporting:
    Uncaught TypeError: Property ‘$’ of object [object Window] is not a function
    The issue is with:
    var $ = jQuery.noConflict();

    a better way to do this (and fixes the issue)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Comment Extra Fields] Breaks admin area’ is closed to new replies.