-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Repurpose sharing-modal to just show recommended tags (#39451)…
- Loading branch information
1 parent
fc199e8
commit 21011d7
Showing
19 changed files
with
991 additions
and
328 deletions.
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
projects/packages/jetpack-mu-wpcom/changelog/update-sharing-modal-only-recommended-tags
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
projects/packages/jetpack-mu-wpcom/src/assets/images/illo-share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 0 additions & 68 deletions
68
...m-block-editor-nux/class-wp-rest-wpcom-block-editor-recommended-tags-modal-controller.php
This file was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
...ures/wpcom-block-editor-nux/class-wp-rest-wpcom-block-editor-sharing-modal-controller.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
/** | ||
* WP_REST_WPCOM_Block_Editor_Sharing_Modal_Controller file. | ||
* | ||
* @package Aautomattic/jetpack-mu-wpcom | ||
*/ | ||
|
||
namespace Automattic\Jetpack\Jetpack_Mu_Wpcom\NUX; | ||
|
||
/** | ||
* Class WP_REST_WPCOM_Block_Editor_Sharing_Modal_Controller. | ||
*/ | ||
class WP_REST_WPCOM_Block_Editor_Sharing_Modal_Controller extends \WP_REST_Controller { | ||
/** | ||
* WP_REST_WPCOM_Block_Editor_Sharing_Modal_Controller constructor. | ||
*/ | ||
public function __construct() { | ||
$this->namespace = 'wpcom/v2'; | ||
$this->rest_base = 'block-editor/sharing-modal-dismissed'; | ||
} | ||
|
||
/** | ||
* Register available routes. | ||
*/ | ||
public function register_rest_route() { | ||
register_rest_route( | ||
$this->namespace, | ||
$this->rest_base, | ||
array( | ||
array( | ||
'methods' => \WP_REST_Server::EDITABLE, | ||
'callback' => array( $this, 'set_wpcom_sharing_modal_dismissed' ), | ||
'permission_callback' => array( $this, 'permission_callback' ), | ||
), | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* Callback to determine whether the request can proceed. | ||
* | ||
* @return boolean | ||
*/ | ||
public function permission_callback() { | ||
return current_user_can( 'read' ); | ||
} | ||
|
||
/** | ||
* Get the sharing modal dismissed status | ||
* | ||
* @return boolean | ||
*/ | ||
public static function get_wpcom_sharing_modal_dismissed() { | ||
$old_sharing_modal_dismissed = (bool) get_option( 'sharing_modal_dismissed', false ); | ||
if ( $old_sharing_modal_dismissed ) { | ||
return true; | ||
} | ||
return (bool) get_option( 'wpcom_sharing_modal_dismissed', false ); | ||
} | ||
|
||
/** | ||
* Dismiss the sharing modal | ||
* | ||
* @param \WP_REST_Request $request Request object. | ||
* @return \WP_REST_Response | ||
*/ | ||
public function set_wpcom_sharing_modal_dismissed( $request ) { | ||
$params = $request->get_json_params(); | ||
update_option( 'wpcom_sharing_modal_dismissed', $params['wpcom_sharing_modal_dismissed'] ); | ||
return rest_ensure_response( array( 'wpcom_sharing_modal_dismissed' => $this->get_wpcom_sharing_modal_dismissed() ) ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 0 additions & 117 deletions
117
...jetpack-mu-wpcom/src/features/wpcom-block-editor-nux/src/recommended-tags-modal/index.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.