Created
April 26, 2022 14:54
-
-
Save amirhmoradi/2e44c2567936543f0f72e36e1485f338 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This allows you to select custom pages types (in this example, post_type of 'legal') as your Wordpress's "Privacy Policy page" | |
* from Wordpress Admin > Settings > Privacy | |
**/ | |
function amirhmoradi_add_legal_pages_to_get_pages($pages, $parsed_args) | |
{ | |
$legal_pages = get_posts(array( | |
'post_type' => 'legal' | |
)); | |
return array_merge($pages,$legal_pages); | |
} | |
add_filter('get_pages', 'amirhmoradi_add_legal_pages_to_get_pages', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment