Last active
January 23, 2016 19:50
-
-
Save jrobinsonc/e6098d90453d58f31793 to your computer and use it in GitHub Desktop.
Wordpress helper: is_parent
This file contains 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 | |
/** | |
* is_parent | |
* | |
* @author JoseRobinson.com | |
* @link https://gist.github.com/jrobinsonc/e6098d90453d58f31793 | |
* @param int $pid | |
* @return bool | |
*/ | |
function is_parent($pid) | |
{ | |
global $post; | |
return (is_page() && ($post->post_parent == $pid || is_page($pid))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment