Skip to content

Commit

Permalink
fix: deprecate sitemaps.general.canPingSearchEngines field (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
justlevine authored Jan 20, 2024
1 parent 0b00708 commit f5410a5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- fix: Deprecate `rankMathSettings.sitemaps.general.canPingSearchEngines`, as it was remove in RankMath v1.0.211.

## v0.0.16

- fix: Correctly parse excluded Post/Term IDs when returning nodes for Sitemap. Props @marcinkrzeminski
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private function meta_content_type_fields(): ?array {
*/
private function sitemap_general_fields(): array {
return [
'canPingSearchEngines' => ! empty( $this->data['sitemap']['ping_search_engines'] ),
'canPingSearchEngines' => false,
'excludedPostDatabaseIds' => ! empty( $this->data['sitemap']['exclude_posts'] ) ? array_map( 'absint', explode( ',', $this->data['sitemap']['exclude_posts'] ) ) : null,
'excludedTermDatabaseIds' => ! empty( $this->data['sitemap']['exclude_terms'] ) ? array_map( 'absint', explode( ',', $this->data['sitemap']['exclude_terms'] ) ) : null,
'hasFeaturedImage' => ! empty( $this->data['sitemap']['include_featured_image'] ),
Expand Down
5 changes: 3 additions & 2 deletions src/Type/WPObject/Settings/Sitemap/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public static function get_description(): string {
public static function get_fields(): array {
return [
'canPingSearchEngines' => [
'type' => 'Boolean',
'description' => __( 'Whether to notify search engines when the sitemap is updated.', 'wp-graphql-rank-math' ),
'type' => 'Boolean',
'deprecationReason' => __( 'This feature is no longer supported by Google, and has been removed from RankMath v1.0.211+.', 'wp-graphql-rank-math' ),
'description' => __( 'Whether to notify search engines when the sitemap is updated.', 'wp-graphql-rank-math' ),
],
'excludedPostDatabaseIds' => [
'type' => [ 'list_of' => 'Int' ],
Expand Down
2 changes: 0 additions & 2 deletions tests/wpunit/SettingsQueriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ public function testSitemapSettings() {
}
}
general {
canPingSearchEngines
excludedPostDatabaseIds
excludedTermDatabaseIds
hasFeaturedImage
Expand Down Expand Up @@ -573,7 +572,6 @@ public function testSitemapSettings() {
$this->expectedObject(
'general',
[
$this->expectedField( 'canPingSearchEngines', true ),
$this->expectedField( 'excludedPostDatabaseIds', static::IS_NULL ),
$this->expectedField( 'excludedTermDatabaseIds', static::IS_NULL ),
$this->expectedField( 'hasFeaturedImage', false ),
Expand Down

0 comments on commit f5410a5

Please sign in to comment.