Changeset 12214 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
- Timestamp:
- 11/07/2022 04:35:22 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
r12206 r12214 88 88 return; 89 89 } 90 91 wp_register_script( 'wporg-registration', get_template_directory_uri() . '/js/registration.js', array( 'recaptcha-api', 'jquery' ), filemtime( __DIR__ . '/js/registration.js' ) ); 92 wp_localize_script( 'wporg-registration', 'wporg_registration', array( 93 'rest_url' => esc_url_raw( rest_url( 'wporg/v1' ) ) 94 ) ); 95 96 // Local environments do not need reCaptcha. 97 if ( 'local' === wp_get_environment_type() && ! defined( 'RECAPTCHA_V3_PUBKEY' ) ) { 98 wp_register_script( 'recaptcha-api', false ); // Empty script to satisfy wporg-registration requirements. 99 return; 100 } 101 90 102 91 103 wp_register_script( 'recaptcha-api', 'https://www.google.com/recaptcha/api.js', array(), '2' ); … … 109 121 }' 110 122 ); 111 112 wp_register_script( 'wporg-registration', get_template_directory_uri() . '/js/registration.js', array( 'recaptcha-api', 'jquery' ), filemtime( __DIR__ . '/js/registration.js' ) );113 wp_localize_script( 'wporg-registration', 'wporg_registration', array(114 'rest_url' => esc_url_raw( rest_url( 'wporg/v1' ) )115 ) );116 123 117 124 // reCaptcha v3 is loaded on all login pages, not just the registration flow.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)