wc_get_page_permalink should check page_id was found

This commit is contained in:
Mike Jolley 2015-07-13 10:59:34 +01:00
parent 7a5f18fbc8
commit ef89f82014
1 changed files with 2 additions and 2 deletions

View File

@ -64,8 +64,8 @@ function wc_get_page_id( $page ) {
* @return string
*/
function wc_get_page_permalink( $page ) {
$permalink = get_permalink( wc_get_page_id( $page ) );
$page_id = wc_get_page_id( $page );
$permalink = $page_id ? get_permalink( $page_id ) : '';
return apply_filters( 'woocommerce_get_' . $page . '_page_permalink', $permalink );
}