本文整理匯總了PHP中GFFormDisplay::get_embedded_forms方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFFormDisplay::get_embedded_forms方法的具體用法?PHP GFFormDisplay::get_embedded_forms怎麽用?PHP GFFormDisplay::get_embedded_forms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFFormDisplay
的用法示例。
在下文中一共展示了GFFormDisplay::get_embedded_forms方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: gform_do_shortcode
public static function gform_do_shortcode($content)
{
$is_ajax = false;
$forms = GFFormDisplay::get_embedded_forms($content, $is_ajax);
foreach ($forms as $form) {
GFFormDisplay::print_form_scripts($form, $is_ajax);
}
return do_shortcode($content);
}
示例2: gform_do_shortcode
public static function gform_do_shortcode($content)
{
$is_ajax = false;
$forms = GFFormDisplay::get_embedded_forms($content, $is_ajax);
foreach ($forms as $form) {
/**
* Determine if scripts and stylesheets should be printed or enqueued when processing form shortcodes after headers have been sent.
*
* @since 2.0
*
* @param bool $disable_print_form_script Defaults to false.
* @param array $form The form object for the shortcode being processed.
* @param bool $is_ajax Indicates if ajax was enabled on the shortcode.
*/
$disable_print_form_script = apply_filters('gform_disable_print_form_scripts', false, $form, $is_ajax);
if (headers_sent() && !$disable_print_form_script) {
GFFormDisplay::print_form_scripts($form, $is_ajax);
} else {
GFFormDisplay::enqueue_form_scripts($form, $is_ajax);
}
}
return do_shortcode($content);
}