Skip to content

Commit

Permalink
Social: Disable resharing on Simple sites in classic editor (#39419)
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk authored Sep 23, 2024
1 parent 20eab85 commit 57a0772
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Social: Disabled resharing on Simple sites in classic editor
8 changes: 6 additions & 2 deletions projects/packages/publicize/src/class-publicize-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ public function post_page_metabox_assets() {
'textdomain' => 'jetpack-publicize-pkg',
)
);
$is_simple_site = ( new Host() )->is_wpcom_simple();

wp_add_inline_script(
'jetpack-social-classic-editor-options',
'var jetpackSocialClassicEditorOptions = ' . wp_json_encode(
Expand All @@ -185,7 +187,7 @@ public function post_page_metabox_assets() {
'connectionsUrl' => esc_url( $this->publicize_settings_url ),
'isEnhancedPublishingEnabled' => $this->publicize->has_enhanced_publishing_feature(),
'resharePath' => '/jetpack/v4/publicize/{postId}',
'isReshareSupported' => Current_Plan::supports( 'republicize' ),
'isReshareSupported' => ! $is_simple_site && Current_Plan::supports( 'republicize' ),
'siteType' => $site_type,
)
),
Expand Down Expand Up @@ -640,6 +642,8 @@ class="wpas-submit-<?php echo esc_attr( $connection_data['service_name'] ); ?>"

$all_done = $all_done || $all_connections_done;

$is_simple_site = ( new Host() )->is_wpcom_simple();

?>

</ul>
Expand All @@ -651,7 +655,7 @@ class="wpas-submit-<?php echo esc_attr( $connection_data['service_name'] ); ?>"
<a href="#" class="hide-if-no-js button" id="publicize-form-hide"><?php esc_html_e( 'OK', 'jetpack-publicize-pkg' ); ?></a>
<input type="hidden" name="wpas[0]" value="1" />
<?php endif; ?>
<?php if ( $is_post_published && Current_Plan::supports( 'republicize' ) ) : ?>
<?php if ( $is_post_published && ! $is_simple_site && Current_Plan::supports( 'republicize' ) ) : ?>
<button type="button" class="hide-if-no-js button" id="publicize-share-now">
<?php esc_html_e( 'Share now', 'jetpack-publicize-pkg' ); ?>
</button>
Expand Down

0 comments on commit 57a0772

Please sign in to comment.