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

Social: Disable resharing on Simple sites in classic editor #39419

Open
wants to merge 2 commits into
base: trunk
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
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
Loading