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

Make new meta fields searchable #2

Open
iamgabrielma opened this issue Sep 9, 2018 · 0 comments
Open

Make new meta fields searchable #2

iamgabrielma opened this issue Sep 9, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@iamgabrielma
Copy link
Owner

iamgabrielma commented Sep 9, 2018

The plugin introduces two new meta fields: _job_salary and _job_important_info , which are not searchable by default.

There seems to be a filter here: https://github.com/Automattic/WP-Job-Manager/blob/914f790050a7069a2bf7db9d5b91480d6bd256be/wp-job-manager-functions.php#L262 for:

			'_job_location',
			'_company_name',
			'_application',
			'_company_name',
			'_company_tagline',
			'_company_website',
			'_company_twitter',

That adds "join" and "where" queries for keywords. Something like the following could work:

function gma_wpjmef_new_searchable_meta_keys() {
    global $wpdb, $job_manager_keyword;
    $searchable_meta_keys[] = '_job_salary';
    $searchable_meta_keys[] = '_job_important_info';
    return $searchable_meta_keys;
}
add_filter('job_listing_searchable_meta_keys', 'gma_wpjmef_new_searchable_meta_keys');
@iamgabrielma iamgabrielma added the enhancement New feature or request label Sep 9, 2018
@iamgabrielma iamgabrielma added this to the 1.1 milestone Oct 9, 2018
@iamgabrielma iamgabrielma removed this from the 1.1 milestone Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant