Hello, I'm attempting to use Formidable's API hooks to add custom functionality. Alot of the hooks I try to use never fire. Can you let me know what I might be doing wrong here?
An example; I've enabled Formidable Lite and Formidable Pro and entered our License key. In our theme's functions.php I've put the following code:
function modify_my_post( $post, $args ) {
error_log( 'frm_new_post FIRED' );
return $post;
}
add_filter( 'frm_new_post', 'modify_my_post', 10, 2 );
Then I go to add and save a new Formidible form on this page mywebsite.com/wp-admin/admin.php?page=formidable&frm_action=edit&id=139.
My debug.log file never shows the hook executed. I'm finding that many of Formidable's hooks are not firing. For example, check_user_edit_form, frm_pre_update_entry, frm_allow_delete.
Can you please inform us why these hooks do not fire please
frm_new_post is used to edit a post before it is created when the create post add-on is activated to create a CPT/post/page from your Formidable entry. This is a Pro filter that fires at line 156 in /formidable-pro/classes/models/FrmProPost.php
check_user_edit_form is not a Formidable filter. frm_user_can_edit is the filter and forces a form to be editable regardless of a user's login status. This is a Pro filter that fires at line 94 in /formidable-pro/classes/helpers/FrmProEntriesHelper.php.
frm_pre_update_entry fires before a form entry is updated while editing the record. This filter is fires in multiple places in both Formidable forms and Formidable Pro. You can find the source code at line 939 in /formidable/classes/models/FrmEntry.php. In Pro, this filter behaves differently. The is no corresponding apply_filters in Pro. In Pro, this filter processes data through Pro functions.
frm_allow_delete can customize when an entry can be deleted. The Formidable Knowledge base has no further details about using this filter, so you'd have to examine Formidable's source code to understand it's function. You can find the source code for this filter at line 238 in /formidable-pro/classes/helpers/FrmProEntriesHelper.php.
All of these filters fire.
Please login or Register to submit your answer