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

Site Logo: 5.8 Compat #20047

Closed
wants to merge 7 commits into from
Closed

Conversation

kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Jun 8, 2021

See #19654

Changes proposed in this Pull Request:

  • Removes the transitionary code. Gutenberg now uses a site_logo option name.

Jetpack product discussion

Does this pull request change what data or activity we track or use?

n/a

Testing instructions:

@kraftbj kraftbj added this to the jetpack/9.9 milestone Jun 8, 2021
@kraftbj kraftbj added [Focus] Compatibility Ensuring our products play well with third-parties [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Type] Bug When a feature is broken and / or not performing as intended [Type] Janitorial labels Jun 8, 2021
@kraftbj kraftbj self-assigned this Jun 8, 2021
@kraftbj kraftbj requested a review from sdixon194 June 8, 2021 20:37
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello kraftbj! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D62502-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Feature] Theme Tools labels Jun 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • 🔴 Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


🔴 Action required: Please add missing changelog entries for the following projects: projects/plugins/jetpack

Use the Jetpack CLI tool to generate changelog entries by running the following command: jetpack changelog add.
Guidelines: /docs/writing-a-good-changelog-entry.md


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: July 6, 2021.
  • Scheduled code freeze: June 28, 2021.

@github-actions github-actions bot added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jun 8, 2021
@kraftbj
Copy link
Contributor Author

kraftbj commented Jun 8, 2021

Removal may not be the right approach, but may want to use it to set it to match the new Core style. See p1623174912090300-slack-CBTN58FTJ

Copy link
Contributor

@pablinos pablinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might need to keep some version of this code. If the theme changes to one that supports custom-logo then the code in core will not grab the ID from this Jetpack option. Also the site_logo option in core is expected to be an ID, so leaving the Jetpack one will mean that it's an array. We may want to check for an array being the option value and copy the ID to the custom_logo theme mod and the site_logo option.

Similarly we might need to handle conversion the other way.

@kraftbj kraftbj changed the title Site Logo: Remove the transitionary code Site Logo: 5.8 Compat Jun 9, 2021
@kraftbj kraftbj added the [Tests] Needs Tests Some Unit Tests would be really useful to include with this PR. label Jun 9, 2021
Comment on lines +30 to +31
if ( current_theme_supports( 'custom-logo' ) && ! get_theme_mod( 'custom_logo' ) && get_option( 'site_logo' ) ) {
$jp_logo = get_option( 'site_logo' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move the get_option here?

Suggested change
if ( current_theme_supports( 'custom-logo' ) && ! get_theme_mod( 'custom_logo' ) && get_option( 'site_logo' ) ) {
$jp_logo = get_option( 'site_logo' );
$jp_logo = get_option( 'site_logo' );
if ( current_theme_supports( 'custom-logo' ) && ! get_theme_mod( 'custom_logo' ) && $jp_logo ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but didn't because it would mean a db call that might not be needed if current_theme_support was false.

projects/plugins/jetpack/modules/theme-tools/site-logo.php Outdated Show resolved Hide resolved
@creativecoder
Copy link
Contributor

Note, I modified and expanded some of the work here and created #20192.

It looks like we have quite a few themes still using the legacy site-logo functionality on WordPress.com, so it'll be important to get this in the next Jetpack release, since it's the final planned Jetpack release before WP 5.8.

@kraftbj
Copy link
Contributor Author

kraftbj commented Jun 28, 2021

Going to close this to defer to 20192.

@kraftbj kraftbj closed this Jun 28, 2021
@kraftbj kraftbj deleted the remove/site-logo-transition-code branch June 28, 2021 16:52
@github-actions github-actions bot removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Theme Tools [Feature] WPCOM API [Focus] Compatibility Ensuring our products play well with third-parties [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Blocked / Hold [Tests] Needs Tests Some Unit Tests would be really useful to include with this PR. Touches WP.com Files [Type] Bug When a feature is broken and / or not performing as intended [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants