Skip to content

Commit 1f440c2

Browse files
authored
Merge pull request #669 from ProgressPlanner/filip/v19/yoast-site-logo-fallback
Detect site logo as fallback, for "Yoast SEO: set your organization logo" task
2 parents e72742c + b93a4db commit 1f440c2

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

classes/suggested-tasks/providers/integrations/yoast/class-organization-logo.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ public function get_focus_tasks() {
9898
* @return bool
9999
*/
100100
public function should_add_task() {
101+
102+
// Check if the site logo is set, Yoast SEO uses it as a fallback.
103+
$site_logo_id = \get_option( 'site_logo' );
104+
if ( ! $site_logo_id ) {
105+
$site_logo_id = \get_theme_mod( 'custom_logo', false );
106+
}
107+
108+
// If the site logo is set, we don't need to add the task.
109+
if ( (int) $site_logo_id ) {
110+
return false;
111+
}
112+
101113
// If the site is for a person, and the person logo is already set, we don't need to add the task.
102114
if ( $this->yoast_seo->helpers->options->get( 'company_or_person', 'company' ) === 'company' // @phpstan-ignore-line property.nonObject
103115
&& $this->yoast_seo->helpers->options->get( 'company_logo' ) // @phpstan-ignore-line property.nonObject

readme.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ https://youtu.be/e1bmxZYyXFY
8383

8484
== Changelog ==
8585

86+
= 1.9.0 =
87+
88+
Enhancements:
89+
90+
* "Yoast SEO: set your organization logo" task detects site logo as fallback, same as Yoast SEO does.
91+
8692
= 1.8.1 =
8793

8894
- Security fix: Privilege escalation via an AJAX call where authenticated users could update arbitrary site options.

0 commit comments

Comments
 (0)