Title: Init error : cannot get Taxonomy
Last modified: July 31, 2021

---

# Init error : cannot get Taxonomy

 *  Resolved [tsimmo](https://wordpress.org/support/users/tsimmo/)
 * (@tsimmo)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/init-error-cannot-get-taxonomy/)
 * Hi support team,
 * After the nth update (4.2.11), the loading of my plugin came back to life.
 * However, I am not able to load the part that deals with Taxonomies.
    The fatal
   error below is raised by a function that loads: `return array_merge ($types, 
   TsImmoCore::getTermList('property_type'));` which get the terms of a given taxonomy
   as an array
 * Indeed : the taxonomy is created during init… however, if I register the init
   hook, I do not get anything (unable to bind the menu that opens the config : 
   I get a 403)… then I used plugins_loaded instead and here is the error !
    I tried
   to load the settings of that specific par in the init hook (priority 9999), but
   the related part is not loaded
 *     ```
       Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, 
       WP_Error given in /mypath/www/wp-content/plugins/ts-immo-divi-light/ts-immo-divi-light.php:76 Stack trace: #0
       www/wp-content/plugins/ts-immo-divi-light/ts-immo-divi-light.php(76): array_merge() #1 /mypath/www/wp-includes/class-wp-hook.php(303): tsimmo_divi_settings_property_offers() #2 /mypath/www/wp-includes/plugin.php(189): WP_Hook->apply_filters() #3 /mypath/www/wp-content/plugins/ts-immo/core/theme/settings/ts-immo-settings-property_offer.php(6): apply_filters() #4 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-wordpress-data.php(477): ts_immo_settings_import_property_offers() #5 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-wordpress-data.php(119): Redux_WordPress_Data->get_data() #6 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-options-defaults.php(122): Redux_WordPress_Data->get() #7 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-options-defaults.php(74): Redux_Options_Defaults->field_default_values() #8 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-api.php(329): Redux_Options_Defaults->default_values() #9 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-api.php(376): Redux::set_defaults() #10 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-api.php(303): Redux::load_redux() #11 /mypath/www/wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-api.php(409): Redux::loadRedux() #12 /mypath/www/wp-includes/class-wp-hook.php(303): Redux::create_redux() #13 /mypath/www/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #14 /mypath/www/wp-includes/plugin.php(470): WP_Hook->do_action() #15 /mypath/www/wp-settings.php(556): do_action() #16 /mypath/www/wp-config.php(100): require_once('...') #17 /mypath/www/wp-load.php(50): require_once('...') #18 /mypath/www/wp-admin/admin.php(34): require_once('...') #19 /mypath/www/wp-admin/options-general.php(10): require_once('...') #20 {main} thrown in /mypath/www/wp-content/plugins/ts-immo-divi-light/ts-immo-divi-light.php on line 76
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [tsimmo](https://wordpress.org/support/users/tsimmo/)
 * (@tsimmo)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/init-error-cannot-get-taxonomy/#post-14721747)
 * Is there a way to use setSection on a given config “main section” after Redux
   to be loaded (during at priority 9999 for instance) ??
 *  Thread Starter [tsimmo](https://wordpress.org/support/users/tsimmo/)
 * (@tsimmo)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/init-error-cannot-get-taxonomy/#post-14721759)
 * Here is the way I load that part of the config :
 *     ```
        $fields = array();
           foreach (TsImmoPropertyType::getMapping() as $k => $v) {
               $fields[] = array(
                   'id' => 'propertyType_' . $k,
                   'type' => 'select',
                   'title' => $v,
                   'data' => 'callback',
                   'args' => 'ts_immo_settings_import_property_types'
               );
           }
   
           $newsection = array(
               'title' => esc_html__('Types de propriétés', 'ts-immo'),
               'id' => 'importPropertyTypes',
               'subsection' => true,
               'desc' => esc_html__('Gestion des types de biens des propriétés.', 'ts-immo'),
               'icon' => 'el el-puzzle',
               'fields' => $fields
           );
   
           Redux::setSection(TS_IMMO_SETTINGS, $newsection);
       ```
   
 *  Plugin Author [Kev Provance](https://wordpress.org/support/users/kprovance/)
 * (@kprovance)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/init-error-cannot-get-taxonomy/#post-14722289)
 * Your getTermsList is returning a WP_Error, which will fail in a function that
   expects an array. Ideally, you should check every return value for validity. 
   That’s a theme dev issue, which we are unable to support as it falls out of the
   scope of Redux itself. That, and I have no idea what code comprises your function.
   If it involves get_terms from the WordPress API, it will kick back WP_Error on
   failure. Trapping for it and handling it what I would recommend. See: [https://developer.wordpress.org/reference/functions/get_terms/](https://developer.wordpress.org/reference/functions/get_terms/)
 * Alternatively, many theme devs got here for help: [https://wordpress.stackexchange.com/](https://wordpress.stackexchange.com/)
 * Good luck!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Init error : cannot get Taxonomy’ is closed to new replies.

 * ![](https://ps.w.org/redux-framework/assets/icon.svg?rev=2889347)
 * [Redux Framework](https://wordpress.org/plugins/redux-framework/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redux-framework/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redux-framework/)
 * [Active Topics](https://wordpress.org/support/plugin/redux-framework/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redux-framework/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redux-framework/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Kev Provance](https://wordpress.org/support/users/kprovance/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/init-error-cannot-get-taxonomy/#post-14722289)
 * Status: resolved