Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wc_get_page_id compatability return type #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnolek
Copy link

What?

This updates the compatibility version of wc_get_page_id to always return an integer to match the behavior of WC core. The current behavior of returning a string could cause issues with themes/plugins that are expecting an integer value.

Tickets / Documentation

The WooCommerce core version of wc_get_page_id always returns an integer
and not a string. See here:

https://github.com/woocommerce/woocommerce/blob/9c83a07145ea5c451adc489f21eeaf895825b683/plugins/woocommerce/includes/wc-page-functions.php#L36-L57

Ensuring that this compatibility version of the function also returns an integer could prevent 
subtle issues with themes or plugins that expect `wc_get_page_id` to always return an 
integer. 

In WC core a return value of -1 means the page was not found, which seems to match the
desired behavior here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant