norcross / gravity-tooltips

Adds a custom field to each form element for tooltips
MIT License
74 stars 20 forks source link

No tooltip with ajax upload plug in #38

Closed soulexx closed 7 years ago

soulexx commented 7 years ago

I have an extra plug in called ajax upload. It install a new upload field and this field doesn´t have the tooltip box to write something inside. When I installed your old version of the plugin it was working also with this new upload field because there you took the description field to generate the tooltip content.

Is it possible to use your plugin also with ajax upload plugin

Or better to use the description as a tooltip?

Thanks for your answer

norcross commented 7 years ago

can you link to the plugin you're using? a new field would need to be registered in the tooltips plugin.

soulexx commented 7 years ago

https://de.wordpress.org/plugins/ajax-upload-for-gravity-forms/

norcross commented 7 years ago

You need to add the field type (in this case, the name is itsg_single_ajax ) using the gf_tooltips_allowed_fields filter, like so:

function rkv_add_new_field_type( $fields ) {

    if ( ! in_array( 'itsg_single_ajax', $fields ) ) {
        $fields[] = 'itsg_single_ajax';
    }

    return $fields;
}

add_filter( 'gf_tooltips_allowed_fields', 'rkv_add_new_field_type' );

this will add the setting for tooltip content. use this code in your theme or functionality plugin (not the actual gf-tooltips code)