/** * Load various assets needed by the toolset-forms blob. * * @since 1.9 */ private function add_toolset_forms_support() { // JS and CSS assets related to fields - mostly generic ones. wpcf_edit_post_screen_scripts(); // Needed for fields that have something to do with files WPToolset_Field_File::file_enqueue_scripts(); // Extra enqueuing of media assets needed since WPToolset_Field_File doesn't know about termmeta. wp_enqueue_media(); // We need to append form-specific data for the JS validation script. add_action('admin_footer', array($this, 'render_js_validation_data')); // Pretend we're about to create new form via toolset-forms, even if we're not going to. // This will load some assets needed for image field preview (specifically the 'wptoolset-forms-admin' style). // Hacky, but better than re-registering the toolset-forms stylesheet elsewhere. $faux_form_bootstrap = new WPToolset_Forms_Bootstrap(); $faux_form_bootstrap->form('faux'); $asset_manager = Types_Asset_Manager::get_instance(); // Enqueue the main page script $asset_manager->register_script(self::PAGE_SCRIPT_NAME, TYPES_RELPATH . '/public/page/add_term.js', array('jquery', 'toolset-utils'), TYPES_VERSION, true); $asset_manager->enqueue_scripts(self::PAGE_SCRIPT_NAME); }
/** * Load various assets needed by the toolset-forms blob. * * @since 1.9 */ private function add_toolset_forms_support() { // JS and CSS assets related to fields - mostly generic ones. wpcf_edit_post_screen_scripts(); // Needed for fields that have something to do with files WPToolset_Field_File::file_enqueue_scripts(); // Extra enqueuing of media assets needed since WPToolset_Field_File doesn't know about termmeta. wp_enqueue_media(); // We need to append form-specific data for the JS validation script. add_action('admin_footer', array($this, 'render_js_validation_data')); // Pretend we're about to create new form via toolset-forms, even if we're not going to. // This will load some assets needed for image field preview (specifically the 'wptoolset-forms-admin' style). // Hacky, but better than re-registering the toolset-forms stylesheet elsewhere. $faux_form_bootstrap = new WPToolset_Forms_Bootstrap(); $faux_form_bootstrap->form('faux'); }