WPIntell

Source evidence

WP Function returns wrong results

WP PHP Console · support · 2020-07-12T12:11:00+00:00

mixedsentiment
mediumseverity
0.67relevance
1replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 35 rows with source links

17.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
meksONE resolved
Hi, i’ve used this plugin some time ago without problems; now I need it again but I’ve noticed a strange behavior… even on a fresh WP without plugins, if I run a simple test like this: $test = is_home(); return $test; on the homepage, it returns FALSE. I’m missing something? Where I’m wrong? Thanks! This topic was modified 5 years, 10 months ago by meksONE . is_home() is returning correctly false because you are not on the homepage, the WP_Query object it is tied to understands that. You are calling this function from the console context, and it cannot be used in this way. Functions that depend on some WordPress states or globals, will not behave as if you were inside the WordPress loop. This reply was modified 5 years, 10 months ago by Fulvio Notarstefano .

Comments

1 shown
Fulvio Notarstefano 2020-07-28T21:29:00+00:00

is_home() is returning correctly false because you are not on the homepage, the WP_Query object it is tied to understands that. You are calling this function from the console context, and it cannot be used in this way. Functions that depend on some WordPress states or globals, will not behave as if you were inside the WordPress loop. This reply was modified 5 years, 10 months ago by Fulvio Notarstefano .