Created
September 28, 2018 09:24
-
-
Save morgyface/627cb9159e71604b69446fb4e8360448 to your computer and use it in GitHub Desktop.
WordPress | Privacy page option
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
| <?php | |
| $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); | |
| if ( ! empty( $privacy_policy_page_id ) ) { | |
| $privacy_policy_page_url = get_the_permalink( $privacy_policy_page_id ); | |
| ?> | |
| <a href="<?php echo $privacy_policy_page_url; ?>">Privacy Policy</a> | |
| <?php } ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WordPress Privacy Policy page option
You are now able to use an included privacy page or set your own via dashboard > settings > privacy.
To get the ID of the page selected use
get_option( 'wp_page_for_privacy_policy' ).Not much out there in the documentation so I thought this might be of use.