PWA icon
Utilities

PWA hooks reference

  • By Weston Ruter
  • v0.8.2
  • Updated

PWA 0.8.2 has 8 actions and 23 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when PWA fires an action
add_action( 'admin_enqueue_scripts', function( $hook_name ) {
	// Your code runs here.
}, 10, 1 );

// Change a value PWA is about to use
add_filter( 'wp_service_worker_navigation_preload', function( $value, $arg2 ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • pwa.php line 150 · used in 2 places
    /**
     * This filter is documented in
     * wp-includes/components/class-wp-service-worker-navigation-routing-component.
     * php
     */
    apply_filters( 'wp_service_worker_navigation_preload', true, WP_Service_Workers::SCOPE_FRONT );
  • pwa.php line 136 · used in 2 places
    /**
     * This filter is documented in
     * wp-includes/components/class-wp-service-worker-navigation-routing-component.
     * php
     */
    apply_filters( 'wp_service_worker_navigation_route', array( 'url' => null, 'revision' => '', ) );
  • wp-includes/template.php line 94
    /**
     * This filter is documented in wp-includes/template.php
     */
    apply_filters( "{$type}_template", $template, $type, $templates );
  • wp-includes/template.php line 89
    /**
     * This filter is documented in wp-includes/template.php
     */
    apply_filters( "{$type}_template_hierarchy", $templates );
  • wp-includes/class-wp-service-workers.php line 168
    /**
     * This action is documented in wp-admin/admin-header.php
     */
    do_action( 'admin_enqueue_scripts', $hook_name );
  • admin_title

    filter
    wp-admin/error.php line 52
    /**
     * This filter is documented in wp-admin/admin-header.php
     */
    apply_filters( 'admin_title', $admin_title, $title_prefix );
  • wp-includes/class-wp-web-app-manifest.php line 130
    /**
     * Filters splash screen images for Safari on iOS.
     */
    apply_filters( 'apple_touch_startup_images', $images );
  • error_head

    action
    wp-includes/theme-compat/header-error.php line 141
    /**
     * Prints scripts or data in the error template <head> tag.
     */
    do_action( 'error_head' );
  • get_header

    action
    wp-includes/general-template.php line 36
    /**
     * Fires before the header template file is loaded.
     */
    do_action( 'get_header', $name );
  • integrations/class-wp-service-worker-scripts-integration.php line 77
    /**
     * This filter is documented in wp-includes/class.wp-scripts.php
     */
    apply_filters( 'script_loader_src', $url, $handle );
  • integrations/class-wp-service-worker-styles-integration.php line 77
    /**
     * This filter is documented in wp-includes/class.wp-styles.php
     */
    apply_filters( 'style_loader_src', $url, $handle );
  • wp-includes/class-wp-web-app-manifest.php line 248
    /**
     * Enables overriding the manifest json.
     */
    apply_filters( 'web_app_manifest', $manifest );
  • wp-includes/class-wp-service-workers.php line 177
    /**
     * Fires before serving the wp-admin service worker, when its scripts should be
     * registered, caching routes established, and assets precached.
     */
    do_action( 'wp_admin_service_worker', $this->scripts );
  • wp-includes/class-wp-service-worker-scripts.php line 79
    /**
     * Fires when the WP_Service_Worker_Scripts instance is initialized.
     */
    do_action_ref_array( 'wp_default_service_workers', array( &$this ) );
  • wp-includes/class-wp-service-workers.php line 162
    /**
     * Fires before serving the frontend service worker, when its scripts should be
     * registered, caching routes established, and assets precached.
     */
    do_action( 'wp_front_service_worker', $this->scripts );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 234
    /**
     * Filters what is precached to serve as the offline error response on the
     * frontend.
     */
    apply_filters( 'wp_offline_error_precache_entry', $offline_error_precache_entry );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 254
    /**
     * Filters what is precached to serve as the internal server error response on
     * the frontend.
     */
    apply_filters( 'wp_server_error_precache_entry', $server_error_precache_entry );
  • wp-includes/components/class-wp-service-worker-configuration-component.php line 116
    /**
     * Filters whether the service worker should use clientsClaim() after
     * skipWaiting().
     */
    apply_filters( 'wp_service_worker_clients_claim', true );
  • wp-includes/components/class-wp-service-worker-core-asset-caching-component.php line 70
    /**
     * Filters service worker caching configuration for core asset requests.
     */
    apply_filters( 'wp_service_worker_core_asset_caching', $config );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 182
    /**
     * Filters service worker caching configuration for navigation requests.
     */
    apply_filters( 'wp_service_worker_navigation_caching', $config );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 109
    /**
     * Filters caching strategy used for frontend navigation requests.
     */
    apply_filters( 'wp_service_worker_navigation_caching_strategy', '' );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 128
    /**
     * Filters the caching strategy args used for frontend navigation requests.
     */
    apply_filters( 'wp_service_worker_navigation_caching_strategy_args', array() );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 406
    /**
     * Filter list of URL patterns to denylist from handling from the navigation
     * router.
     */
    apply_filters_deprecated( 'wp_service_worker_navigation_route_blacklist_patterns', array( $denylist_patterns ), '0.4', 'wp_service_worker_navigation_route_denylist_patterns' );
  • wp-includes/components/class-wp-service-worker-navigation-routing-component.php line 419
    /**
     * Filter list of URL patterns to denylist from handling from the navigation
     * router.
     */
    apply_filters( 'wp_service_worker_navigation_route_denylist_patterns', $denylist_patterns );
  • wp-includes/components/class-wp-service-worker-plugin-asset-caching-component.php line 70
    /**
     * Filters service worker caching configuration for plugin asset requests.
     */
    apply_filters( 'wp_service_worker_plugin_asset_caching', $config );
  • wp-includes/service-workers.php line 259
    /**
     * Filters whether the service worker should update automatically when a new
     * version is available.
     */
    apply_filters( 'wp_service_worker_skip_waiting', true );
  • wp-includes/components/class-wp-service-worker-theme-asset-caching-component.php line 77
    /**
     * Filters service worker caching configuration for theme asset requests.
     */
    apply_filters( 'wp_service_worker_theme_asset_caching', $config );
  • wp-includes/components/class-wp-service-worker-uploaded-image-caching-component.php line 96
    /**
     * Filters service worker caching configuration for uploaded image requests.
     */
    apply_filters( 'wp_service_worker_uploaded_image_caching', $config );
  • wp-includes/template.php line 143
    apply_filters( 'wp_service_worker_error_messages', array( 'clientOffline' => __( 'It seems you are offline. Please check your internet connection and try again.', 'pwa' ), 'serverOffline' => __( 'The server appears to be down, or your connection isn\'t working as expected. Please try again later.', 'pwa' ), 'error' => __( 'Something prevented the page from being rendered. Please try again.', 'pwa' ), 'submissionFailure' => __( 'Your submission ... );

Generated from PWA's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: