本文整理汇总了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);
}