8889841cwp-content/plugins/wp-job-board-pro/libraries/cmb2/cmb2_field_tags/cmb2-field-type-tags.php000064400000002766150516176250032664 0ustar00home/clixcotz/gj.clix.co.tzargs( 'default' ); echo $field_type_object->input( array( 'type' => 'text', 'name' => $field->args( '_name' ), 'value' => $value, ) ); } public static function sanitize_map( $override_value, $value, $object_id, $field_args ) { if ( is_array( $value ) ) { $tags = array_map( 'absint', $value ); } else { $raw_tags = array_filter( array_map( 'sanitize_text_field', explode( ',', $value ) ) ); $tags = array(); foreach ( $raw_tags as $tag ) { $tags[] = self::format_job_tag( $tag ); } } if ( ! empty( $tags ) ) { wp_set_object_terms( $object_id, $tags, $field_args['taxonomy'], false ); } return $value; } public static function format_job_tag( $tag ) { if ( strlen( $tag ) <= 3 ) { $tag = strtoupper( $tag ); } else { $tag = strtolower( $tag ); } return $tag; } } WP_Job_Board_Pro_CMB2_Field_Tags::init();