From 46f254b8d8bededa7052033e4e5793564ddea70e Mon Sep 17 00:00:00 2001 From: Geoff Dusome Date: Thu, 14 Sep 2023 14:48:11 -0400 Subject: [PATCH] fix primary_term trait issues --- wp-content/plugins/core/src/Post_Types/Post/Post.php | 3 +++ wp-content/plugins/core/src/Templates/Traits/Primary_Term.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-content/plugins/core/src/Post_Types/Post/Post.php b/wp-content/plugins/core/src/Post_Types/Post/Post.php index 2c64689b..51b344ba 100644 --- a/wp-content/plugins/core/src/Post_Types/Post/Post.php +++ b/wp-content/plugins/core/src/Post_Types/Post/Post.php @@ -3,9 +3,12 @@ namespace Tribe\Plugin\Post_Types\Post; use Tribe\Libs\Post_Type\Post_Object; +use Tribe\Plugin\Templates\Traits\Primary_Term; class Post extends Post_Object { + use Primary_Term; + public const NAME = 'post'; } diff --git a/wp-content/plugins/core/src/Templates/Traits/Primary_Term.php b/wp-content/plugins/core/src/Templates/Traits/Primary_Term.php index d2c07320..ff430ba2 100644 --- a/wp-content/plugins/core/src/Templates/Traits/Primary_Term.php +++ b/wp-content/plugins/core/src/Templates/Traits/Primary_Term.php @@ -21,7 +21,7 @@ public function get_primary_term( int $post_id, string $taxonomy ): ?WP_Term { // RankMath SEO Enabled if ( $this->has_rank_math() ) { - $primary_term_id = get_post_meta( "rank_math_primary_{$taxonomy}", $post_id ); + $primary_term_id = get_post_meta( $post_id, "rank_math_primary_{$taxonomy}", true ); } // No Yoast fallback