Support » Plugin: WP Job Manager » New Salary field created as hidden meta, affecting WordPress Search

  • Resolved teamf

    (@teamf)


    Hi,

    I have added a Salary & another custom field on the Job submission, using code from your tutorial https://wpjobmanager.com/document/tutorial-adding-a-salary-field-for-jobs/. This works fine & saves the field.

    The issue however is that I noticed the field is saved as a hidden meta custom field, which means that it does not show up in the generic WordPress search on the site. I even tried to use an advanced plugin like WP Extended Search but this field is not searchable.

    I dont want to use the WP Job manager search form, I need the negeric WordPress search to pick this field up.

    Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi! Our developer believes he has already responded to you via email; if so, then here is what he responded, for the benefit of everyone:

    You can remove the _ prefix from the backend/admin fields (when you filter job_manager_job_listing_data_fields), but unfortunately it isn’t possible to add it to the frontend job submission form and have it save to a public meta field. Are you trying to allow people to search for job listings based on salary from the site-wide WordPress search? I don’t believe that searches meta fields–private or public. At the bottom of the tutorial you linked to there is a section for adding it to the filter form included with the [jobs] shortcode, but I’m not sure if that is what you’re looking for.

    Let me know if you have any questions!

    While this is possible to remove the prepended underscore, be aware that doing so will probably cause issues with any addon plugins, themes, or anything else that may rely on it being hidden meta.

    Just wanted to mention that, as this should be fine if you’re only going to handle this field yourself, but just something to keep in mind .. almost all themes/plugins expect a hidden meta field.

    • This reply was modified 6 months, 1 week ago by tripflex.
    Plugin Contributor Richard Archambault

    (@richardmtl)

    I’m marking this thread as Resolved as it’s been more than a month since the last reply. If you still need help, please do reply again and mark the thread as Unresolved!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.