Forum Replies Created

Viewing 1 replies (of 1 total)
  • @fballoni

    I got the same error as you

    Fatal error: Call to undefined method stdClass::get_results() in …/wp-content/plugins/custom-taxonomies/custom-taxonomies.php on line 66

    The issue is that the workaround wraps the call to initialize the taxanomies in a function, that is afterwards hooked to load.
    All you need to do is declare the $wpdb var as global at the start of your function:

    62. $custax_taxonomies = array();
    63. function custax_register_on_init() {
    64.   global $wpdb, $custax_taxonomies;
    65.   //build the list of custax objects
    66.   $wpdb->custom_taxonomies = $wpdb->prefix . 'custom_taxonomies';
    67.   $custax_taxes = $wpdb->get_results('SELECT * FROM '.$wpdb->custom_taxonomies);
    68.   if($custax_taxes) {
    69.     foreach($custax_taxes AS $custax_tax) {
    70.       $custax_taxonomies[$custax_tax->slug] = new custax($custax_tax);
    71.     }
    72.   }
    73. }

    You still need to apply the other 2 patches in the global taxonomies and posts php files.

    Too bad WP doesn’t do proper error handling!

Viewing 1 replies (of 1 total)