Example #1
0
 public function metaform()
 {
     $validation = $this->getValidationData();
     $validation = self::addTypeValidation($validation);
     $this->setValidationData($validation);
     return parent::metaform();
 }
Example #2
0
 public static function mediaPopup()
 {
     WPToolset_Field_File::file_enqueue_scripts();
     // Add types button
     add_filter('attachment_fields_to_edit', array('WPToolset_Field_File', 'attachmentFieldsToEditFilter'), 9999, 2);
     // Filter media TABs
     add_filter('media_upload_tabs', array('WPToolset_Field_File', 'mediaUploadTabsFilter'));
     // Add head data
     add_filter('admin_head', array('WPToolset_Field_File', 'mediaPopupHead'));
 }
Example #3
0
 public function init()
 {
     WPToolset_Field_File::file_enqueue_scripts();
     $this->set_placeholder_as_attribute();
 }
 /**
  * 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'));
 }
 /**
  * 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');
 }