我需要设置1个cookie,保存从表单发送的数据。
我看到我必须将setcookie()挂接到“init”。没关系。
add_action( \'init\', \'cookie_function\');
我的“cookie\\u函数”将包含$cookieName、$cookieValue、$time、COOKIEPATH、COOKIEDOMAIN。如果我需要setcookie(\'test\',$\\u POST[\'test\')之类的东西,我该怎么称呼:
cookie_function() //and where do I pass parameters?
或setcookie() //and this function will be related to my cookie_function()?