Opened 10 years ago
Closed 10 years ago
#32267 closed defect (bug) (duplicate)
is_page function return true even if it gets 0 as an argument
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.2.1 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
I think the is_page function should return false if 0 or false is passed.
I will try to explain why I faced problem because of this.
I used Product Vendor Plugin, it stores the vendor page id in "options". If it's not set, it returns 0.
Then the if condition satisfies because is_page( 0 ) returns true and then next line gets executed which redirects user to myaccount page (We didn't want this).
I corrected this problem in the plugin by different way. But I think that is_page should never return true if it gets 0 in parameter.
So if someone passes pageid = 0, then returning true implies page with id=0 is WordPress page. Let me know your thoughts.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Duplicate of #31723.