本文整理匯總了PHP中NewsletterModule::save_options方法的典型用法代碼示例。如果您正苦於以下問題:PHP NewsletterModule::save_options方法的具體用法?PHP NewsletterModule::save_options怎麽用?PHP NewsletterModule::save_options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NewsletterModule
的用法示例。
在下文中一共展示了NewsletterModule::save_options方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
/**
* This method has been redefined for compatibility with the old options naming. It would
* be better to change them instead. The subscription options should be named
* "newsletter_subscription" while the form field options, actually named
* "newsletter_profile", should be renamed "newsletter_subscription_profile" (since
* they are retrived with get_options('profile')) or "newsletter_subscription_fields" or
* "newsletter_subscription_form".
*
* @param array $options
* @param string $sub
*/
function save_options($options, $sub = '')
{
if ($sub == '') {
// For compatibility the options are wrongly named
return update_option('newsletter', $options);
}
if ($sub == 'profile') {
return update_option('newsletter_profile', $options);
}
return parent::save_options($sub);
}