Skip to content

Commit

Permalink
Move pwa_load_service_worker_integrations() to deprecated.php
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Mar 4, 2022
1 parent 087ed7a commit 56b3d8d
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the admin assets service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Admin_Assets_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
1 change: 0 additions & 1 deletion integrations/class-wp-service-worker-base-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Base class representing a service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
abstract class WP_Service_Worker_Base_Integration implements WP_Service_Worker_Integration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Custom Background service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Custom_Background_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Custom Header service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Custom_Header_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Custom Logo service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Custom_Logo_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
1 change: 0 additions & 1 deletion integrations/class-wp-service-worker-fonts-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Fonts service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Fonts_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Scripts service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Scripts_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Site Icon service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Site_Icon_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Class representing the Styles service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
final class WP_Service_Worker_Styles_Integration extends WP_Service_Worker_Base_Integration {
Expand Down
1 change: 0 additions & 1 deletion integrations/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* );
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*
* @param WP_Service_Worker_Scripts $scripts Instance to register service worker behavior with.
Expand Down
4 changes: 0 additions & 4 deletions integrations/interface-wp-service-worker-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* Interface representing a service worker integration.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*/
interface WP_Service_Worker_Integration {
Expand All @@ -18,7 +17,6 @@ interface WP_Service_Worker_Integration {
* Gets the scope this integration applies to.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*
* @return int Either WP_Service_Workers::SCOPE_FRONT, WP_Service_Workers::SCOPE_ADMIN, or
Expand All @@ -30,7 +28,6 @@ public function get_scope();
* Gets the priority this integration should be hooked into the service worker action with.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*
* @return int Hook priority. A higher number means a lower priority.
Expand All @@ -41,7 +38,6 @@ public function get_priority();
* Registers the integration functionality.
*
* @since 0.2
*
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*
* @param WP_Service_Worker_Scripts $scripts Instance to register service worker behavior with.
Expand Down
19 changes: 0 additions & 19 deletions pwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,25 +271,6 @@ function _pwa_deactivate_plugin() {

register_deactivation_hook( PWA_PLUGIN_FILE, '_pwa_deactivate_plugin' );

/**
* Load service worker integrations.
*
* @since 0.2.0
*
* @param WP_Service_Worker_Scripts $scripts Instance to register service worker behavior with.
*/
function pwa_load_service_worker_integrations( WP_Service_Worker_Scripts $scripts ) {
if ( ! current_theme_supports( 'service_worker' ) ) {
return;
}

/** WordPress Service Worker Integration Functions */
require_once PWA_PLUGIN_DIR . '/integrations/functions.php';

pwa_register_service_worker_integrations( $scripts );
}
add_action( 'wp_default_service_workers', 'pwa_load_service_worker_integrations', -1 );

$wp_web_app_manifest = new WP_Web_App_Manifest();
$wp_web_app_manifest->init();

Expand Down
20 changes: 20 additions & 0 deletions wp-includes/deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,23 @@ function wp_disable_script_concatenation() {
}
// phpcs:enable
}

/**
* Load service worker integrations.
*
* @since 0.2.0
* @deprecated 0.7 Integrations will not be proposed for WordPress core merge.
*
* @param WP_Service_Worker_Scripts $scripts Instance to register service worker behavior with.
*/
function pwa_load_service_worker_integrations( WP_Service_Worker_Scripts $scripts ) {
if ( ! current_theme_supports( 'service_worker' ) ) {
return;
}

/** WordPress Service Worker Integration Functions */
require_once PWA_PLUGIN_DIR . '/integrations/functions.php';

pwa_register_service_worker_integrations( $scripts );
}
add_action( 'wp_default_service_workers', 'pwa_load_service_worker_integrations', -1 );

0 comments on commit 56b3d8d

Please sign in to comment.