Skip to content

Commit

Permalink
Social: Hide license link on Social admin page of WoA sites (#41076)
Browse files Browse the repository at this point in the history
* Add JetpackScriptData.site.host property
* Hide license link on Social admin page of WoA sites
  • Loading branch information
p-jackson authored Jan 15, 2025
1 parent 9932919 commit be0d34b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

License: Social admin page header hides license link on WoA sites.
1 change: 1 addition & 0 deletions projects/js-packages/script-data/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface PublicSiteData {
export interface AdminSiteData {
admin_url: string;
date_format: string;
host?: 'woa' | 'atomic' | 'newspack' | 'vip' | 'wpcom' | 'unknown';
is_multisite: boolean;
plan: SitePlan;
rest_nonce: string;
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/publicize/changelog/hide-license-on-woa
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

License: Social admin page header hides license link on WoA sites.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public static function set_admin_script_data( $data ) {

$data['site']['wpcom']['blog_id'] = Manager::get_site_id( true );
$data['site']['suffix'] = ( new Status() )->get_site_suffix();
if ( ! isset( $data['site']['host'] ) ) {
$data['site']['host'] = ( new Host() )->get_known_host_guess();
}

return $data;
}
Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/social/changelog/hide-license-on-woa
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

License: Social admin page header hides license link on WoA sites.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { hasSocialPaidFeatures } from '@automattic/jetpack-publicize-components';
import { getMyJetpackUrl } from '@automattic/jetpack-script-data';
import { getMyJetpackUrl, getScriptData } from '@automattic/jetpack-script-data';
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import Logo from './../../logo';
Expand All @@ -14,7 +14,7 @@ const AdminPageHeader = () => {
<Logo />
</span>

{ ! hasSocialPaidFeatures() && (
{ ! hasSocialPaidFeatures() && getScriptData().site.host !== 'woa' && (
<p>
{ createInterpolateElement(
__(
Expand Down

0 comments on commit be0d34b

Please sign in to comment.