Changeset 3375
- Timestamp:
- 06/15/2016 05:37:03 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r3343 r3375 31 31 add_filter( 'pre_update_option_jetpack_options', array( $this, 'filter_jetpack_options' ) ); 32 32 add_action( 'template_redirect', array( $this, 'redirect_hidden_plugins' ) ); 33 add_action( 'template_redirect', array( $this, 'prevent_canonical_for_plugins' ), 9 ); 33 34 34 35 // Shim in postmeta support for data which doesn't yet live in postmeta 35 36 add_filter( 'get_post_metadata', array( $this, 'filter_shim_postmeta' ), 10, 3 ); 36 37 37 38 38 add_filter( 'map_meta_cap', array( __NAMESPACE__ . '\Capabilities', 'map_meta_cap' ), 10, 4 ); … … 541 541 if ( $post instanceof \WP_Post && in_array( $post->post_status, array( 'disabled', 'closed' ), true ) && current_user_can( 'edit_post', $post ) ) { 542 542 wp_safe_redirect( add_query_arg( array( 'post' => $post->ID, 'action' => 'edit' ), admin_url( 'post.php' ) ) ); 543 } 544 } 545 546 /** 547 * Prevents Canonical redirecting to other plugins on 404's. 548 */ 549 function prevent_canonical_for_plugins() { 550 if ( is_404() ) { 551 remove_action( 'template_redirect', 'redirect_canonical' ); 543 552 } 544 553 }
Note: See TracChangeset
for help on using the changeset viewer.