-
Notifications
You must be signed in to change notification settings - Fork 841
Add platform config #45874
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
base: trunk
Are you sure you want to change the base?
Add platform config #45874
Changes from all commits
c859ab5
5df002b
05cf8e0
cbb7d1b
79c39e2
4736d66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: changed | ||
|
|
||
| Brand: Add brand filter so that you can change icon colour and determine the amount of branding you want to show |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: changed | ||
|
|
||
| Brand: Add brand filter so that you can change icon colour and determine the amount of branding you want to show |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: changed | ||
|
|
||
| Brand: Add brand filter so that you can change icon colour and determine the amount of branding you want to show |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -123,7 +123,7 @@ protected static function get_admin_script_data() { | |||||||||||||||||||||||||||
| global $wp_version; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| $data = array( | ||||||||||||||||||||||||||||
| 'site' => array( | ||||||||||||||||||||||||||||
| 'site' => array( | ||||||||||||||||||||||||||||
| 'admin_url' => esc_url_raw( admin_url() ), | ||||||||||||||||||||||||||||
| 'date_format' => get_option( 'date_format' ), | ||||||||||||||||||||||||||||
| 'icon' => self::get_site_icon(), | ||||||||||||||||||||||||||||
|
|
@@ -145,7 +145,12 @@ protected static function get_admin_script_data() { | |||||||||||||||||||||||||||
| 'blog_id' => 0, | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
| 'user' => array( | ||||||||||||||||||||||||||||
| 'platform' => array( | ||||||||||||||||||||||||||||
| 'accent_colour' => self::get_accent_colour(), | ||||||||||||||||||||||||||||
| 'has_branding' => self::get_has_branding(), | ||||||||||||||||||||||||||||
| 'has_subtle_branding' => self::get_has_subtle_branding(), | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
| 'user' => array( | ||||||||||||||||||||||||||||
| 'current_user' => self::get_current_user_data(), | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
|
|
@@ -186,6 +191,69 @@ protected static function get_public_script_data() { | |||||||||||||||||||||||||||
| return apply_filters( 'jetpack_public_js_script_data', $data ); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||
| * Get the accent colour. | ||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||
| * @return string | ||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||
| private static function get_accent_colour() { | ||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||
| * Filters the accent colour used in the Jetpack interface. | ||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||
| * @since $$NEXT_VERSION$$ | ||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||
| * @param string $colour The accent colour in HEX format. | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| * @param string $colour The accent colour in HEX format. | |
| * @param string $colour The accent colour in HEX format (e.g. "#069e08") or the CSS keyword 'inherit' to remove the colour. |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc comment has incorrect parameter description. Line 251 says @param bool $has_branding Whether branding is enabled. but this is for the jetpack_has_subtle_branding filter, not the jetpack_has_branding filter. The parameter should be named $has_subtle_branding and the description should reference subtle branding.
| * @param bool $has_branding Whether branding is enabled. | |
| * @param bool $has_subtle_branding Whether subtle branding is enabled. |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete documentation comment. The comment on line 246 states "This determines if Jetpack logos, colors, and other branding elements should be displayed in the UI." but this is for subtle branding specifically. The comment should clarify that this is for subtle or less prominent display of branding elements, distinguishing it from the regular has_branding setting.
| * should be displayed in the UI. | |
| * | |
| * @since $$NEXT_VERSION$$ | |
| * | |
| * @param bool $has_branding Whether branding is enabled. | |
| * @return bool The filtered branding state. | |
| * should be displayed in a *subtle* or *less prominent* way in the UI, | |
| * as opposed to the regular branding setting which may display them more prominently. | |
| * | |
| * @since $$NEXT_VERSION$$ | |
| * | |
| * @param bool $has_branding Whether subtle branding is enabled. | |
| * @return bool The filtered subtle branding state. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: changed | ||
|
|
||
| Brand: Add brand filter so that you can change icon colour and determine the amount of branding you want to show |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for returning
accentColourhas a potential issue. WhenisWpcomPlatformSite()returnstrue, the function returnsnullto match core block styling. However, this bypasses the filterjetpack_accent_colourentirely for WordPress.com sites. If the intent is to allow WordPress.com sites to still use the filter to set a custom accent color, this early return prevents that. Consider checking the platform data first before deciding to return null.