Support » Plugins » Broken Plugin in 2.8 Release, How to fix?

  • Resolved Alexandre



    I’m looking to fix a plugin I was using on 2.7 that is now broken on 2.8. I’m guessing the developer stopped the support since his website is now down.

    The plugin adds slugs to the db and when visiting one of these slugs url (ex: you should be redirected to the saved URL in the db.

    Adding slugs to the db with the plugin works, I checked that. The probably lies within the building of the slugs list or using this list.

    Anything changed in that scope under WP 2.8 that can break that plugin? I’m not very hot with PHP so any help on what to look for would be appreciated!


Viewing 2 replies - 1 through 2 (of 2 total)
  • Here’s a bit of code to be sure I’m not doing anything wrong…

    function wp_myplug_rewrite_rules($rules)
      WPD_print("in wp_myplug_rewrite_rules");
      global $wp_rewrite,$wpdb,$wp_myplug_prefix;
      $table_name = $wpdb->prefix . $wp_myplug_prefix."_links";
      $results  = $wpdb->get_results("SELECT * FROM ".$table_name,OBJECT);
        foreach($results as $result) {
          WPD_print("  --> " . get_category_slug($result->category) . " => " . $result->slug);
          $the_slug = substr(get_category_slug($result->category)."/".$result->slug,1);
      WPD_print("out wp_myplug_rewrite_rules");
      return $new_rules;
    function wp_myplug_init()
      global $wp_rewrite;
      if (isset($wp_rewrite) && $wp_rewrite->using_permalinks()) {
      WPD_print(" in if");
      add_filter('rewrite_rules_array', 'wp_myplug_rewrite_rules');
      WPD_print(" after if");

    The WPD_print function simply logs a debug statement in my footer.
    I can see that it does go in the IF statement with two add_filters and add_action, but the code in the rewrite_rules_array never gets executed…

    What am I doing wrong here?

    Just found the solution!

    You have to re-save the permalink structure so that WP refreshes its cached list of permalinks.

    Just to to Settings > Permalinks and hit Save.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Broken Plugin in 2.8 Release, How to fix?’ is closed to new replies.