WordPress.org

Ready to get started?Download WordPress

Forums

Is Page or Ancestor
$post->ancestors was always blank, so always returned false (1 post)

  1. James Revillini
    Member
    Posted 2 years ago #

    I'm not sure what the cause was for your plugin to suddenly stop working on my site, but I wanted to relay the fix that worked for me. I replaced your conditional with if ( is_page( $page ) || ( in_array( $page, get_ancestors($post->ID, $post->post_type) ) ) )

    Some other plugin must be the cause, but I reviewed all my plugin updates of late and scoured the code for hours trying to see what might mess with the ancestors array. Even calling get_post_ancestors($post) did not work.

    http://wordpress.org/extend/plugins/is-page-or-ancestor/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by James Revillini
  • This topic is not resolved
  • WordPress version: 3.3.1