Thanks Brad...it still a no go. I'll keep hacking away at this.
// Add a WP Editor to the Paragraph Text field
add_action( 'gform_field_content', 'gform_html_editor', 10, 5 );
function gform_html_editor( $content, $field, $value, $lead_id, $form_id ) {
// HTML & textarea?
if( ( 'textarea' == $field['post_custom_field'] ) && ( 'gf_html' == $field['cssClass'] ) ) {
// Start output buffering
ob_start();
// Create a wp_editor
$settings = array(
'teeny' => true
);
wp_editor( $value, "input_{$field['id']}", $settings );
// Replace the textarea with the editor
$start_textarea = strpos( $content, '<textarea' );
$end_textarea = strpos( $content, 'textarea>' ) + 9;
$content = str_replace(
substr( $content, $start_textarea, $end_textarea - $start_textarea ),
ob_get_contents(),
$content
);
// End output buffering
ob_end_clean();
}
return $content;
}
Posted 12 years ago on Monday April 9, 2012 |
Permalink