Make WordPress Core

Changeset 58127


Ignore:
Timestamp:
05/10/2024 09:11:44 AM (2 months ago)
Author:
gziolo
Message:

Interactivity API: Cannot be used from wp-admin

Interactivity API has hooks that run on the frontend, but not in wp-admin. This means that interactivity data was not printed to the HTML and the interactivity Script Modules were not registered.

Fixes #61087.
Props jonsurrell, cbravobernal, gziolo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php

    r57841 r58127  
    209209        add_action( 'wp_enqueue_scripts', array( $this, 'register_script_modules' ) );
    210210        add_action( 'wp_footer', array( $this, 'print_client_interactivity_data' ) );
     211
     212        add_action( 'admin_enqueue_scripts', array( $this, 'register_script_modules' ) );
     213        add_action( 'admin_print_footer_scripts', array( $this, 'print_client_interactivity_data' ) );
    211214    }
    212215
Note: See TracChangeset for help on using the changeset viewer.