Changeset 2392982
- Timestamp:
- 10/03/2020 07:37:06 PM (5 years ago)
- Location:
- add-wpgraphql-seo
- Files:
-
- 8 edited
- 1 copied
-
tags/4.7.0 (copied) (copied from add-wpgraphql-seo/trunk)
-
tags/4.7.0/CHANGELOG.md (modified) (1 diff)
-
tags/4.7.0/README.md (modified) (4 diffs)
-
tags/4.7.0/readme.txt (modified) (1 diff)
-
tags/4.7.0/wp-graphql-yoast-seo.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.md (modified) (4 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-graphql-yoast-seo.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
add-wpgraphql-seo/tags/4.7.0/CHANGELOG.md
r2376996 r2392982 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 ## [4.7.0] - 2020-10-03 9 10 ### Added 11 12 - Primary Category to edge. 7 13 8 14 ## [4.6.0] - 2020-09-08 -
add-wpgraphql-seo/tags/4.7.0/README.md
r2376996 r2392982 60 60 ``` 61 61 { 62 # Getting Yoast Content Data (posts pages etc) 62 63 pages(first: 10) { 63 64 edges { … … 128 129 } 129 130 130 131 # Getting Yoast Category data 131 132 categories(first: 10) { 132 133 edges { … … 166 167 } 167 168 168 169 # Getting Yoast User Data 169 170 users { 170 171 nodes { … … 190 191 } 191 192 193 # Getting Yoast primary category 194 query GetPostsPrimary { 195 posts { 196 nodes { 197 title 198 slug 199 categories { 200 edges { 201 isPrimary 202 node { 203 name 204 count 205 } 206 } 207 } 208 } 209 } 210 } 192 211 193 212 ``` -
add-wpgraphql-seo/tags/4.7.0/readme.txt
r2376996 r2392982 5 5 Tested up to: 5.4 6 6 Requires PHP: 7.1 7 Stable tag: 4. 6.07 Stable tag: 4.7.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
add-wpgraphql-seo/tags/4.7.0/wp-graphql-yoast-seo.php
r2376996 r2392982 9 9 * Text Domain: wp-graphql-yoast-seo 10 10 * Domain Path: /languages 11 * Version: 4. 6.011 * Version: 4.7.0 12 12 * 13 13 * @package WP_Graphql_YOAST_SEO … … 459 459 } 460 460 ]); 461 462 463 // Loop each taxonomy to register on the edge if a category is the primary one. 464 $taxonomies = get_object_taxonomies($post_type, 'objects'); 465 466 foreach ($taxonomies as $tax) { 467 468 469 if ($tax->hierarchical && $tax->graphql_single_name) { 470 471 $name = ucfirst($post_type_object->graphql_single_name) . 'To' . ucfirst($tax->graphql_single_name) . 'ConnectionEdge'; 472 473 register_graphql_field($name, 'isPrimary', [ 474 'type' => 'Boolean', 475 'description' => __('The Yoast SEO Primary ' . $tax->name, 'wp-graphql-yoast-seo'), 476 'resolve' => function ($item, array $args, AppContext $context) use ($tax) { 477 478 $postId = $item['source']->ID; 479 480 $wpseo_primary_term = new WPSEO_Primary_Term($tax->name, $postId); 481 $primaryTaxId = $wpseo_primary_term->get_primary_term(); 482 $termId = $item['node']->term_id; 483 484 485 return $primaryTaxId === $termId; 486 } 487 ]); 488 } 489 } 490 461 491 endif; 462 492 } 463 493 } 494 495 464 496 465 497 register_graphql_field('User', 'seo', [ -
add-wpgraphql-seo/trunk/CHANGELOG.md
r2376996 r2392982 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 ## [4.7.0] - 2020-10-03 9 10 ### Added 11 12 - Primary Category to edge. 7 13 8 14 ## [4.6.0] - 2020-09-08 -
add-wpgraphql-seo/trunk/README.md
r2376996 r2392982 60 60 ``` 61 61 { 62 # Getting Yoast Content Data (posts pages etc) 62 63 pages(first: 10) { 63 64 edges { … … 128 129 } 129 130 130 131 # Getting Yoast Category data 131 132 categories(first: 10) { 132 133 edges { … … 166 167 } 167 168 168 169 # Getting Yoast User Data 169 170 users { 170 171 nodes { … … 190 191 } 191 192 193 # Getting Yoast primary category 194 query GetPostsPrimary { 195 posts { 196 nodes { 197 title 198 slug 199 categories { 200 edges { 201 isPrimary 202 node { 203 name 204 count 205 } 206 } 207 } 208 } 209 } 210 } 192 211 193 212 ``` -
add-wpgraphql-seo/trunk/readme.txt
r2376996 r2392982 5 5 Tested up to: 5.4 6 6 Requires PHP: 7.1 7 Stable tag: 4. 6.07 Stable tag: 4.7.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
add-wpgraphql-seo/trunk/wp-graphql-yoast-seo.php
r2376996 r2392982 9 9 * Text Domain: wp-graphql-yoast-seo 10 10 * Domain Path: /languages 11 * Version: 4. 6.011 * Version: 4.7.0 12 12 * 13 13 * @package WP_Graphql_YOAST_SEO … … 459 459 } 460 460 ]); 461 462 463 // Loop each taxonomy to register on the edge if a category is the primary one. 464 $taxonomies = get_object_taxonomies($post_type, 'objects'); 465 466 foreach ($taxonomies as $tax) { 467 468 469 if ($tax->hierarchical && $tax->graphql_single_name) { 470 471 $name = ucfirst($post_type_object->graphql_single_name) . 'To' . ucfirst($tax->graphql_single_name) . 'ConnectionEdge'; 472 473 register_graphql_field($name, 'isPrimary', [ 474 'type' => 'Boolean', 475 'description' => __('The Yoast SEO Primary ' . $tax->name, 'wp-graphql-yoast-seo'), 476 'resolve' => function ($item, array $args, AppContext $context) use ($tax) { 477 478 $postId = $item['source']->ID; 479 480 $wpseo_primary_term = new WPSEO_Primary_Term($tax->name, $postId); 481 $primaryTaxId = $wpseo_primary_term->get_primary_term(); 482 $termId = $item['node']->term_id; 483 484 485 return $primaryTaxId === $termId; 486 } 487 ]); 488 } 489 } 490 461 491 endif; 462 492 } 463 493 } 494 495 464 496 465 497 register_graphql_field('User', 'seo', [
Note: See TracChangeset
for help on using the changeset viewer.