Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANET-7647 Enforce consistency on default favicon #2507

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/MasterSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ function () {
add_action(
'customize_register',
function ($wp_customize): void {
// Remove site icon customization.
$wp_customize->remove_control('site_icon');

if (!defined('WP_APP_ENV') || ( 'production' !== WP_APP_ENV && 'staging' !== WP_APP_ENV )) {
return;
}
Expand Down
27 changes: 27 additions & 0 deletions src/Migrations/M038RemoveCustomSiteIcon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace P4\MasterTheme\Migrations;

use P4\MasterTheme\MigrationRecord;
use P4\MasterTheme\MigrationScript;

/**
* Remove custom site icon, since we disabled the option to customize it.
*/
class M038RemoveCustomSiteIcon extends MigrationScript
{
/**
* Perform the actual migration.
*
* @param MigrationRecord $record Information on the execution, can be used to add logs.
* phpcs:disable SlevomatCodingStandard.Functions.UnusedParameter -- interface implementation
*/
protected static function execute(MigrationRecord $record): void
{
if (!has_site_icon()) {
return;
}
update_option('site_icon', '');
}
// phpcs:enable SlevomatCodingStandard.Functions.UnusedParameter
}
2 changes: 2 additions & 0 deletions src/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use P4\MasterTheme\Migrations\M035MigrateCampaignCoversToP4ColumnsBlock;
use P4\MasterTheme\Migrations\M036RemoveEnFormOptions;
use P4\MasterTheme\Migrations\M037MigrateCoversContentBlockToPostsListBlock;
use P4\MasterTheme\Migrations\M038RemoveCustomSiteIcon;

/**
* Run any new migration scripts and record results in the log.
Expand Down Expand Up @@ -95,6 +96,7 @@ public static function migrate(): void
M035MigrateCampaignCoversToP4ColumnsBlock::class,
M036RemoveEnFormOptions::class,
M037MigrateCoversContentBlockToPostsListBlock::class,
M038RemoveCustomSiteIcon::class,
];

// Loop migrations and run those that haven't run yet.
Expand Down