Last active
February 16, 2022 10:49
-
-
Save tripflex/602d419f061114ef5cb3a4c538777bed to your computer and use it in GitHub Desktop.
Output dropdown in Job Filters/Search page for job_location (when configured as dropdown type) for WP Job Manager Field Editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$job_locations = get_custom_field_config( 'job_location', 'options' ); | |
if ( is_array( $job_locations ) ): | |
?> | |
<select class="" name="search_location" id="search_location"> | |
<option value="" <?php selected( empty( $location ) || ! in_array( $location, $job_locations ) ); ?>><?php _e( 'Any Location' ); ?></option> | |
<?php foreach( $job_locations as $loc_val => $loc_label ): ?> | |
<option value="<?php echo esc_attr( $loc_val ); ?>" <?php selected( $location, $loc_val ); ?>><?php echo esc_attr( $loc_label ); ?></option> | |
<?php endforeach; ?> | |
</select> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently this does not work any more.
Does anybody have a solution for the current version of WP Job Manager?