Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save amirhmoradi/ff63c374af84f591b19126e0c08d75b3 to your computer and use it in GitHub Desktop.
Save amirhmoradi/ff63c374af84f591b19126e0c08d75b3 to your computer and use it in GitHub Desktop.
Wordpress Woocommerce Force custom page/post ID as Terms and Conditions page
/**
* This allows you to use a custom page (custom post type) as your WooCommerce "Terms and Conditions" page.
* Once set, you wont need to select the page in Woocommerce settings.
**/
function amirhmoradi_force_terms_page_to_wc($page_id)
{
return 207;
}
add_filter('woocommerce_get_terms_page_id', 'amirhmoradi_force_terms_page_to_wc', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment