diff --git a/library/Content/ResourceFromApi/Taxonomy/TaxonomyRegistrar.php b/library/Content/ResourceFromApi/Taxonomy/TaxonomyRegistrar.php index c85b9e12a..55b9bdde2 100644 --- a/library/Content/ResourceFromApi/Taxonomy/TaxonomyRegistrar.php +++ b/library/Content/ResourceFromApi/Taxonomy/TaxonomyRegistrar.php @@ -111,8 +111,14 @@ private function prepareArguments(): void */ private function prepareLabels(array $arguments): array { + $arguments['labels'] = []; + + if( isset($arguments['labels_name']) && !empty($arguments['labels_name']) ) { + $arguments['labels']['name'] = $arguments['labels_name']; + } + if (isset($arguments['labels_singular_name']) && !empty($arguments['labels_singular_name'])) { - $arguments['labels'] = ['singular_name' => $arguments['labels_singular_name']]; + $arguments['labels']['singular_name'] = $arguments['labels_singular_name']; } return $arguments; diff --git a/library/Controller/BaseController.php b/library/Controller/BaseController.php index 7192c510c..9f5fae4b5 100644 --- a/library/Controller/BaseController.php +++ b/library/Controller/BaseController.php @@ -118,6 +118,7 @@ public function __construct() //Main Navigation $this->data['primaryMenuItems'] = $primary->getMenuItems('main-menu', $this->getPageID(), \Kirki::get_option('primary_menu_pagetree_fallback'), true, !$this->data['customizer']->primaryMenuDropdown); + $this->data['secondaryMenuItems'] = null; /** * Get the secondary menu items based on the content type or post type. diff --git a/library/Controller/ContentType/School/SchoolDataPreparer.php b/library/Controller/ContentType/School/SchoolDataPreparer.php index 925fbaf2c..279ac9f9a 100644 --- a/library/Controller/ContentType/School/SchoolDataPreparer.php +++ b/library/Controller/ContentType/School/SchoolDataPreparer.php @@ -549,6 +549,7 @@ private function attachmentToSliderItem($attachment): array private function appendEventData() { $this->data['events'] = null; + $this->data['eventsTitle'] = null; if( !post_type_exists(self::EVENT_POST_TYPE) || !taxonomy_exists(self::EVENT_TAXONOMY) ) { return; diff --git a/library/Helper/Post.php b/library/Helper/Post.php index 143c65bdd..a3ce9a53e 100644 --- a/library/Helper/Post.php +++ b/library/Helper/Post.php @@ -317,7 +317,7 @@ protected static function getPostTerms($postId, $includeLink = true, $taxonomies foreach ($taxonomies as $taxonomy) { $terms = wp_get_post_terms($postId, $taxonomy); - if (!empty($terms)) { + if (!is_wp_error($terms) && !empty($terms)) { foreach ($terms as $term) { $item = [];