wc_get_page_permalink()
Retrieve page permalink.
Hooks from the function
Returns
String.
Usage
wc_get_page_permalink( $page, $fallback );
- $page(string) (required)
- page slug.
- $fallback(string|true|false)
- Fallback URL if page is not set. @since 3.4.0.
Default:home URL
wc_get_page_permalink() wc get page permalink code WC 10.5.0
function wc_get_page_permalink( $page, $fallback = null ) {
$page_id = wc_get_page_id( $page );
$permalink = 0 < $page_id ? get_permalink( $page_id ) : '';
if ( ! $permalink ) {
$permalink = is_null( $fallback ) ? get_home_url() : $fallback;
}
return apply_filters( 'woocommerce_get_' . $page . '_page_permalink', $permalink );
}