コード例 #1
0
 private function get_group_custom_field_belongs_to($field, $tm_instance)
 {
     $group = '';
     if ($tm_instance) {
         $unfiltered_type = WPML_TM_Field_Type_Sanitizer::sanitize($field);
         $settings = new WPML_Custom_Field_Editor_Settings($unfiltered_type, $tm_instance);
         $group = $settings->get_group();
     }
     return $group;
 }
コード例 #2
0
 /**
  * Applies filters to a custom field job element.
  * Custom fields that were named with numeric suffixes are stripped of these suffixes.
  *
  * @param object $element
  *
  * @return array
  */
 private function custom_field_data($element)
 {
     $unfiltered_type = WPML_TM_Field_Type_Sanitizer::sanitize($element->field_type);
     $element_field_type = $unfiltered_type;
     /**
      * @deprecated Use `wpml_editor_custom_field_name` filter instead
      * @since 3.2
      */
     $element_field_type = apply_filters('icl_editor_cf_name', $element_field_type);
     $element_field_type = apply_filters('wpml_editor_custom_field_name', $element_field_type);
     $element_field_style = 0;
     /**
      * @deprecated Use `wpml_editor_custom_field_style` filter instead
      * @since 3.2
      */
     $element_field_style = apply_filters('icl_editor_cf_style', $element_field_style, $unfiltered_type);
     $element_field_style = apply_filters('wpml_editor_custom_field_style', $element_field_style, $unfiltered_type);
     $element = apply_filters('wpml_editor_cf_to_display', $element, $this->job_instance);
     $settings = new WPML_Custom_Field_Editor_Settings($unfiltered_type, $this->tm_instance);
     $element_field_type = $settings->filter_name($element_field_type);
     $element_field_style = $settings->filter_style($element_field_style);
     return array($element_field_type, $element_field_style, $element);
 }