aioseo_canonical_url

aioseo_canonical_url

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: all-in-one-seo-pack.4.8.1.1

apply_filters('aioseo_canonical_url') is found 3 times:

  • /app/Common/Traits/Helpers/WpUri.php line 102
    098
    099
    100
    101
    102
    103
    104
    105
    106
    107
    108
        return $url[ $hash ];
    }
     
    if ( is_404() || is_search() ) {
        $url[ $hash ] = apply_filters( 'aioseo_canonical_url', '' );
     
        return $url[ $hash ];
    }
     
    $metaData = [];
    $post     = $this->getPost();
  • /app/Common/Traits/Helpers/WpUri.php line 130
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
        }
    }
     
    if ( $metaData && ! empty( $metaData->canonical_url ) ) {
        $url[ $hash ] = apply_filters( 'aioseo_canonical_url', $this->makeUrlAbsolute( $metaData->canonical_url ) );
     
        return $url[ $hash ];
    }
     
    if ( BuddyPressIntegration::isComponentPage() ) {
        $url[ $hash ] = aioseo()->standalone->buddyPress->component->getMeta( 'canonical' );
  • /app/Common/Traits/Helpers/WpUri.php line 176
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
            $url[ $hash ] = preg_replace( '/\/amp$/', '', (string) $url[ $hash ] );
            $url[ $hash ] = preg_replace( '/\/amp\/$/', '/', (string) $url[ $hash ] );
        }
     
        $url[ $hash ] = apply_filters( 'aioseo_canonical_url', $url[ $hash ] );
     
        return $url[ $hash ];
    }
     
    /**
     * Formats a given URL as an absolute URL if it is relative.

See this hook used in plugins: