-
Notifications
You must be signed in to change notification settings - Fork 366
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
Editing job in backend allows for multiple types #549
Comments
In case I end up looking into this myself: http://code.tutsplus.com/articles/how-to-use-radio-buttons-with-taxonomies--wp-24779 |
Here's what looks like an extensive class for changing the category/taxonomy box to radio: I've also come across Javascript that goes through the elements of the box changing each to a radio checkbox, but that seems a bit hacky to me. There's even a plugin that does that here: https://wordpress.org/plugins/change-category-checkbox-to-radio-button/ My preference is to try the class above or use the code @aheckler found. |
Fixes #549 The post editor metabox uses checkboxes which allows more than one job type, but replacing them with radio buttons only allows one. Code from https://code.tutsplus.com/articles/how-to-use-radio-buttons-with-taxonomies--wp-24779
Also, I wonder if any users are using this functionality to have more than one job type? If we wanted to support more than just jobs in the future this would be limiting, unless we start to support tags. |
I don't see it a lot since the output function only supports one type, however there have been people who requested that functionality. Perhaps a filter to disable for people who have modified or created their own way to output multiple? |
It would be easy to add a filter that returns true by default so the remove/add metabox calls are executed here. It's probably best to make single job type the default as it's the default on the public submission page. |
I thinks it is important to have multiple job types for more precise classification. So I would not force single job type but make it optional. For example I could have Job that is part-time and also summer job at the same time. I have already changed the front-end submission form to support multiple job types with the "WP Job Manager - Field Editor" and I have changed the front-end templates and some functions to support displaying of multiple job types. Please don't force single "Job Type". There could be lot of different situations where one would want to use multiple job types. If wanted I can paste the changes that I made to achieve displaying of multiple job types on the front-end. |
eppul - thanks for your comment! I'd be very interested in hearing about what changes you made to the front end. It might be better to allow either multi or single selection of job types since they're the only taxonomy allowed currently. That could be a checkbox setting on the settings page that would change the UI in the backend and frontend. |
I copied couple of functions and changed them to suit my needs. Here are the modified functions as an attachment because the code pasting did not work properly. And I just load it inside the head meta (content-single-job-meta.php) and listing template(content-job-listing.php) with this: Thank you for you consideration |
Thanks for that. It's useful! If we're going down this route, we should extend get_the_job_type() so it returns multiple job types if necessary. The code in the templates will have to be updated (and possibly merged, since the same code is used in several files), and the job submission form will have to be updated too of course. |
@donnchawp Adding it as a setting inside Job Submission sounds great! The default should be one job type but users should also be able to enable multiple job type selection. |
Fixes #549 Modify the post editor and user facing frontend job submission forms so that the number of job types can be one OR many based on a setting in the "Job Submission" settings page.
I updated my PR so it adds a new setting to the Job Submission page. I added a function that checks that setting and then use that function to modify the post editor and front end job submission form. I'm not too happy with the wording of that setting so if anyone has suggestions I'd love to hear them! |
What about this?
|
I think it should be off by default (like multiple categories) and then mirror the multiple category text. |
Not everyone will be happy with this change, and we'll have to make it prominent for users upgrading, but I'd rather stick with the way it is now. Forcing one job type will inconvenience users who use wp-admin but at least they can find the Settings page and toggle the setting. If we enable multiple job types by default the frontend submission form will be modified, possibly without a site owner noticing until too late when submitted jobs have multiple types. The single setting means the frontend form remains the same so if the form has been modified at the DOM level in the past that hack will still work. @aheckler - thanks, you got me thinking in the other direction! Since we're putting a limit on what the user can do rather than letting them have free reign over how many types they can use. I think we could call the setting:
|
Sorry, I meant off by default when the setting toggles multiple types on. So the setting would be the opposite of what you have currently. "Multi-select Types: Enable multiple types for listings" So with it off by default only the admin will change to what was the expected behavior previously (submit one type on the frontend, select one type on the backend). Then when you toggle it on the admin "reverts" (to how it is now) and the frontend updates to a multi-select. Then it's a matter of dealing with the template files. |
Ah, so we're saying the same thing but the opposite wording for the settings page? I'm inclined to leave it the way it is however (well, except to slightly change the wording as I suggested above). I don't think it makes it any clearer or easier to understand. |
By itself it might not be any clearer but I think in the context of the other settings it makes more sense to match it to the same toggle as categories. Toggle On: Turn on multiple categories Those settings really do the same thing but they contradict each other in how they are used. |
OK, I have you now, and that makes sense. Thanks for persisting! In fact I think the "job type" setting should probably go under the category settings on the "Job Listings" settings tab, since they are related. |
Fixes #549 The multiselect category checkbox on the "Job Listings" settings page is similar in functionality to the job types one so I'm moving it to the "Job Listings" settings tab and renaming the single job type chekbox to "Multi-select Listing Types". The forms and related function had to be changed too.
... but we enforce a " one type per job" policy on the default submission form:
This leads to confusion:
https://wordpress.org/support/topic/bug-single-job-listing-page-only-displays-first-type
https://wordpress.org/support/topic/multiple-job-types
https://wordpress.org/support/topic/multiple-job-types-1
We should either allow multiple job types per job or limit the backend meta box in such as way as to enforce the "one type per job" rule.
The text was updated successfully, but these errors were encountered: