[Bug] has_assigned_parent incorrectly returns true
-
The has_assigned_parent function returns true for types that are assigned to “None”.
The option array is
Array ( [parent-post] => [parent-page] => [parent-attachment] => )
however, the check
if (! isset( $this->options[ 'parent-' . $post_type ] ) || 'none' == $this->options[ 'parent-' . $post_type ]) { return false; }
won’t ever pass as isset returns true for an empty value, and the value isn’t set to None on the option page.
I think the check should be reversed, to only return true if the conditions are met (the statement seems backwards IMHO).
I’ve put
empty($this->options[ 'parent-' . $post_type ])
after line 272 of custom-post-type-parents.php to temporarily correct this.
- The topic ‘[Bug] has_assigned_parent incorrectly returns true’ is closed to new replies.