Test #1
Test #2
If we want to use the core defined COOKIEHASH
constant, then it's too early to hook into muplugins_loaded
. We might therefore try the registered_taxonomy
hook, but I haven't tested it yet:
add_action( 'registered_taxonomy', function()
{
if( ! did_action( 'registered_taxonomy' ) && function_exists( 'wpse_cookie_constants' ) )
wpse_cookie_constants();
});
function wpse_cookie_constants()
{
if( ! defined( 'COOKIEHASH' ) )
return;
define( 'USER_COOKIE', 'wpse_user_' . COOKIEHASH );
define( 'PASS_COOKIE', 'wpse_pass_' . COOKIEHASH );
define( 'AUTH_COOKIE', 'wpse_' . COOKIEHASH );
define( 'SECURE_AUTH_COOKIE', 'wpse_sec_' . COOKIEHASH );
define( 'LOGGED_IN_COOKIE', 'wpse_logged_in_' . COOKIEHASH );
define( 'TEST_COOKIE', 'wpse_test_cookie' );
}