If you want the writter to be able to contribute the form title you can create a custom field on the g form via:
add_action("gform_properties_settings", "form_properties", 10, 2);
function form_properties($position, $form_id) {
if($position == 100) { ?>
<li class="field_form_title_li field_setting">
<label for="field_form_title">
<?php _e("Form Title", "gravityforms"); ?>
</label>
<input type="text" id="field_form_title" class="fieldwidth-3" onkeyup="SetFormProperty('formTitle', this.value);" size="35"/>
<?php
}
}
add_action("gform_editor_js", "editor_script");
function editor_script(){
<script>
function SetFormProperty(name, value) {
form[name] = value;
}
jQuery(document).bind("gform_load_form_settings", function(event, field) {
if(jQuery("label[for='form_title_input']")) {
jQuery("label[for='form_title_input']").html('Form Name')
}
if(typeof form.formTitle !== "undefined") {
if(form.formTitle != "") {
jQuery("#field_form_title").val(form.formTitle);
}
}
});
</script>
}
add_filter("gform_pre_render", "pre_render_function");
function pre_render_function( $form ) {
if(isset($form['title'])) {
$form['title'] = $form['formTitle'];
} else {
$form['title'] = '';
}
}
Posted 11 years ago on Wednesday November 28, 2012 |
Permalink