本文整理汇总了PHP中FrmFieldsHelper::dynamic_default_values方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmFieldsHelper::dynamic_default_values方法的具体用法?PHP FrmFieldsHelper::dynamic_default_values怎么用?PHP FrmFieldsHelper::dynamic_default_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmFieldsHelper
的用法示例。
在下文中一共展示了FrmFieldsHelper::dynamic_default_values方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replace_shortcodes
public static function replace_shortcodes($html, $form, $title = false, $description = false, $values = array())
{
foreach (array('form_name' => $title, 'form_description' => $description, 'entry_key' => true) as $code => $show) {
if ($code == 'form_name') {
$replace_with = $form->name;
} else {
if ($code == 'form_description') {
$replace_with = FrmAppHelper::use_wpautop($form->description);
} else {
if ($code == 'entry_key' && isset($_GET) && isset($_GET['entry'])) {
$replace_with = FrmAppHelper::simple_get('entry');
} else {
$replace_with = '';
}
}
}
FrmFieldsHelper::remove_inline_conditions(FrmAppHelper::is_true($show) && $replace_with != '', $code, $replace_with, $html);
}
//replace [form_key]
$html = str_replace('[form_key]', $form->form_key, $html);
//replace [frmurl]
$html = str_replace('[frmurl]', FrmFieldsHelper::dynamic_default_values('frmurl'), $html);
if (strpos($html, '[button_label]')) {
add_filter('frm_submit_button', 'FrmFormsHelper::submit_button_label', 1);
$replace_with = apply_filters('frm_submit_button', $title, $form);
$html = str_replace('[button_label]', $replace_with, $html);
}
$html = apply_filters('frm_form_replace_shortcodes', $html, $form, $values);
if (strpos($html, '[if back_button]')) {
$html = preg_replace('/(\\[if\\s+back_button\\])(.*?)(\\[\\/if\\s+back_button\\])/mis', '', $html);
}
if (strpos($html, '[if save_draft]')) {
$html = preg_replace('/(\\[if\\s+save_draft\\])(.*?)(\\[\\/if\\s+save_draft\\])/mis', '', $html);
}
if (apply_filters('frm_do_html_shortcodes', true)) {
$html = do_shortcode($html);
}
return $html;
}
示例2: do_get_shortcode
/**
* @since 2.0.8
*/
private static function do_get_shortcode($args)
{
// reverse compatability for [get-param] shortcode
if (strpos($args['matches'][0][$args['match_key']], '[get-') === 0) {
$val = $args['matches'][0][$args['match_key']];
$param = str_replace('[get-', '', $val);
if (preg_match('/\\[/s', $param)) {
$val .= ']';
} else {
$param = trim($param, ']');
//only if is doesn't create an imbalanced []
}
$new_value = FrmFieldsHelper::process_get_shortcode(compact('param'), $args['allow_array']);
} else {
$atts = $args['shortcode_atts'];
$atts['prev_val'] = $args['prev_val'];
$new_value = FrmFieldsHelper::dynamic_default_values($args['shortcode'], $atts, $args['allow_array']);
}
return $new_value;
}