Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Term select field improvements #2801

Merged
merged 4 commits into from
Apr 16, 2024
Merged

Conversation

Gnodesign
Copy link
Collaborator

Changes Proposed in this Pull Request

This enhancement will enhance and broaden the current functionality of the term-select-field.php. Presently, the term-select field operates in a manner where it does not allow for the display of a default placeholder; instead, it defaults to displaying '-'. Unfortunately, there is currently no method to alter this default behavior.

With the changes added to the template, the select field will show the field's placeholder as a default option.

Testing Instructions

  • Add a new taxonomy
  • Add the field to the submission form
frontend_wpjm_fields( $fields ) {
	$fields['job']['job_listing_qualification'] = [
		'label'       => esc_html__( 'Job Qualification', 'cariera' ),
		'type'        => 'term-multiselect',
		'taxonomy'    => 'job_listing_qualification',
		'required'    => false,
		'placeholder' => esc_html__( 'Choose a job qualification', 'cariera' ),
		'priority'    => 7,
	];

        return $fields;
}
add_filter( 'submit_job_form_fields', 'frontend_wpjm_extra_fields' );
  • Check the field in the job submission form

New or Updated Hooks and Templates

  • Updated template: templates/form-fields/term-select-field.php

Screenshot / Video

Before:
Screenshot 2024-04-05 at 6 31 50 PM

After:
Screenshot 2024-04-05 at 6 32 37 PM

@yscik yscik self-requested a review April 16, 2024 10:34
Copy link
Contributor

@yscik yscik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the PR!

@yscik yscik merged commit 1fcc71f into Automattic:trunk Apr 16, 2024
11 checks passed
@yscik yscik added this to the 2.3.0 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants