• I’m testing this code change, what do you think?
    ceceppaml.php Version: 1.3.46 Line 999:

    function enqueue_script_search() {
      wp_enqueue_script('ceceppa-search', WP_PLUGIN_URL . '/ceceppa-multilingua/js/ceceppa.search.js', array('jquery'));
    }

    change to:

    function enqueue_script_search() {
      wp_enqueue_script('ceceppa-search', WP_PLUGIN_URL . '/ceceppa-multilingua/js/ceceppa.search.js', array('jquery'));
      $array = array('lang' => $this->_current_lang, 'form_class' => $this->_filter_form_class);
      wp_localize_script('ceceppa-search', 'cml_object', $array);
    }

    ceceppaml.php Version: 1.3.46 Line 2090:

    if( $this->_filter_search ) {
      //For Fix Notice
      //add_action('wp_enqueue_scripts', array(&$this, 'enqueue_script_search')); //Non funziona :(
      $this->enqueue_script_search();
    
      $array = array('lang' => $this->_current_lang, 'form_class' => $this->_filter_form_class);
      wp_localize_script('ceceppa-search', 'cml_object', $array);
    }

    change to:

    if( $this->_filter_search ) {
      add_action('wp_enqueue_scripts', array(&$this, 'enqueue_script_search'));
      add_action('admin_enqueue_scripts', array(&$this, 'enqueue_script_search'));
    }

    or even better:

    static $script_search_enqueued = 0;
    if( $this->_filter_search ) {
      if (! ($script_search_enqueued++)) {
        add_action('wp_enqueue_scripts', array(&$this, 'enqueue_script_search'));
        add_action('admin_enqueue_scripts', array(&$this, 'enqueue_script_search'));
      }
    }

    http://wordpress.org/plugins/ceceppa-multilingua/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kitchin

    (@kitchin)

    Well, my first problem with the change: Use Pre-Path Mode was not working.
    So I removed my change and turned off WP_DEBUG.
    The I clicked “Save changes” on wp-admin/admin.php?page=ceceppaml-options-page
    That fixed it.
    Then I restored my changes and turned on WP_DEBUG, and it was still fixed!

    Plugin Author Alessandro Senese

    (@ceceppa)

    Hi, I think that is better 🙂
    I moved that lines inside the function enqueue_script_search() 🙂

    Thanks for suggestion 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Possible fix for the WP_DEBUG "doing it wrong" warning’ is closed to new replies.