本文整理匯總了PHP中FrmField::is_option_value_in_object方法的典型用法代碼示例。如果您正苦於以下問題:PHP FrmField::is_option_value_in_object方法的具體用法?PHP FrmField::is_option_value_in_object怎麽用?PHP FrmField::is_option_value_in_object使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FrmField
的用法示例。
在下文中一共展示了FrmField::is_option_value_in_object方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_default_value
public static function get_default_value($value, $field, $dynamic_default = true, $allow_array = false)
{
if (is_array(maybe_unserialize($value))) {
if (FrmAppHelper::is_empty_value($value) || count(array_filter($value)) === 0) {
$value = '';
} else {
return $value;
}
}
$prev_val = '';
if ($field && $dynamic_default) {
if (FrmField::is_option_value_in_object($field, 'dyn_default_value')) {
$prev_val = $value;
$value = $field->field_options['dyn_default_value'];
}
}
$matches = self::get_shortcodes_from_string($value);
if (!isset($matches[0])) {
return do_shortcode($value);
}
$args = array('matches' => $matches, 'allow_array' => $allow_array, 'field' => $field, 'prev_val' => $prev_val);
foreach ($matches[1] as $match_key => $shortcode) {
$args['shortcode'] = $shortcode;
$args['match_key'] = $match_key;
self::replace_shortcode_in_string($value, $args);
}
unset($matches);
self::replace_field_id_shortcodes($value, $allow_array);
self::do_shortcode($value, $allow_array);
self::maybe_force_array($value, $field, $allow_array);
return $value;
}
示例2: migrate_to_30
/**
* Remove form_select from all non-repeating sections
*/
private static function migrate_to_30()
{
// Get all section fields
$dividers = FrmField::getAll(array('fi.type' => 'divider'));
// Remove form_select for non-repeating sections
foreach ($dividers as $d) {
if (FrmField::is_repeating_field($d)) {
continue;
}
if (FrmField::is_option_value_in_object($d, 'form_select')) {
$d->field_options['form_select'] = '';
FrmField::update($d->id, array('field_options' => maybe_serialize($d->field_options)));
}
}
}