本文整理匯總了PHP中GFFormDisplay::print_form_scripts方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFFormDisplay::print_form_scripts方法的具體用法?PHP GFFormDisplay::print_form_scripts怎麽用?PHP GFFormDisplay::print_form_scripts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFFormDisplay
的用法示例。
在下文中一共展示了GFFormDisplay::print_form_scripts方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: print_form_scripts
public static function print_form_scripts($form, $ajax)
{
require_once GFCommon::get_base_path() . '/form_display.php';
GFFormDisplay::print_form_scripts($form, $ajax);
}
示例2: esc_html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php
echo esc_html($form['title']);
?>
</title>
<style type="text/css">
body {
padding: 0;
font-family: sans-serif;
font-size: 13px;
}
</style>
</head>
<body>
<?php
GFFormDisplay::print_form_scripts($form_id, false);
// ajax = false
gravity_form($form_id, $display_title, $display_description);
wp_footer();
?>
</body>
</html>
示例3: 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);
}
示例4: 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);
}