diff --git a/includes/core/class-permalinks.php b/includes/core/class-permalinks.php index 642eaa9a..8cd7ca1a 100644 --- a/includes/core/class-permalinks.php +++ b/includes/core/class-permalinks.php @@ -30,18 +30,11 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) { * Permalinks constructor. */ function __construct() { - add_action( 'init', array( &$this, 'set_current_url' ), 0 ); add_action( 'init', array( &$this, 'check_for_querystrings' ), 1 ); add_action( 'init', array( &$this, 'activate_account_via_email_link' ), 1 ); - - //add_action( 'um_user_after_updating_profile', array( &$this, 'profile_url' ), 1 ); - - /* @deprecated since version 2.1.7 */ - //remove_action( 'wp_head', 'rel_canonical' ); - //add_action( 'wp_head', array( &$this, 'um_rel_canonical_' ), 9 ); } @@ -55,7 +48,9 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) { /** * SEO canonical href bugfix + * * @deprecated since version 2.1.7 + * * @see function um_profile_remove_wpseo() */ function um_rel_canonical_() { diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index 7f7372db..cfbf9c3c 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -609,10 +609,10 @@ if ( !function_exists( 'um_profile_remove_wpseo' ) ) { remove_all_filters( 'wpseo_head' ); /* Restore title and canonical if broken */ - if( ! has_action( 'wp_head', '_wp_render_title_tag' ) ){ + if ( ! has_action( 'wp_head', '_wp_render_title_tag' ) ) { add_action( 'wp_head', '_wp_render_title_tag', 18 ); } - if( ! has_action( 'wp_head', 'rel_canonical' ) ){ + if ( ! has_action( 'wp_head', 'rel_canonical' ) ) { add_action( 'wp_head', 'rel_canonical', 18 ); } } diff --git a/includes/core/um-filters-profile.php b/includes/core/um-filters-profile.php index 97cc7cb5..02ea64e9 100644 --- a/includes/core/um-filters-profile.php +++ b/includes/core/um-filters-profile.php @@ -84,9 +84,8 @@ add_filter( 'the_title', 'um_dynamic_user_profile_title', 100000, 2 ); * @param WP_Post $post Optional. Post ID or object. Default is global `$post`. * @return string|false The canonical URL, or false if current URL is canonical. */ -function um_get_canonical_url( $canonical_url, $post ){ - - if( UM()->config()->permalinks['user'] == $post->ID ) { +function um_get_canonical_url( $canonical_url, $post ) { + if ( UM()->config()->permalinks['user'] == $post->ID ) { /** * UM hook @@ -109,13 +108,13 @@ function um_get_canonical_url( $canonical_url, $post ){ * } * ?> */ - $enable_canonical = apply_filters( "um_allow_canonical__filter", true ); + $enable_canonical = apply_filters( 'um_allow_canonical__filter', true ); - if( $enable_canonical ){ + if ( $enable_canonical ) { $url = um_user_profile_url( um_get_requested_user() ); - $canonical_url = $url === home_url( $_SERVER['REQUEST_URI'] ) ? false : $url; + $canonical_url = ( $url === home_url( $_SERVER['REQUEST_URI'] ) ) ? false : $url; - if ( $page = get_query_var('cpage') ){ + if ( $page = get_query_var( 'cpage' ) ) { $canonical_url = get_comments_pagenum_link( $page ); } } diff --git a/readme.txt b/readme.txt index 4843b130..6fffc7b3 100644 --- a/readme.txt +++ b/readme.txt @@ -151,6 +151,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat - Fixed password reset/change form when other forms are initialized at the same page - Fixed getting extension updates on multisites - Fixed the 'wp_authenticate_user' filter's variables (changed username string to WP_User object) + - Fixed SEO link canonical for the profile page - Deprecated JS event 'um_before_modal_removed', use wp.hooks action 'um_before_modal_removed' instead = 2.1.6: June 1, 2020 =