Changeset 12999 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 12/04/2023 04:42:52 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r12816 r12999 50 50 add_action( 'wp_head', array( Template::class, 'json_ld_schema' ), 1 ); 51 51 add_action( 'wp_head', array( Template::class, 'hreflang_link_attributes' ), 2 ); 52 add_filter( 'allowed_redirect_hosts', array( $this, 'filter_redirect_hosts' ) ); 52 53 53 54 // Add no-index headers where appropriate. … … 1392 1393 } 1393 1394 1395 if ( is_single() && isset( $_GET['preview'] ) && Template::is_preview_available( ) ) { 1396 if ( $preview_url = Template::preview_link() ) { 1397 wp_safe_redirect( $preview_url, 302 ); 1398 die; 1399 } 1400 } 1401 1394 1402 if ( is_comment_feed() ) { 1395 1403 wp_redirect( 'https://wordpress.org/plugins/', 301 ); … … 1397 1405 } 1398 1406 1407 } 1408 1409 /** 1410 * Filter allowed_redirect_hosts to allow safe redirect to trusted hosts. 1411 * @param array $hosts 1412 */ 1413 function filter_redirect_hosts( $hosts ) { 1414 $hosts[] = 'playground.wordpress.net'; 1415 1416 return $hosts; 1399 1417 } 1400 1418
Note: See TracChangeset
for help on using the changeset viewer.