HOST_TYPE_MAIN
HOST_TYPE_MAIN ='main'
nip.io
Utility helpers.
getPermalink(\WP_Post|\DevOwl\RealCookieBanner\number $post): string|false
Always create a clone of the post cause we need to force the `post_status` to get the valid permalink.
This also returns a valid permalink even for trashed or draft posts.
\WP_Post|\DevOwl\RealCookieBanner\number | $post |
setCookie(string $name,string $value = '',integer $expire,string $path = '',string $domain = '',boolean $secure = false,boolean $httponly = false,string $samesite = '')
Support samesite cookie flag in both php 7.2 (current production) and php >= 7.3 (when we get there) From: https://github.com/GoogleChromeLabs/samesite-examples/blob/master/php.md and https://stackoverflow.com/a/46971326/2308553
string | $name | |
string | $value | |
integer | $expire | |
string | $path | |
string | $domain | |
boolean | $secure | |
boolean | $httponly | |
string | $samesite |
isRest()
Checks if the current request is a WP REST API request.
Case #1: After WP_REST_Request initialisation Case #2: Support "plain" permalink settings Case #3: It can happen that WP_Rewrite is not yet initialized, so do this (wp-settings.php) Case #4: URL Path begins with wp-json/ (your REST prefix) Also supports WP installations in subfolders