pwkip / contact-form-7-conditional-fields

Wordpress Plugin: Contact Form 7 Conditional Fields
http://bdwm.be/wpcf7cf
22 stars 18 forks source link

fix missing admin UI in Smart Grid Editor #95

Closed aurovrata closed 2 years ago

aurovrata commented 2 years ago

The Smart Grid relies on WP core post.php to edit wpcf7_contact_form custom posts as forms.

The Conditional plugin added additional checks for CF7 custom admin page editor which results in the scripts not loading for the Smart Grid enabled setup.

The Smart Grid fires a plugin-friendly cf7sg_enqueue_admin_editor_scripts action hook for plugins to queue their resources on the form editor page.

The fix delegates the script enqueue process to a new function wpcf7cf_admin_enqueue_form_edit_scripts() that is called instead by the conditional cf7 page validation, as well as being hooked to the Smart Grid's action. A simple solution that allows both scenarios to function.