Howdy!
The constant accepts true or an array with specifics; it does not accept false or any other data type: anything that isn’t the specific array is read as true. So, if you wish to disable it, it’s best to leave the constant undefined. Please see https://tsf.fyi/kb/headless. Here’s the source.
We should not add a defense clause for everything developers could push through our API; every clause makes a function up to 17% slower. We would also need to write out why a developer is “doing it wrong”, considering every error one could make. Still, we didn’t create a programming language, only a framework for SEO. So, instead, we expect exclusively what we lay out in our documentation. You can read my reasoning in vast detail within this ticket: https://core.trac.ww.wp.xz.cn/ticket/49628#comment:23.
Thread Starter
PD
(@peterdowney01)
Thank you for your reply.
I supposed I just read your site wrong when I originally found this setting. I entered the value based on this description on your site:
Different modes
The constant THE_SEO_FRAMEWORK_HEADLESS accepts boolean values (true/false) as well as array values.
To me, reading that that suggests false is a valid option. I understand now that it isn’t, but specifically saying in your help text that it accepts this type of value and then listing one it doesn’t accept can be confusing to read.
Ah! I am entirely to blame for spreading conflicting information. Sorry about that.
I have adjusted the KB entry to reflect the code’s intention more accurately.