Last active
February 22, 2018 07:56
-
-
Save New0/1d482360cd70966921868fa895315e83 to your computer and use it in GitHub Desktop.
Var dump the value of a post meta data
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 | |
| add_filter('the_content', function( $content ) { | |
| //Replace 1 with the page ID you want to test in and the custom_field_name with your own | |
| $page_id = '1'; | |
| $key = 'custom_field_name'; | |
| if( is_page( $page_id ) ) { | |
| var_dump( get_post_meta( $page_id, $key) ); | |
| } | |
| return $content; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment