WP Job Manager - Version 1.26.0

Version Description

  • Enhancement: Warn the user if they're editing an existing job. (@donnchawp; https://github.com/Automattic/WP-Job-Manager/pull/847)
  • Enhancement: WP Admin Job Listing page's table is now responsive. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/906)
  • Enhancement: New setting for hiding expired listings from [jobs] filter. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/903)
  • Enhancement: Use WP Query's built in search function to improve searching in [jobs]. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/960)
  • Fix: Job Listing filter only searches meta fields with relevant content. Add custom fields with job_listing_searchable_meta_keys filter. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/910)
  • Fix: Improved support for WPML and Polylang. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/963)
  • Fix: Expired field no longer forces admins to choose a date in the future. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/903)
  • Fix: Listings with expiration date in past will immediately expire; moving to Active status will extend if necessary. (@turtlepod, @jom; https://github.com/Automattic/WP-Job-Manager/pull/903, https://github.com/Automattic/WP-Job-Manager/pull/975)
  • Fix: Google Maps API key setting added to fix geolocation retrieval on new sites. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/912)
  • Fix: Issue when duplicating a job listing with a field for multiple file uploads. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/911)
  • Fix: Hide page results when adding links in the [submit_job_form] shortcode. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/922)
  • Fix: Job feed now loads when a site has no posts. (@dbtlr; https://github.com/Automattic/WP-Job-Manager/pull/870)
  • Fix: No error is thrown when deleting a user. (@tripflex; https://github.com/Automattic/WP-Job-Manager/pull/875)
  • Dev: Plugins and themes can now retrieve JSON of Job Listings results without HTML. (@spencerfinnell; https://github.com/Automattic/WP-Job-Manager/pull/888)
  • Dev: Updated inline documentation.
Download this release

Release Info

Developer jakeom
Plugin Icon 128x128 WP Job Manager
Version 1.26.0
Comparing to
See all releases

Code changes from version 1.25.3 to 1.26.0

Files changed (44) hide show
  1. .github/ISSUE_TEMPLATE.md +0 -17
  2. .svnignore +27 -0
  3. assets/css/admin.css +1 -1
  4. assets/css/admin.less +56 -2
  5. assets/css/job-submission.css +11 -0
  6. assets/css/job-submission.less +14 -0
  7. assets/js/admin.js +6 -7
  8. assets/js/admin.min.js +1 -1
  9. changelog.txt +17 -0
  10. includes/3rd-party/3rd-party.php +6 -0
  11. includes/3rd-party/polylang.php +48 -0
  12. includes/3rd-party/wpml.php +49 -0
  13. includes/abstracts/abstract-wp-job-manager-form.php +82 -43
  14. includes/admin/class-wp-job-manager-addons.php +27 -2
  15. includes/admin/class-wp-job-manager-admin.php +33 -17
  16. includes/admin/class-wp-job-manager-cpt.php +85 -33
  17. includes/admin/class-wp-job-manager-settings.php +47 -16
  18. includes/admin/class-wp-job-manager-setup.php +36 -19
  19. includes/admin/class-wp-job-manager-writepanels.php +117 -62
  20. includes/class-wp-job-manager-ajax.php +144 -98
  21. includes/class-wp-job-manager-api.php +46 -23
  22. includes/class-wp-job-manager-cache-helper.php +32 -11
  23. includes/class-wp-job-manager-category-walker.php +9 -8
  24. includes/class-wp-job-manager-forms.php +31 -6
  25. includes/class-wp-job-manager-geocode.php +98 -22
  26. includes/class-wp-job-manager-install.php +10 -6
  27. includes/class-wp-job-manager-post-types.php +137 -43
  28. includes/class-wp-job-manager-shortcodes.php +61 -27
  29. includes/class-wp-job-manager-widget.php +183 -0
  30. includes/class-wp-job-manager-widgets.php +0 -383
  31. includes/forms/class-wp-job-manager-form-edit-job.php +7 -2
  32. includes/forms/class-wp-job-manager-form-submit-job.php +38 -24
  33. includes/widgets/class-wp-job-manager-widget-featured-jobs.php +101 -0
  34. includes/widgets/class-wp-job-manager-widget-recent-jobs.php +112 -0
  35. languages/wp-job-manager.pot +398 -372
  36. readme.txt +19 -2
  37. templates/form-fields/radio-field.php +2 -1
  38. templates/job-application-email.php +0 -13
  39. templates/job-preview.php +12 -12
  40. templates/job-submit.php +6 -0
  41. uninstall.php +2 -1
  42. wp-job-manager-functions.php +167 -78
  43. wp-job-manager-template.php +141 -99
  44. wp-job-manager.php +100 -31
.github/ISSUE_TEMPLATE.md DELETED
@@ -1,17 +0,0 @@
1
- <!--
2
- Thanks for contributing to WP Job Manager! Enter a clear title (e.g. "Search error when using plus sign") and proceed.
3
- -->
4
-
5
- #### What I Expected To Happen
6
-
7
- #### What Happened Instead
8
-
9
- #### Steps to Reproduce the Bug
10
-
11
- <!--
12
- PLEASE NOTE:
13
- - These comments won't show up when you submit the issue.
14
- - Try to add as much detail as possible. Be specific!
15
- - GitHub issues aren't for support! If you have questions, use this form: https://wpjobmanager.com/support/
16
- - If you're requesting a new feature, explain why you'd like it to be added.
17
- -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.svnignore ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .eslintrc
2
+ .eslintignore
3
+ .codeclimate.yml
4
+ .git
5
+ .gitignore
6
+ .sass-cache
7
+ .jshintrc
8
+ .jshintignore
9
+ .travis.yml
10
+ .npmrc
11
+ .nvmrc
12
+ .editorconfig
13
+ .eslintrc
14
+ readme.md
15
+ .github
16
+ phpunit.xml.dist
17
+ phpcs.ruleset.xml
18
+ docs
19
+ tests
20
+ tools
21
+ package.json
22
+ Gruntfile.js
23
+ node_modules
24
+ vendor
25
+ composer.lock
26
+ composer.json
27
+
assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- .clearfix{zoom:1}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}@font-face{font-family:job-manager;src:url(../font/job-manager.eot?4963673);src:url(../font/job-manager.eot?4963673#iefix) format('embedded-opentype'),url(../font/job-manager.woff?4963673) format('woff'),url(../font/job-manager.ttf?4963673) format('truetype'),url(../font/job-manager.svg?4963673#job-manager) format('svg');font-weight:400;font-style:normal}@font-face{font-family:jm-logo;src:url(../font/jm-logo/jm.eot?ycsbky);src:url(../font/jm-logo/jm.eot?#iefixycsbky) format('embedded-opentype'),url(../font/jm-logo/jm.woff?ycsbky) format('woff'),url(../font/jm-logo/jm.ttf?ycsbky) format('truetype'),url(../font/jm-logo/jm.svg?ycsbky#icomoon) format('svg');font-weight:400;font-style:normal}.jm-icon{font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em}.job-manager-settings-wrap .updated{display:none}.job-manager-settings-wrap .job-manager-updated{display:block;margin:1em 0 0}.widefat td.column-featured_job,.widefat td.column-filled,.widefat td.column-job_status{width:46px;text-align:left;padding-left:11px}.widefat th.column-featured_job,.widefat th.column-filled,.widefat th.column-job_status{width:1em}.widefat th.column-featured_job span,.widefat th.column-filled span,.widefat th.column-job_status span{display:block;width:1em;height:1em;line-height:1em;padding:1px 0 0;overflow:hidden}.widefat th.column-featured_job span:before,.widefat th.column-filled span:before,.widefat th.column-job_status span:before{content:'\e803';font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em}.widefat th.column-filled span:before{content:'\e807'}.widefat th.column-job_status span:before{content:'\e828'}.widefat .column-job_posted strong{display:block;margin-bottom:.2em}.widefat td.column-job_status span{position:relative;font-size:1em;line-height:1.5em;width:1em;height:0;padding:2em 0 0;overflow:hidden;display:block}.widefat td.column-job_status span:before{font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;position:absolute;top:0;left:0;line-height:1.5em;vertical-align:middle;color:#999;content:'\e829'}.widefat td.column-job_status .status-trash:before{content:'\e82b';color:#a00}.widefat td.column-job_status .status-pending:before{content:'\e82c';color:#ffba00}.widefat td.column-job_status .status-publish:before{content:'\e82f';color:#73a724}.widefat td.column-job_status .status-expired:before{content:'\e82e';color:#a00}.widefat .column-job_listing_type{text-align:left;width:6em;word-wrap:normal!important}.widefat .column-job_listing_type .job-type{color:#fff;padding:4px;font-size:11px;-webkit-border-radius:2px;border-radius:2px;display:block;background-color:#f08d3c;text-align:center}.widefat .column-job_listing_type .full-time{background-color:#90da36}.widefat .column-job_listing_type .part-time{background-color:#f08d3c}.widefat .column-job_listing_type .temporary{background-color:#d93674}.widefat .column-job_listing_type .freelance{background-color:#39c}.widefat .column-job_listing_type .internship{background-color:#6033cc}.widefat th.column-job_position{width:20%}.widefat td.column-job_position{width:20%;height:34px}.widefat td.column-job_position .job_position{position:relative;padding-right:50px!important}.widefat td.column-job_position a.job_title{font-weight:700}.widefat td.column-job_position img{width:32px;height:32px;position:absolute;right:7px;top:0;-webkit-border-radius:50%;border-radius:50%;box-shadow:0 1px 0 1px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 0 1px rgba(0,0,0,.1);border:1px solid #fff}.widefat td.column-job_position .company{margin-top:.2em;display:block;padding-top:2px;color:#bbb}.widefat .column-job_location{width:10%}.widefat .column-job_actions{text-align:right;width:128px}.widefat .column-job_actions strong{display:block;margin-bottom:.2em}.widefat .column-job_actions .actions{padding-top:2px}.widefat .column-job_actions a.button{display:inline-block;margin:0 0 2px 4px;cursor:pointer;padding:0 6px!important;font-size:1em!important;line-height:2em!important;overflow:hidden}.widefat .column-job_actions a.button-icon{width:2em!important;padding:0!important}.widefat .column-job_actions a.button-icon:before{font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;text-align:center;font-variant:normal;text-transform:none;float:left;width:2em!important;line-height:2em}.widefat .column-job_actions .icon-view:before{content:'\e805'}.widefat .column-job_actions .icon-edit:before{content:'\e804'}.widefat .column-job_actions .icon-delete:before{content:'\e82b'}.widefat .column-job_actions .icon-approve:before{content:'\e802'}.wp_job_manager_meta_data{padding:12px;zoom:1}.wp_job_manager_meta_data:after,.wp_job_manager_meta_data:before{content:"";display:table}.wp_job_manager_meta_data:after{clear:both}.wp_job_manager_meta_data .form-field{width:50%;line-height:2em;float:left;box-sizing:border-box;padding:0 12px 0 0;margin:0 0 12px;clear:both}.wp_job_manager_meta_data .form-field:nth-child(even){float:right;padding:0 0 0 12px;clear:right}.wp_job_manager_meta_data .form-field:nth-last-child(-n+2){margin-bottom:0;padding-bottom:0;border-bottom:0}.wp_job_manager_meta_data .form-field label{vertical-align:middle;display:block;font-weight:700;margin:0}.wp_job_manager_meta_data .form-field .tips{cursor:help;float:right;font-weight:400;color:#999}.wp_job_manager_meta_data .form-field input{width:100%;margin:1px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.wp_job_manager_meta_data .form-field input.checkbox,.wp_job_manager_meta_data .form-field input.radio{width:auto;margin:4px 2px;display:inline-block}.wp_job_manager_meta_data .form-field .description{display:block;color:#999}.wp_job_manager_meta_data .form-field.form-field-checkbox .description{display:inline}.wp_job_manager_meta_data .form-field .file_url input{width:75%}.wp_job_manager_meta_data .form-field .button{margin-left:4px}.wp_job_manager_meta_data .form-field .file_no_url{-o-animation:flash .3s linear infinite alternate;-webkit-animation:flash .3s linear infinite alternate;-moz-animation:flash .3s linear infinite alternate;animation:flash .3s linear infinite alternate}@-o-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@-ms-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@-moz-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@-webkit-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@keyframes flash{from{background-color:unset}to{background-color:#dc3232}}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_left{padding-right:5px}#tiptip_content{font-size:11px;color:#fff;padding:4px 8px;background:#464646;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;box-shadow:1px 1px 3px rgba(0,0,0,.1);-webkit-box-shadow:1px 1px 3px rgba(0,0,0,.1);-moz-box-shadow:1px 1px 3px rgba(0,0,0,.1);text-align:center}#tiptip_content code{background:#999;padding:1px}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#464646}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#464646}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#464646}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#464646}.wp_job_manager_addons_wrap #job-manager-addons-banner{position:relative;background:#d85677;padding:0 2em 0 5em;color:#fff;margin:10px .25% 20px 0;border-color:rgba(0,0,0,.1);overflow:hidden}.wp_job_manager_addons_wrap #job-manager-addons-banner strong{font-size:1.25em;line-height:.8em;text-shadow:0 2px 0 rgba(0,0,0,.1);font-weight:400;float:left;padding:1.6em 0}.wp_job_manager_addons_wrap #job-manager-addons-banner a.button{color:#fff;text-decoration:none;font-weight:700;float:right;background:#d85677;border:1px solid #fff;line-height:1em;padding:1em;margin:1em 0;text-shadow:0 2px 0 rgba(0,0,0,.1);box-shadow:0 2px 0 rgba(0,0,0,.1);height:auto;position:relative}.wp_job_manager_addons_wrap #job-manager-addons-banner:before{display:inline-block;-webkit-font-smoothing:antialiased;vertical-align:top;font-family:jm-logo;content:"\e600";top:.02em;left:0;position:absolute;text-shadow:0 2px 0 rgba(0,0,0,.1);font-size:5em;font-weight:400;text-align:center;width:1em;height:1em;line-height:1em}.wp_job_manager_addons_wrap .products{overflow:hidden}.wp_job_manager_addons_wrap .products li{display:inline-block;margin:0 1% 10px 0!important;padding:0;vertical-align:top;width:24%;min-width:250px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);overflow:hidden;position:relative;opacity:.8}.wp_job_manager_addons_wrap .products li:nth-child(4n+0){margin-right:0!important}.wp_job_manager_addons_wrap .products li a{color:inherit;text-decoration:none}.wp_job_manager_addons_wrap .products li img{width:100%;height:auto;display:block;padding:0;margin:0;background:#fff;border-bottom:1px solid rgba(0,0,0,.1)}.wp_job_manager_addons_wrap .products li h2{margin:0!important;padding:10px 0!important;line-height:1;background:rgba(255,255,255,.6);border-bottom:1px solid rgba(0,0,0,.1);color:#000;text-align:center;position:absolute;width:100%;top:0;left:0;font-size:16px;text-shadow:none;display:none}.wp_job_manager_addons_wrap .products li:focus,.wp_job_manager_addons_wrap .products li:hover{opacity:1}.wp_job_manager_addons_wrap .products li:focus h2,.wp_job_manager_addons_wrap .products li:hover h2{display:block}.wp_job_manager_addons_wrap .products li .third_party{display:none}.wp_job_manager_addons_wrap .products li p{padding:20px!important;margin:0!important;border-top:1px solid #f1f1f1}.wp_job_manager_addons_wrap .products li .price{display:none}.rtl .widefat .column-job_actions a.button-icon:before{float:right}.rtl .wp_job_manager_meta_data p{padding:0 20% 0 0}.rtl .wp_job_manager_meta_data label{left:auto;right:0}
1
+ .clearfix{zoom:1}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}@font-face{font-family:job-manager;src:url(../font/job-manager.eot?4963673);src:url(../font/job-manager.eot?4963673#iefix) format('embedded-opentype'),url(../font/job-manager.woff?4963673) format('woff'),url(../font/job-manager.ttf?4963673) format('truetype'),url(../font/job-manager.svg?4963673#job-manager) format('svg');font-weight:400;font-style:normal}@font-face{font-family:jm-logo;src:url(../font/jm-logo/jm.eot?ycsbky);src:url(../font/jm-logo/jm.eot?#iefixycsbky) format('embedded-opentype'),url(../font/jm-logo/jm.woff?ycsbky) format('woff'),url(../font/jm-logo/jm.ttf?ycsbky) format('truetype'),url(../font/jm-logo/jm.svg?ycsbky#icomoon) format('svg');font-weight:400;font-style:normal}.jm-icon{font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em}.job-manager-settings-wrap .updated{display:none}.job-manager-settings-wrap .job-manager-updated{display:block;margin:1em 0 0}.widefat td.column-featured_job,.widefat td.column-filled,.widefat td.column-job_status{width:46px;text-align:left;padding-left:11px}.widefat th.column-featured_job,.widefat th.column-filled,.widefat th.column-job_status{width:1em}.widefat th.column-featured_job span,.widefat th.column-filled span,.widefat th.column-job_status span{display:block;width:1em;height:1em;line-height:1em;padding:1px 0 0;overflow:hidden}.widefat th.column-featured_job span:before,.widefat th.column-filled span:before,.widefat th.column-job_status span:before{content:'\e803';font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em}.widefat th.column-filled span:before{content:'\e807'}.widefat th.column-job_status span:before{content:'\e828'}.widefat .column-job_posted strong{display:block;margin-bottom:.2em}.widefat td.column-job_status span{position:relative;font-size:1em;line-height:1.5em;width:1em;height:0;padding:2em 0 0;overflow:hidden;display:block}.widefat td.column-job_status span:before{font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;position:absolute;top:0;left:0;line-height:1.5em;vertical-align:middle;color:#999;content:'\e829'}.widefat td.column-job_status .status-trash:before{content:'\e82b';color:#a00}.widefat td.column-job_status .status-pending:before{content:'\e82c';color:#ffba00}.widefat td.column-job_status .status-publish:before{content:'\e82f';color:#73a724}.widefat td.column-job_status .status-expired:before{content:'\e82e';color:#a00}.widefat .column-job_listing_type{text-align:left;width:6em;word-wrap:normal!important}.widefat .column-job_listing_type .job-type{color:#fff;padding:4px;font-size:11px;-webkit-border-radius:2px;border-radius:2px;display:block;background-color:#f08d3c;text-align:center}.widefat .column-job_listing_type .full-time{background-color:#90da36}.widefat .column-job_listing_type .part-time{background-color:#f08d3c}.widefat .column-job_listing_type .temporary{background-color:#d93674}.widefat .column-job_listing_type .freelance{background-color:#39c}.widefat .column-job_listing_type .internship{background-color:#6033cc}.widefat th.column-job_position{width:20%}.widefat td.column-job_position{width:20%;height:34px}.widefat td.column-job_position .job_position{position:relative;padding-right:50px!important}.widefat td.column-job_position a.job_title{font-weight:700}.widefat td.column-job_position img{width:32px;height:32px;position:absolute;right:7px;top:0;-webkit-border-radius:50%;border-radius:50%;box-shadow:0 1px 0 1px rgba(0,0,0,.1);-webkit-box-shadow:0 1px 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 1px 0 1px rgba(0,0,0,.1);border:1px solid #fff}.widefat td.column-job_position .company{margin-top:.2em;display:block;padding-top:2px;color:#bbb}.widefat .column-job_location{width:10%}.widefat .column-job_actions{text-align:right;width:128px}.widefat .column-job_actions strong{display:block;margin-bottom:.2em}.widefat .column-job_actions .actions{padding-top:2px}.widefat .column-job_actions a.button{display:inline-block;margin:0 0 2px 4px;cursor:pointer;padding:0 6px!important;font-size:1em!important;line-height:2em!important;overflow:hidden}.widefat .column-job_actions a.button-icon{width:2em!important;padding:0!important}.widefat .column-job_actions a.button-icon:before{font-family:job-manager!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;text-align:center;font-variant:normal;text-transform:none;float:left;width:2em!important;line-height:2em}.widefat .column-job_actions .icon-view:before{content:'\e805'}.widefat .column-job_actions .icon-edit:before{content:'\e804'}.widefat .column-job_actions .icon-delete:before{content:'\e82b'}.widefat .column-job_actions .icon-approve:before{content:'\e802'}.wp_job_manager_meta_data{zoom:1}.wp_job_manager_meta_data:after,.wp_job_manager_meta_data:before{content:"";display:table}.wp_job_manager_meta_data:after{clear:both}.wp_job_manager_meta_data .form-field{width:50%;line-height:2em;float:left;box-sizing:border-box;padding:0 12px 0 0;margin:0 0 12px;clear:both}.wp_job_manager_meta_data .form-field:nth-child(even){float:right;padding:0 0 0 12px;clear:right}.wp_job_manager_meta_data .form-field:nth-last-child(-n+2){margin-bottom:0;padding-bottom:0;border-bottom:0}.wp_job_manager_meta_data .form-field label{vertical-align:middle;display:block;font-weight:700;margin:0}.wp_job_manager_meta_data .form-field .tips{cursor:help;float:right;font-weight:400;color:#999}.wp_job_manager_meta_data .form-field input{width:100%;margin:1px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.wp_job_manager_meta_data .form-field input.checkbox,.wp_job_manager_meta_data .form-field input.radio{width:auto;margin:4px 2px;display:inline-block}.wp_job_manager_meta_data .form-field .description{display:block;color:#999}.wp_job_manager_meta_data .form-field.form-field-checkbox .description{display:inline}.wp_job_manager_meta_data .form-field .file_url input{width:75%}.wp_job_manager_meta_data .form-field .button{margin-left:4px}.wp_job_manager_meta_data .form-field .file_no_url{-o-animation:flash .3s linear infinite alternate;-webkit-animation:flash .3s linear infinite alternate;-moz-animation:flash .3s linear infinite alternate;animation:flash .3s linear infinite alternate}@-o-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@-ms-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@-moz-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@-webkit-keyframes flash{from{background-color:unset}to{background-color:#dc3232}}@keyframes flash{from{background-color:unset}to{background-color:#dc3232}}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_left{padding-right:5px}#tiptip_content{font-size:11px;color:#fff;padding:4px 8px;background:#464646;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;box-shadow:1px 1px 3px rgba(0,0,0,.1);-webkit-box-shadow:1px 1px 3px rgba(0,0,0,.1);-moz-box-shadow:1px 1px 3px rgba(0,0,0,.1);text-align:center}#tiptip_content code{background:#999;padding:1px}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#464646}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#464646}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#464646}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#464646}.wp_job_manager_addons_wrap #job-manager-addons-banner{position:relative;background:#d85677;padding:0 2em 0 5em;color:#fff;margin:10px .25% 20px 0;border-color:rgba(0,0,0,.1);overflow:hidden}.wp_job_manager_addons_wrap #job-manager-addons-banner strong{font-size:1.25em;line-height:.8em;text-shadow:0 2px 0 rgba(0,0,0,.1);font-weight:400;float:left;padding:1.6em 0}.wp_job_manager_addons_wrap #job-manager-addons-banner a.button{color:#fff;text-decoration:none;font-weight:700;float:right;background:#d85677;border:1px solid #fff;line-height:1em;padding:1em;margin:1em 0;text-shadow:0 2px 0 rgba(0,0,0,.1);box-shadow:0 2px 0 rgba(0,0,0,.1);height:auto;position:relative}.wp_job_manager_addons_wrap #job-manager-addons-banner:before{display:inline-block;-webkit-font-smoothing:antialiased;vertical-align:top;font-family:jm-logo;content:"\e600";top:.02em;left:0;position:absolute;text-shadow:0 2px 0 rgba(0,0,0,.1);font-size:5em;font-weight:400;text-align:center;width:1em;height:1em;line-height:1em}.wp_job_manager_addons_wrap .products{overflow:hidden}.wp_job_manager_addons_wrap .products li{display:inline-block;margin:0 1% 10px 0!important;padding:0;vertical-align:top;width:24%;min-width:250px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);overflow:hidden;position:relative;opacity:.8}.wp_job_manager_addons_wrap .products li:nth-child(4n+0){margin-right:0!important}.wp_job_manager_addons_wrap .products li a{color:inherit;text-decoration:none}.wp_job_manager_addons_wrap .products li img{width:100%;height:auto;display:block;padding:0;margin:0;background:#fff;border-bottom:1px solid rgba(0,0,0,.1)}.wp_job_manager_addons_wrap .products li h2{margin:0!important;padding:10px 0!important;line-height:1;background:rgba(255,255,255,.6);border-bottom:1px solid rgba(0,0,0,.1);color:#000;text-align:center;position:absolute;width:100%;top:0;left:0;font-size:16px;text-shadow:none;display:none}.wp_job_manager_addons_wrap .products li:focus,.wp_job_manager_addons_wrap .products li:hover{opacity:1}.wp_job_manager_addons_wrap .products li:focus h2,.wp_job_manager_addons_wrap .products li:hover h2{display:block}.wp_job_manager_addons_wrap .products li .third_party{display:none}.wp_job_manager_addons_wrap .products li p{padding:20px!important;margin:0!important;border-top:1px solid #f1f1f1}.wp_job_manager_addons_wrap .products li .price{display:none}.rtl .widefat .column-job_actions a.button-icon:before{float:right}.rtl .wp_job_manager_meta_data p{padding:0 20% 0 0}.rtl .wp_job_manager_meta_data label{left:auto;right:0}@media only screen and (max-width:782px){.widefat .job_position.column-primary{display:table-cell!important}.widefat .toggle-row:before{top:5px}.widefat .column-job_actions{text-align:left}.widefat .column-job_actions a.button-icon:before{float:left}.rtl .widefat .column-job_actions{text-align:right}.rtl .widefat .column-job_actions a.button-icon:before{float:right}.wp_job_manager_meta_data .form-field{width:100%;padding:0}.wp_job_manager_meta_data .form-field:nth-child(even),.wp_job_manager_meta_data .form-field:nth-last-child(-n+2){float:none;padding:0;margin-bottom:12px;clear:both}}
assets/css/admin.less CHANGED
@@ -195,7 +195,6 @@
195
  }
196
  }
197
  .wp_job_manager_meta_data {
198
- padding: 12px;
199
  zoom: 1;
200
  &:before,
201
  &:after {
@@ -487,4 +486,59 @@
487
  right: 0;
488
  }
489
  }
490
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  }
196
  }
197
  .wp_job_manager_meta_data {
 
198
  zoom: 1;
199
  &:before,
200
  &:after {
486
  right: 0;
487
  }
488
  }
489
+ }
490
+
491
+ /**
492
+ * Mobile styles
493
+ */
494
+ @media only screen and (max-width: 782px) {
495
+ .widefat {
496
+ .job_position.column-primary{
497
+ display: table-cell !important;
498
+ }
499
+ .toggle-row:before{
500
+ top: 5px;
501
+ }
502
+ .column-job_actions {
503
+ text-align: left;
504
+
505
+ a.button-icon {
506
+ &:before {
507
+ float: left;
508
+ }
509
+ }
510
+ }
511
+ }
512
+ .rtl {
513
+ .widefat {
514
+ .column-job_actions {
515
+ text-align: right;
516
+
517
+ a.button-icon {
518
+ &:before {
519
+ float: right;
520
+ }
521
+ }
522
+ }
523
+ }
524
+ }
525
+ .wp_job_manager_meta_data {
526
+ .form-field {
527
+ width: 100%;
528
+ padding: 0;
529
+
530
+ &:nth-child(even) {
531
+ float: none;
532
+ padding: 0;
533
+ margin-bottom: 12px;
534
+ clear: both;
535
+ }
536
+ &:nth-last-child(-n+2) {
537
+ float: none;
538
+ padding: 0;
539
+ margin-bottom: 12px;
540
+ clear: both;
541
+ }
542
+ }
543
+ }
544
+ }
assets/css/job-submission.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp-link #search-panel,
2
+ #wp-link #wplink-link-existing-content {
3
+ display: none;
4
+ }
5
+ div#wp-link-wrap.wp-core-ui {
6
+ height: 300px;
7
+ }
8
+ .wplink-autocomplete.ui-autocomplete {
9
+ display: none;
10
+ visibility: hidden;
11
+ }
assets/css/job-submission.less ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wp-link {
2
+ #search-panel, #wplink-link-existing-content {
3
+ display: none;
4
+ }
5
+ }
6
+
7
+ div#wp-link-wrap.wp-core-ui {
8
+ height: 300px;
9
+ }
10
+
11
+ .wplink-autocomplete.ui-autocomplete {
12
+ display: none;
13
+ visibility: hidden;
14
+ }
assets/js/admin.js CHANGED
@@ -19,7 +19,6 @@ jQuery(document).ready(function($) {
19
  $( 'input.job-manager-datepicker, input#_job_expires' ).datepicker({
20
  altFormat : 'yy-mm-dd',
21
  dateFormat : job_manager_admin.date_format,
22
- minDate : 0
23
  });
24
 
25
  $( 'input.job-manager-datepicker, input#_job_expires' ).each( function(){
@@ -100,10 +99,10 @@ jQuery(document).ready(function($) {
100
  });
101
 
102
  jQuery(document).ready(function($) {
103
- var taxonomy = 'job_listing_type';
104
- $('#' + taxonomy + 'checklist li :radio, #' + taxonomy + 'checklist-pop :radio').live( 'click', function(){
105
- var t = $(this), c = t.is(':checked'), id = t.val();
106
- $('#' + taxonomy + 'checklist li :radio, #' + taxonomy + 'checklist-pop :radio').prop('checked',false);
107
- $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
108
- });
109
  });
19
  $( 'input.job-manager-datepicker, input#_job_expires' ).datepicker({
20
  altFormat : 'yy-mm-dd',
21
  dateFormat : job_manager_admin.date_format,
 
22
  });
23
 
24
  $( 'input.job-manager-datepicker, input#_job_expires' ).each( function(){
99
  });
100
 
101
  jQuery(document).ready(function($) {
102
+ var taxonomy = 'job_listing_type';
103
+ $('#' + taxonomy + 'checklist li :radio, #' + taxonomy + 'checklist-pop :radio').live( 'click', function(){
104
+ var t = $(this), c = t.is(':checked'), id = t.val();
105
+ $('#' + taxonomy + 'checklist li :radio, #' + taxonomy + 'checklist-pop :radio').prop('checked',false);
106
+ $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
107
+ });
108
  });
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){a(".tips, .help_tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("p.form-field-author").on("click","a.change-author",function(){return a(this).closest("p").find(".current-author").hide(),a(this).closest("p").find(".change-author").show(),!1}),a("input.job-manager-datepicker, input#_job_expires").datepicker({altFormat:"yy-mm-dd",dateFormat:job_manager_admin.date_format,minDate:0}),a("input.job-manager-datepicker, input#_job_expires").each(function(){if(a(this).val()){var b=new Date(a(this).val());a(this).datepicker("setDate",b)}});var b,c,d;a(document).on("click",".wp_job_manager_add_another_file_button",function(b){b.preventDefault();var c=a(this).data("field_name"),d=a(this).data("field_placeholder"),e=a(this).data("uploader_button_text"),f=a(this).data("uploader_button"),g=a(this).data("view_button");a(this).before('<span class="file_url"><input type="text" name="'+c+'[]" placeholder="'+d+'" /><button class="button button-small wp_job_manager_upload_file_button" data-uploader_button_text="'+e+'">'+f+'</button><button class="button button-small wp_job_manager_view_file_button">'+g+"</button></span>")}),a(document).on("click",".wp_job_manager_view_file_button",function(b){b.preventDefault(),d=a(this).closest(".file_url"),c=d.find("input");var e=c.val();e.indexOf("://")>-1?window.open(e,"_blank"):(c.addClass("file_no_url"),setTimeout(function(){c.removeClass("file_no_url")},1e3))}),a(document).on("click",".wp_job_manager_upload_file_button",function(e){return e.preventDefault(),d=a(this).closest(".file_url"),c=d.find("input"),b?void b.open():(b=wp.media.frames.file_frame=wp.media({title:a(this).data("uploader_title"),button:{text:a(this).data("uploader_button_text")},multiple:!1}),b.on("select",function(){var d=b.state().get("selection").first().toJSON();a(c).val(d.url)}),void b.open())})}),jQuery(document).ready(function(a){var b="job_listing_type";a("#"+b+"checklist li :radio, #"+b+"checklist-pop :radio").live("click",function(){var c=a(this),d=c.is(":checked"),e=c.val();a("#"+b+"checklist li :radio, #"+b+"checklist-pop :radio").prop("checked",!1),a("#in-"+b+"-"+e+", #in-popular-"+b+"-"+e).prop("checked",d)})});
1
+ jQuery(document).ready(function(a){a(".tips, .help_tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("p.form-field-author").on("click","a.change-author",function(){return a(this).closest("p").find(".current-author").hide(),a(this).closest("p").find(".change-author").show(),!1}),a("input.job-manager-datepicker, input#_job_expires").datepicker({altFormat:"yy-mm-dd",dateFormat:job_manager_admin.date_format}),a("input.job-manager-datepicker, input#_job_expires").each(function(){if(a(this).val()){var b=new Date(a(this).val());a(this).datepicker("setDate",b)}});var b,c,d;a(document).on("click",".wp_job_manager_add_another_file_button",function(b){b.preventDefault();var c=a(this).data("field_name"),d=a(this).data("field_placeholder"),e=a(this).data("uploader_button_text"),f=a(this).data("uploader_button"),g=a(this).data("view_button");a(this).before('<span class="file_url"><input type="text" name="'+c+'[]" placeholder="'+d+'" /><button class="button button-small wp_job_manager_upload_file_button" data-uploader_button_text="'+e+'">'+f+'</button><button class="button button-small wp_job_manager_view_file_button">'+g+"</button></span>")}),a(document).on("click",".wp_job_manager_view_file_button",function(b){b.preventDefault(),d=a(this).closest(".file_url"),c=d.find("input");var e=c.val();e.indexOf("://")>-1?window.open(e,"_blank"):(c.addClass("file_no_url"),setTimeout(function(){c.removeClass("file_no_url")},1e3))}),a(document).on("click",".wp_job_manager_upload_file_button",function(e){return e.preventDefault(),d=a(this).closest(".file_url"),c=d.find("input"),b?void b.open():(b=wp.media.frames.file_frame=wp.media({title:a(this).data("uploader_title"),button:{text:a(this).data("uploader_button_text")},multiple:!1}),b.on("select",function(){var d=b.state().get("selection").first().toJSON();a(c).val(d.url)}),void b.open())})}),jQuery(document).ready(function(a){var b="job_listing_type";a("#"+b+"checklist li :radio, #"+b+"checklist-pop :radio").live("click",function(){var c=a(this),d=c.is(":checked"),e=c.val();a("#"+b+"checklist li :radio, #"+b+"checklist-pop :radio").prop("checked",!1),a("#in-"+b+"-"+e+", #in-popular-"+b+"-"+e).prop("checked",d)})});
changelog.txt CHANGED
@@ -1,3 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  = 1.25.3 =
2
  * Enhancement: Allow job types to be optional, just like categories. https://github.com/automattic/wp-job-manager/pull/789 Props Donncha.
3
  * Enhancement: Add get_job_listing_types filter. https://github.com/automattic/wp-job-manager/pull/824 Props Adam Heckler.
1
+ = 1.26.0 =
2
+ * Enhancement: Warn the user if they're editing an existing job. (@donnchawp; https://github.com/Automattic/WP-Job-Manager/pull/847)
3
+ * Enhancement: WP Admin Job Listing page's table is now responsive. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/906)
4
+ * Enhancement: New setting for hiding expired listings from `[jobs]` filter. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/903)
5
+ * Enhancement: Use WP Query's built in search function to improve searching in `[jobs]`. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/960)
6
+ * Fix: Job Listing filter only searches meta fields with relevant content. Add custom fields with `job_listing_searchable_meta_keys` filter. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/910)
7
+ * Fix: Improved support for WPML and Polylang. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/963)
8
+ * Fix: Expired field no longer forces admins to choose a date in the future. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/903)
9
+ * Fix: Listings with expiration date in past will immediately expire; moving to Active status will extend if necessary. (@turtlepod, @jom; https://github.com/Automattic/WP-Job-Manager/pull/903, https://github.com/Automattic/WP-Job-Manager/pull/975)
10
+ * Fix: Google Maps API key setting added to fix geolocation retrieval on new sites. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/912)
11
+ * Fix: Issue when duplicating a job listing with a field for multiple file uploads. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/911)
12
+ * Fix: Hide page results when adding links in the `[submit_job_form]` shortcode. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/922)
13
+ * Fix: Job feed now loads when a site has no posts. (@dbtlr; https://github.com/Automattic/WP-Job-Manager/pull/870)
14
+ * Fix: No error is thrown when deleting a user. (@tripflex; https://github.com/Automattic/WP-Job-Manager/pull/875)
15
+ * Dev: Plugins and themes can now retrieve JSON of Job Listings results without HTML. (@spencerfinnell; https://github.com/Automattic/WP-Job-Manager/pull/888)
16
+ * Dev: Updated inline documentation.
17
+
18
  = 1.25.3 =
19
  * Enhancement: Allow job types to be optional, just like categories. https://github.com/automattic/wp-job-manager/pull/789 Props Donncha.
20
  * Enhancement: Add get_job_listing_types filter. https://github.com/automattic/wp-job-manager/pull/824 Props Adam Heckler.
includes/3rd-party/3rd-party.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Load 3rd party compatibility tweaks.
4
+ */
5
+ require_once( JOB_MANAGER_PLUGIN_DIR . '/includes/3rd-party/wpml.php' );
6
+ require_once( JOB_MANAGER_PLUGIN_DIR . '/includes/3rd-party/polylang.php' );
includes/3rd-party/polylang.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Only load these if Polylang plugin is installed and active.
4
+ */
5
+
6
+ /**
7
+ * Load routines only if Polylang is loaded.
8
+ *
9
+ * @since 1.26.0
10
+ */
11
+ function polylang_wpjm_init() {
12
+ add_filter( 'wpjm_lang', 'polylang_wpjm_get_job_listings_lang' );
13
+ add_filter( 'wpjm_page_id', 'polylang_wpjm_page_id' );
14
+ }
15
+ add_action( 'pll_init', 'polylang_wpjm_init' );
16
+
17
+ /**
18
+ * Returns Polylang's current language.
19
+ *
20
+ * @since 1.26.0
21
+ *
22
+ * @param string $lang
23
+ * @return string
24
+ */
25
+ function polylang_wpjm_get_job_listings_lang( $lang ) {
26
+ if ( function_exists( 'pll_current_language' )
27
+ && function_exists( 'pll_is_translated_post_type' )
28
+ && pll_is_translated_post_type( 'job_listing' ) ) {
29
+ return pll_current_language();
30
+ }
31
+ return $lang;
32
+ }
33
+
34
+ /**
35
+ * Returns the page ID for the current language.
36
+ *
37
+ * @since 1.26.0
38
+ *
39
+ * @param int $page_id
40
+ * @return int
41
+ */
42
+ function polylang_wpjm_page_id( $page_id ) {
43
+ if ( function_exists( 'pll_get_post' ) ) {
44
+ $page_id = pll_get_post( $page_id );
45
+ }
46
+ return absint( $page_id );
47
+ }
48
+
includes/3rd-party/wpml.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Only load these if WPML plugin is installed and active.
4
+ */
5
+
6
+ /**
7
+ * Load routines only if WPML is loaded.
8
+ *
9
+ * @since 1.26.0
10
+ */
11
+ function wpml_wpjm_init() {
12
+ add_action( 'get_job_listings_init', 'wpml_wpjm_set_language' );
13
+ add_filter( 'wpjm_lang', 'wpml_wpjm_get_job_listings_lang' );
14
+ add_filter( 'wpjm_page_id', 'wpml_wpjm_page_id' );
15
+ }
16
+ add_action( 'wpml_loaded', 'wpml_wpjm_init' );
17
+
18
+ /**
19
+ * Sets WPJM's language if it is sent in the Ajax request.
20
+ *
21
+ * @since 1.26.0
22
+ */
23
+ function wpml_wpjm_set_language() {
24
+ if ( ( strstr( $_SERVER['REQUEST_URI'], '/jm-ajax/' ) || ! empty( $_GET['jm-ajax'] ) ) && isset( $_POST['lang'] ) ) {
25
+ do_action( 'wpml_switch_language', sanitize_text_field( $_POST['lang'] ) );
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Returns WPML's current language.
31
+ *
32
+ * @since 1.26.0
33
+ *
34
+ * @param string $lang
35
+ * @return string
36
+ */
37
+ function wpml_wpjm_get_job_listings_lang( $lang ) {
38
+ return apply_filters( 'wpml_current_language', $lang );
39
+ }
40
+
41
+ /**
42
+ * Returns the page ID for the current language.
43
+ *
44
+ * @param int $page_id
45
+ * @return int
46
+ */
47
+ function wpml_wpjm_page_id( $page_id ) {
48
+ return apply_filters( 'wpml_object_id', $page_id, 'page', true );
49
+ }
includes/abstracts/abstract-wp-job-manager-form.php CHANGED
@@ -1,14 +1,16 @@
1
  <?php
2
 
3
  /**
4
- * Abstract WP_Job_Manager_Form class.
5
  *
6
  * @abstract
 
 
7
  */
8
  abstract class WP_Job_Manager_Form {
9
 
10
  /**
11
- * Form fields
12
  *
13
  * @access protected
14
  * @var array
@@ -16,7 +18,7 @@ abstract class WP_Job_Manager_Form {
16
  protected $fields = array();
17
 
18
  /**
19
- * Form action
20
  *
21
  * @access protected
22
  * @var string
@@ -24,7 +26,7 @@ abstract class WP_Job_Manager_Form {
24
  protected $action = '';
25
 
26
  /**
27
- * Form errors
28
  *
29
  * @access protected
30
  * @var array
@@ -32,7 +34,7 @@ abstract class WP_Job_Manager_Form {
32
  protected $errors = array();
33
 
34
  /**
35
- * Form steps
36
  *
37
  * @access protected
38
  * @var array
@@ -40,7 +42,7 @@ abstract class WP_Job_Manager_Form {
40
  protected $steps = array();
41
 
42
  /**
43
- * Form step
44
  *
45
  * @access protected
46
  * @var int
@@ -48,7 +50,7 @@ abstract class WP_Job_Manager_Form {
48
  protected $step = 0;
49
 
50
  /**
51
- * Form fields
52
  *
53
  * @access protected
54
  * @var string
@@ -63,16 +65,30 @@ abstract class WP_Job_Manager_Form {
63
  }
64
 
65
  /**
66
- * Unserializing instances of this class is forbidden.
67
  */
68
  public function __wakeup() {
69
  _doing_it_wrong( __FUNCTION__ );
70
  }
71
 
72
  /**
73
- * Process function. all processing code if needed - can also change view if step is complete
74
  */
75
  public function process() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  $step_key = $this->get_step_key( $this->step );
77
 
78
  if ( $step_key && is_callable( $this->steps[ $step_key ]['handler'] ) ) {
@@ -88,7 +104,9 @@ abstract class WP_Job_Manager_Form {
88
  }
89
 
90
  /**
91
- * Call the view handler if set, otherwise call the next handler.
 
 
92
  */
93
  public function output( $atts = array() ) {
94
  $step_key = $this->get_step_key( $this->step );
@@ -100,15 +118,16 @@ abstract class WP_Job_Manager_Form {
100
  }
101
 
102
  /**
103
- * Add an error
104
- * @param string $error
 
105
  */
106
  public function add_error( $error ) {
107
  $this->errors[] = $error;
108
  }
109
 
110
  /**
111
- * Show errors
112
  */
113
  public function show_errors() {
114
  foreach ( $this->errors as $error ) {
@@ -117,7 +136,7 @@ abstract class WP_Job_Manager_Form {
117
  }
118
 
119
  /**
120
- * Get action (URL for forms to post to).
121
  * As of 1.22.2 this defaults to the current page permalink.
122
  *
123
  * @return string
@@ -127,7 +146,8 @@ abstract class WP_Job_Manager_Form {
127
  }
128
 
129
  /**
130
- * Get formn name.
 
131
  * @since 1.24.0
132
  * @return string
133
  */
@@ -136,7 +156,8 @@ abstract class WP_Job_Manager_Form {
136
  }
137
 
138
  /**
139
- * Get steps from outside of the class
 
140
  * @since 1.24.0
141
  */
142
  public function get_steps() {
@@ -144,15 +165,18 @@ abstract class WP_Job_Manager_Form {
144
  }
145
 
146
  /**
147
- * Get step from outside of the class
148
  */
149
  public function get_step() {
150
  return $this->step;
151
  }
152
 
153
  /**
154
- * Get step key from outside of the class
 
155
  * @since 1.24.0
 
 
156
  */
157
  public function get_step_key( $step = '' ) {
158
  if ( ! $step ) {
@@ -163,29 +187,31 @@ abstract class WP_Job_Manager_Form {
163
  }
164
 
165
  /**
166
- * Get step from outside of the class
 
167
  * @since 1.24.0
 
168
  */
169
  public function set_step( $step ) {
170
  $this->step = absint( $step );
171
  }
172
 
173
  /**
174
- * Increase step from outside of the class
175
  */
176
  public function next_step() {
177
  $this->step ++;
178
  }
179
 
180
  /**
181
- * Decrease step from outside of the class
182
  */
183
  public function previous_step() {
184
  $this->step --;
185
  }
186
 
187
  /**
188
- * get_fields function.
189
  *
190
  * @param string $key
191
  * @return array
@@ -203,7 +229,8 @@ abstract class WP_Job_Manager_Form {
203
  }
204
 
205
  /**
206
- * Sort array by priority value
 
207
  * @param array $a
208
  * @param array $b
209
  * @return int
@@ -216,14 +243,14 @@ abstract class WP_Job_Manager_Form {
216
  }
217
 
218
  /**
219
- * Init form fields
220
  */
221
  protected function init_fields() {
222
  $this->fields = array();
223
  }
224
 
225
  /**
226
- * Get post data for fields
227
  *
228
  * @return array of data
229
  */
@@ -267,9 +294,10 @@ abstract class WP_Job_Manager_Form {
267
  }
268
 
269
  /**
270
- * Get the value of a posted field
 
271
  * @param string $key
272
- * @param array $field
273
  * @return string|array
274
  */
275
  protected function get_posted_field( $key, $field ) {
@@ -277,9 +305,10 @@ abstract class WP_Job_Manager_Form {
277
  }
278
 
279
  /**
280
- * Get the value of a posted multiselect field
 
281
  * @param string $key
282
- * @param array $field
283
  * @return array
284
  */
285
  protected function get_posted_multiselect_field( $key, $field ) {
@@ -287,9 +316,10 @@ abstract class WP_Job_Manager_Form {
287
  }
288
 
289
  /**
290
- * Get the value of a posted file field
 
291
  * @param string $key
292
- * @param array $field
293
  * @return string|array
294
  */
295
  protected function get_posted_file_field( $key, $field ) {
@@ -305,9 +335,10 @@ abstract class WP_Job_Manager_Form {
305
  }
306
 
307
  /**
308
- * Get the value of a posted textarea field
 
309
  * @param string $key
310
- * @param array $field
311
  * @return string
312
  */
313
  protected function get_posted_textarea_field( $key, $field ) {
@@ -315,9 +346,10 @@ abstract class WP_Job_Manager_Form {
315
  }
316
 
317
  /**
318
- * Get the value of a posted textarea field
 
319
  * @param string $key
320
- * @param array $field
321
  * @return string
322
  */
323
  protected function get_posted_wp_editor_field( $key, $field ) {
@@ -325,9 +357,10 @@ abstract class WP_Job_Manager_Form {
325
  }
326
 
327
  /**
328
- * Get posted terms for the taxonomy
 
329
  * @param string $key
330
- * @param array $field
331
  * @return array
332
  */
333
  protected function get_posted_term_checklist_field( $key, $field ) {
@@ -339,9 +372,10 @@ abstract class WP_Job_Manager_Form {
339
  }
340
 
341
  /**
342
- * Get posted terms for the taxonomy
 
343
  * @param string $key
344
- * @param array $field
345
  * @return int
346
  */
347
  protected function get_posted_term_multiselect_field( $key, $field ) {
@@ -349,9 +383,10 @@ abstract class WP_Job_Manager_Form {
349
  }
350
 
351
  /**
352
- * Get posted terms for the taxonomy
 
353
  * @param string $key
354
- * @param array $field
355
  * @return int
356
  */
357
  protected function get_posted_term_select_field( $key, $field ) {
@@ -359,8 +394,12 @@ abstract class WP_Job_Manager_Form {
359
  }
360
 
361
  /**
362
- * Upload a file
363
- * @return string or array
 
 
 
 
364
  */
365
  protected function upload_file( $field_key, $field ) {
366
  if ( isset( $_FILES[ $field_key ] ) && ! empty( $_FILES[ $field_key ] ) && ! empty( $_FILES[ $field_key ]['name'] ) ) {
1
  <?php
2
 
3
  /**
4
+ * Parent abstract class for form classes.
5
  *
6
  * @abstract
7
+ * @package wp-job-manager
8
+ * @since 1.0.0
9
  */
10
  abstract class WP_Job_Manager_Form {
11
 
12
  /**
13
+ * Form fields.
14
  *
15
  * @access protected
16
  * @var array
18
  protected $fields = array();
19
 
20
  /**
21
+ * Form action.
22
  *
23
  * @access protected
24
  * @var string
26
  protected $action = '';
27
 
28
  /**
29
+ * Form errors.
30
  *
31
  * @access protected
32
  * @var array
34
  protected $errors = array();
35
 
36
  /**
37
+ * Form steps.
38
  *
39
  * @access protected
40
  * @var array
42
  protected $steps = array();
43
 
44
  /**
45
+ * Current form step.
46
  *
47
  * @access protected
48
  * @var int
50
  protected $step = 0;
51
 
52
  /**
53
+ * Form name.
54
  *
55
  * @access protected
56
  * @var string
65
  }
66
 
67
  /**
68
+ * Unserializes instances of this class is forbidden.
69
  */
70
  public function __wakeup() {
71
  _doing_it_wrong( __FUNCTION__ );
72
  }
73
 
74
  /**
75
+ * Processes the form result and can also change view if step is complete.
76
  */
77
  public function process() {
78
+
79
+ // reset cookie
80
+ if (
81
+ isset( $_GET[ 'new' ] ) &&
82
+ isset( $_COOKIE[ 'wp-job-manager-submitting-job-id' ] ) &&
83
+ isset( $_COOKIE[ 'wp-job-manager-submitting-job-key' ] ) &&
84
+ get_post_meta( $_COOKIE[ 'wp-job-manager-submitting-job-id' ], '_submitting_key', true ) == $_COOKIE['wp-job-manager-submitting-job-key']
85
+ ) {
86
+ delete_post_meta( $_COOKIE[ 'wp-job-manager-submitting-job-id' ], '_submitting_key' );
87
+ setcookie( 'wp-job-manager-submitting-job-id', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, false );
88
+ setcookie( 'wp-job-manager-submitting-job-key', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, false );
89
+ wp_redirect( remove_query_arg( array( 'new', 'key' ), $_SERVER[ 'REQUEST_URI' ] ) );
90
+ }
91
+
92
  $step_key = $this->get_step_key( $this->step );
93
 
94
  if ( $step_key && is_callable( $this->steps[ $step_key ]['handler'] ) ) {
104
  }
105
 
106
  /**
107
+ * Calls the view handler if set, otherwise call the next handler.
108
+ *
109
+ * @param array $atts Attributes to use in the view handler.
110
  */
111
  public function output( $atts = array() ) {
112
  $step_key = $this->get_step_key( $this->step );
118
  }
119
 
120
  /**
121
+ * Adds an error.
122
+ *
123
+ * @param string $error The error message.
124
  */
125
  public function add_error( $error ) {
126
  $this->errors[] = $error;
127
  }
128
 
129
  /**
130
+ * Displays errors.
131
  */
132
  public function show_errors() {
133
  foreach ( $this->errors as $error ) {
136
  }
137
 
138
  /**
139
+ * Gets the action (URL for forms to post to).
140
  * As of 1.22.2 this defaults to the current page permalink.
141
  *
142
  * @return string
146
  }
147
 
148
  /**
149
+ * Gets form name.
150
+ *
151
  * @since 1.24.0
152
  * @return string
153
  */
156
  }
157
 
158
  /**
159
+ * Gets steps from outside of the class.
160
+ *
161
  * @since 1.24.0
162
  */
163
  public function get_steps() {
165
  }
166
 
167
  /**
168
+ * Gets step from outside of the class.
169
  */
170
  public function get_step() {
171
  return $this->step;
172
  }
173
 
174
  /**
175
+ * Gets step key from outside of the class.
176
+ *
177
  * @since 1.24.0
178
+ * @param string|int $step
179
+ * @return string
180
  */
181
  public function get_step_key( $step = '' ) {
182
  if ( ! $step ) {
187
  }
188
 
189
  /**
190
+ * Sets step from outside of the class.
191
+ *
192
  * @since 1.24.0
193
+ * @param int $step
194
  */
195
  public function set_step( $step ) {
196
  $this->step = absint( $step );
197
  }
198
 
199
  /**
200
+ * Increases step from outside of the class.
201
  */
202
  public function next_step() {
203
  $this->step ++;
204
  }
205
 
206
  /**
207
+ * Decreases step from outside of the class.
208
  */
209
  public function previous_step() {
210
  $this->step --;
211
  }
212
 
213
  /**
214
+ * Gets fields for form.
215
  *
216
  * @param string $key
217
  * @return array
229
  }
230
 
231
  /**
232
+ * Sorts array by priority value.
233
+ *
234
  * @param array $a
235
  * @param array $b
236
  * @return int
243
  }
244
 
245
  /**
246
+ * Initializes form fields.
247
  */
248
  protected function init_fields() {
249
  $this->fields = array();
250
  }
251
 
252
  /**
253
+ * Gets post data for fields.
254
  *
255
  * @return array of data
256
  */
294
  }
295
 
296
  /**
297
+ * Gets the value of a posted field.
298
+ *
299
  * @param string $key
300
+ * @param array $field
301
  * @return string|array
302
  */
303
  protected function get_posted_field( $key, $field ) {
305
  }
306
 
307
  /**
308
+ * Gets the value of a posted multiselect field.
309
+ *
310
  * @param string $key
311
+ * @param array $field
312
  * @return array
313
  */
314
  protected function get_posted_multiselect_field( $key, $field ) {
316
  }
317
 
318
  /**
319
+ * Gets the value of a posted file field.
320
+ *
321
  * @param string $key
322
+ * @param array $field
323
  * @return string|array
324
  */
325
  protected function get_posted_file_field( $key, $field ) {
335
  }
336
 
337
  /**
338
+ * Gets the value of a posted textarea field.
339
+ *
340
  * @param string $key
341
+ * @param array $field
342
  * @return string
343
  */
344
  protected function get_posted_textarea_field( $key, $field ) {
346
  }
347
 
348
  /**
349
+ * Gets the value of a posted textarea field.
350
+ *
351
  * @param string $key
352
+ * @param array $field
353
  * @return string
354
  */
355
  protected function get_posted_wp_editor_field( $key, $field ) {
357
  }
358
 
359
  /**
360
+ * Gets posted terms for the taxonomy.
361
+ *
362
  * @param string $key
363
+ * @param array $field
364
  * @return array
365
  */
366
  protected function get_posted_term_checklist_field( $key, $field ) {
372
  }
373
 
374
  /**
375
+ * Gets posted terms for the taxonomy.
376
+ *
377
  * @param string $key
378
+ * @param array $field
379
  * @return int
380
  */
381
  protected function get_posted_term_multiselect_field( $key, $field ) {
383
  }
384
 
385
  /**
386
+ * Gets posted terms for the taxonomy.
387
+ *
388
  * @param string $key
389
+ * @param array $field
390
  * @return int
391
  */
392
  protected function get_posted_term_select_field( $key, $field ) {
394
  }
395
 
396
  /**
397
+ * Handles the uploading of files.
398
+ *
399
+ * @param string $field_key
400
+ * @param array $field
401
+ * @throws Exception When file upload failed
402
+ * @return string|array
403
  */
404
  protected function upload_file( $field_key, $field ) {
405
  if ( isset( $_FILES[ $field_key ] ) && ! empty( $_FILES[ $field_key ] ) && ! empty( $_FILES[ $field_key ]['name'] ) ) {
includes/admin/class-wp-job-manager-addons.php CHANGED
@@ -8,10 +8,35 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
  if ( ! class_exists( 'WP_Job_Manager_Addons' ) ) :
9
 
10
  /**
11
- * WP_Job_Manager_Addons Class
 
 
 
12
  */
13
  class WP_Job_Manager_Addons {
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Handles output of the reports page in admin.
17
  */
@@ -66,4 +91,4 @@ class WP_Job_Manager_Addons {
66
 
67
  endif;
68
 
69
- return new WP_Job_Manager_Addons();
8
  if ( ! class_exists( 'WP_Job_Manager_Addons' ) ) :
9
 
10
  /**
11
+ * Handles the admin add-ons page.
12
+ *
13
+ * @package wp-job-manager
14
+ * @since 1.1.0
15
  */
16
  class WP_Job_Manager_Addons {
17
 
18
+ /**
19
+ * The single instance of the class.
20
+ *
21
+ * @var self
22
+ * @since 1.26
23
+ */
24
+ private static $_instance = null;
25
+
26
+ /**
27
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
28
+ *
29
+ * @since 1.26
30
+ * @static
31
+ * @return self Main instance.
32
+ */
33
+ public static function instance() {
34
+ if ( is_null( self::$_instance ) ) {
35
+ self::$_instance = new self();
36
+ }
37
+ return self::$_instance;
38
+ }
39
+
40
  /**
41
  * Handles output of the reports page in admin.
42
  */
91
 
92
  endif;
93
 
94
+ return WP_Job_Manager_Addons::instance();
includes/admin/class-wp-job-manager-admin.php CHANGED
@@ -3,15 +3,37 @@
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
- * WP_Job_Manager_Admin class.
 
 
 
7
  */
8
  class WP_Job_Manager_Admin {
9
 
10
  /**
11
- * __construct function.
12
  *
13
- * @access public
14
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  */
16
  public function __construct() {
17
  include_once( 'class-wp-job-manager-cpt.php' );
@@ -19,17 +41,14 @@ class WP_Job_Manager_Admin {
19
  include_once( 'class-wp-job-manager-writepanels.php' );
20
  include_once( 'class-wp-job-manager-setup.php' );
21
 
22
- $this->settings_page = new WP_Job_Manager_Settings();
23
 
24
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 );
25
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
26
  }
27
 
28
  /**
29
- * admin_enqueue_scripts function.
30
- *
31
- * @access public
32
- * @return void
33
  */
34
  public function admin_enqueue_scripts() {
35
  global $wp_scripts;
@@ -40,7 +59,7 @@ class WP_Job_Manager_Admin {
40
  $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
41
 
42
  wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
43
- wp_enqueue_style( 'job_manager_admin_css', JOB_MANAGER_PLUGIN_URL . '/assets/css/admin.css' );
44
  wp_register_script( 'jquery-tiptip', JOB_MANAGER_PLUGIN_URL. '/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
45
  wp_enqueue_script( 'job_manager_admin_js', JOB_MANAGER_PLUGIN_URL. '/assets/js/admin.min.js', array( 'jquery', 'jquery-tiptip', 'jquery-ui-datepicker' ), JOB_MANAGER_VERSION, true );
46
 
@@ -50,14 +69,11 @@ class WP_Job_Manager_Admin {
50
  ) );
51
  }
52
 
53
- wp_enqueue_style( 'job_manager_admin_menu_css', JOB_MANAGER_PLUGIN_URL . '/assets/css/menu.css' );
54
  }
55
 
56
  /**
57
- * admin_menu function.
58
- *
59
- * @access public
60
- * @return void
61
  */
62
  public function admin_menu() {
63
  add_submenu_page( 'edit.php?post_type=job_listing', __( 'Settings', 'wp-job-manager' ), __( 'Settings', 'wp-job-manager' ), 'manage_options', 'job-manager-settings', array( $this->settings_page, 'output' ) );
@@ -67,7 +83,7 @@ class WP_Job_Manager_Admin {
67
  }
68
 
69
  /**
70
- * Output addons page
71
  */
72
  public function addons_page() {
73
  $addons = include( 'class-wp-job-manager-addons.php' );
@@ -75,4 +91,4 @@ class WP_Job_Manager_Admin {
75
  }
76
  }
77
 
78
- new WP_Job_Manager_Admin();
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
+ * Handles front admin page for WP Job Manager.
7
+ *
8
+ * @package wp-job-manager
9
+ * @since 1.0.0
10
  */
11
  class WP_Job_Manager_Admin {
12
 
13
  /**
14
+ * The single instance of the class.
15
  *
16
+ * @var self
17
+ * @since 1.26
18
+ */
19
+ private static $_instance = null;
20
+
21
+ /**
22
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
23
+ *
24
+ * @since 1.26
25
+ * @static
26
+ * @return self Main instance.
27
+ */
28
+ public static function instance() {
29
+ if ( is_null( self::$_instance ) ) {
30
+ self::$_instance = new self();
31
+ }
32
+ return self::$_instance;
33
+ }
34
+
35
+ /**
36
+ * Constructor.
37
  */
38
  public function __construct() {
39
  include_once( 'class-wp-job-manager-cpt.php' );
41
  include_once( 'class-wp-job-manager-writepanels.php' );
42
  include_once( 'class-wp-job-manager-setup.php' );
43
 
44
+ $this->settings_page = WP_Job_Manager_Settings::instance();
45
 
46
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 );
47
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
48
  }
49
 
50
  /**
51
+ * Enqueues CSS and JS assets.
 
 
 
52
  */
53
  public function admin_enqueue_scripts() {
54
  global $wp_scripts;
59
  $jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
60
 
61
  wp_enqueue_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
62
+ wp_enqueue_style( 'job_manager_admin_css', JOB_MANAGER_PLUGIN_URL . '/assets/css/admin.css', array(), JOB_MANAGER_VERSION );
63
  wp_register_script( 'jquery-tiptip', JOB_MANAGER_PLUGIN_URL. '/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
64
  wp_enqueue_script( 'job_manager_admin_js', JOB_MANAGER_PLUGIN_URL. '/assets/js/admin.min.js', array( 'jquery', 'jquery-tiptip', 'jquery-ui-datepicker' ), JOB_MANAGER_VERSION, true );
65
 
69
  ) );
70
  }
71
 
72
+ wp_enqueue_style( 'job_manager_admin_menu_css', JOB_MANAGER_PLUGIN_URL . '/assets/css/menu.css', array(), JOB_MANAGER_VERSION );
73
  }
74
 
75
  /**
76
+ * Adds pages to admin menu.
 
 
 
77
  */
78
  public function admin_menu() {
79
  add_submenu_page( 'edit.php?post_type=job_listing', __( 'Settings', 'wp-job-manager' ), __( 'Settings', 'wp-job-manager' ), 'manage_options', 'job-manager-settings', array( $this->settings_page, 'output' ) );
83
  }
84
 
85
  /**
86
+ * Displays addons page.
87
  */
88
  public function addons_page() {
89
  $addons = include( 'class-wp-job-manager-addons.php' );
91
  }
92
  }
93
 
94
+ WP_Job_Manager_Admin::instance();
includes/admin/class-wp-job-manager-cpt.php CHANGED
@@ -3,19 +3,43 @@
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
- * WP_Job_Manager_CPT class.
 
 
 
7
  */
8
  class WP_Job_Manager_CPT {
9
 
10
  /**
11
- * __construct function.
12
  *
13
- * @access public
14
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  */
16
  public function __construct() {
17
  add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
18
  add_filter( 'manage_edit-job_listing_columns', array( $this, 'columns' ) );
 
 
19
  add_action( 'manage_job_listing_posts_custom_column', array( $this, 'custom_columns' ), 2 );
20
  add_filter( 'manage_edit-job_listing_sortable_columns', array( $this, 'sortable_columns' ) );
21
  add_filter( 'request', array( $this, 'sort_columns' ) );
@@ -38,7 +62,7 @@ class WP_Job_Manager_CPT {
38
  }
39
 
40
  /**
41
- * Edit bulk actions
42
  */
43
  public function add_bulk_actions() {
44
  global $post_type, $wp_post_types;;
@@ -59,7 +83,7 @@ class WP_Job_Manager_CPT {
59
  }
60
 
61
  /**
62
- * Do custom bulk actions
63
  */
64
  public function do_bulk_actions() {
65
  $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
@@ -111,7 +135,7 @@ class WP_Job_Manager_CPT {
111
  }
112
 
113
  /**
114
- * Approve a single job
115
  */
116
  public function approve_job() {
117
  if ( ! empty( $_GET['approve_job'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'approve_job' ) && current_user_can( 'publish_post', $_GET['approve_job'] ) ) {
@@ -127,7 +151,7 @@ class WP_Job_Manager_CPT {
127
  }
128
 
129
  /**
130
- * Show a notice if we did a bulk action or approval
131
  */
132
  public function approved_notice() {
133
  global $post_type, $pagenow;
@@ -147,7 +171,7 @@ class WP_Job_Manager_CPT {
147
  }
148
 
149
  /**
150
- * Show a notice if we did a bulk action or approval
151
  */
152
  public function expired_notice() {
153
  global $post_type, $pagenow;
@@ -167,7 +191,7 @@ class WP_Job_Manager_CPT {
167
  }
168
 
169
  /**
170
- * Show category dropdown
171
  */
172
  public function jobs_by_category() {
173
  global $typenow, $wp_query;
@@ -201,10 +225,11 @@ class WP_Job_Manager_CPT {
201
  }
202
 
203
  /**
204
- * enter_title_here function.
205
  *
206
- * @access public
207
- * @return void
 
208
  */
209
  public function enter_title_here( $text, $post ) {
210
  if ( $post->post_type == 'job_listing' )
@@ -213,11 +238,10 @@ class WP_Job_Manager_CPT {
213
  }
214
 
215
  /**
216
- * post_updated_messages function.
217
  *
218
- * @access public
219
- * @param mixed $messages
220
- * @return void
221
  */
222
  public function post_updated_messages( $messages ) {
223
  global $post, $post_ID, $wp_post_types;
@@ -241,7 +265,7 @@ class WP_Job_Manager_CPT {
241
  }
242
 
243
  /**
244
- * columns function.
245
  *
246
  * @param array $columns
247
  * @return array
@@ -253,8 +277,8 @@ class WP_Job_Manager_CPT {
253
 
254
  unset( $columns['title'], $columns['date'], $columns['author'] );
255
 
256
- $columns["job_listing_type"] = __( "Type", 'wp-job-manager' );
257
  $columns["job_position"] = __( "Position", 'wp-job-manager' );
 
258
  $columns["job_location"] = __( "Location", 'wp-job-manager' );
259
  $columns['job_status'] = '<span class="tips" data-tip="' . __( "Status", 'wp-job-manager' ) . '">' . __( "Status", 'wp-job-manager' ) . '</span>';
260
  $columns["job_posted"] = __( "Posted", 'wp-job-manager' );
@@ -276,11 +300,40 @@ class WP_Job_Manager_CPT {
276
  }
277
 
278
  /**
279
- * custom_columns function.
280
  *
281
  * @access public
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  * @param mixed $column
283
- * @return void
284
  */
285
  public function custom_columns( $column ) {
286
  global $post;
@@ -307,6 +360,7 @@ class WP_Job_Manager_CPT {
307
 
308
  the_company_logo();
309
  echo '</div>';
 
310
  break;
311
  case "job_location" :
312
  the_job_location( $post );
@@ -385,11 +439,10 @@ class WP_Job_Manager_CPT {
385
  }
386
 
387
  /**
388
- * sortable_columns function.
389
  *
390
- * @access public
391
  * @param mixed $columns
392
- * @return void
393
  */
394
  public function sortable_columns( $columns ) {
395
  $custom = array(
@@ -402,11 +455,10 @@ class WP_Job_Manager_CPT {
402
  }
403
 
404
  /**
405
- * sort_columns function.
406
  *
407
- * @access public
408
  * @param mixed $vars
409
- * @return void
410
  */
411
  public function sort_columns( $vars ) {
412
  if ( isset( $vars['orderby'] ) ) {
@@ -426,7 +478,8 @@ class WP_Job_Manager_CPT {
426
  }
427
 
428
  /**
429
- * Search custom fields as well as content.
 
430
  * @param WP_Query $wp
431
  */
432
  public function search_meta( $wp ) {
@@ -462,7 +515,8 @@ class WP_Job_Manager_CPT {
462
  }
463
 
464
  /**
465
- * Change the label when searching meta.
 
466
  * @param string $query
467
  * @return string
468
  */
@@ -476,10 +530,8 @@ class WP_Job_Manager_CPT {
476
  return wp_unslash( sanitize_text_field( $_GET['s'] ) );
477
  }
478
 
479
- /**
480
  * Adds post status to the "submitdiv" Meta Box and post type WP List Table screens. Based on https://gist.github.com/franz-josef-kaiser/2930190
481
- *
482
- * @return void
483
  */
484
  public function extend_submitdiv_post_status() {
485
  global $post, $post_type;
@@ -515,4 +567,4 @@ class WP_Job_Manager_CPT {
515
  }
516
  }
517
 
518
- new WP_Job_Manager_CPT();
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
+ * Handles actions and filters specific to the custom post type for Job Listings.
7
+ *
8
+ * @package wp-job-manager
9
+ * @since 1.0.0
10
  */
11
  class WP_Job_Manager_CPT {
12
 
13
  /**
14
+ * The single instance of the class.
15
  *
16
+ * @var self
17
+ * @since 1.26
18
+ */
19
+ private static $_instance = null;
20
+
21
+ /**
22
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
23
+ *
24
+ * @since 1.26
25
+ * @static
26
+ * @return self Main instance.
27
+ */
28
+ public static function instance() {
29
+ if ( is_null( self::$_instance ) ) {
30
+ self::$_instance = new self();
31
+ }
32
+ return self::$_instance;
33
+ }
34
+
35
+ /**
36
+ * Constructor.
37
  */
38
  public function __construct() {
39
  add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
40
  add_filter( 'manage_edit-job_listing_columns', array( $this, 'columns' ) );
41
+ add_filter( 'list_table_primary_column', array( $this, 'primary_column' ), 10, 2 );
42
+ add_filter( 'post_row_actions', array( $this, 'row_actions' ) );
43
  add_action( 'manage_job_listing_posts_custom_column', array( $this, 'custom_columns' ), 2 );
44
  add_filter( 'manage_edit-job_listing_sortable_columns', array( $this, 'sortable_columns' ) );
45
  add_filter( 'request', array( $this, 'sort_columns' ) );
62
  }
63
 
64
  /**
65
+ * Adds bulk actions to drop downs on Job Listing admin page.
66
  */
67
  public function add_bulk_actions() {
68
  global $post_type, $wp_post_types;;
83
  }
84
 
85
  /**
86
+ * Performs bulk actions on Job Listing admin page.
87
  */
88
  public function do_bulk_actions() {
89
  $wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
135
  }
136
 
137
  /**
138
+ * Approves a single job.
139
  */
140
  public function approve_job() {
141
  if ( ! empty( $_GET['approve_job'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'approve_job' ) && current_user_can( 'publish_post', $_GET['approve_job'] ) ) {
151
  }
152
 
153
  /**
154
+ * Shows a notice if we did a bulk approval action.
155
  */
156
  public function approved_notice() {
157
  global $post_type, $pagenow;
171
  }
172
 
173
  /**
174
+ * Shows a notice if we did a bulk expired action.
175
  */
176
  public function expired_notice() {
177
  global $post_type, $pagenow;
191
  }
192
 
193
  /**
194
+ * Shows category dropdown.
195
  */
196
  public function jobs_by_category() {
197
  global $typenow, $wp_query;
225
  }
226
 
227
  /**
228
+ * Filters page title placeholder text to show custom label.
229
  *
230
+ * @param string $text
231
+ * @param WP_Post|int $post
232
+ * @return string
233
  */
234
  public function enter_title_here( $text, $post ) {
235
  if ( $post->post_type == 'job_listing' )
238
  }
239
 
240
  /**
241
+ * Filters the post updated message array to add custom post type's messages.
242
  *
243
+ * @param array $messages
244
+ * @return array
 
245
  */
246
  public function post_updated_messages( $messages ) {
247
  global $post, $post_ID, $wp_post_types;
265
  }
266
 
267
  /**
268
+ * Adds columns to admin listing of Job Listings.
269
  *
270
  * @param array $columns
271
  * @return array
277
 
278
  unset( $columns['title'], $columns['date'], $columns['author'] );
279
 
 
280
  $columns["job_position"] = __( "Position", 'wp-job-manager' );
281
+ $columns["job_listing_type"] = __( "Type", 'wp-job-manager' );
282
  $columns["job_location"] = __( "Location", 'wp-job-manager' );
283
  $columns['job_status'] = '<span class="tips" data-tip="' . __( "Status", 'wp-job-manager' ) . '">' . __( "Status", 'wp-job-manager' ) . '</span>';
284
  $columns["job_posted"] = __( "Posted", 'wp-job-manager' );
300
  }
301
 
302
  /**
303
+ * This is required to make column responsive since WP 4.3
304
  *
305
  * @access public
306
+ * @param string $column
307
+ * @param string $screen
308
+ * @return string
309
+ */
310
+ public function primary_column( $column, $screen ) {
311
+ if ( 'edit-job_listing' === $screen ) {
312
+ $column = 'job_position';
313
+ }
314
+ return $column;
315
+ }
316
+
317
+ /**
318
+ * Removes all action links because WordPress add it to primary column.
319
+ * Note: Removing all actions also remove mobile "Show more details" toggle button.
320
+ * So the button need to be added manually in custom_columns callback for primary column.
321
+ *
322
+ * @access public
323
+ * @param array $actions
324
+ * @return array
325
+ */
326
+ public function row_actions( $actions ) {
327
+ if ( 'job_listing' == get_post_type() ) {
328
+ return array();
329
+ }
330
+ return $actions;
331
+ }
332
+
333
+ /**
334
+ * Displays the content for each custom column on the admin list for Job Listings.
335
+ *
336
  * @param mixed $column
 
337
  */
338
  public function custom_columns( $column ) {
339
  global $post;
360
 
361
  the_company_logo();
362
  echo '</div>';
363
+ echo '<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
364
  break;
365
  case "job_location" :
366
  the_job_location( $post );
439
  }
440
 
441
  /**
442
+ * Filters the list table sortable columns for the admin list of Job Listings.
443
  *
 
444
  * @param mixed $columns
445
+ * @return array
446
  */
447
  public function sortable_columns( $columns ) {
448
  $custom = array(
455
  }
456
 
457
  /**
458
+ * Sorts the admin listing of Job Listings by updating the main query in the request.
459
  *
 
460
  * @param mixed $vars
461
+ * @return array
462
  */
463
  public function sort_columns( $vars ) {
464
  if ( isset( $vars['orderby'] ) ) {
478
  }
479
 
480
  /**
481
+ * Searches custom fields as well as content.
482
+ *
483
  * @param WP_Query $wp
484
  */
485
  public function search_meta( $wp ) {
515
  }
516
 
517
  /**
518
+ * Changes the label when searching meta.
519
+ *
520
  * @param string $query
521
  * @return string
522
  */
530
  return wp_unslash( sanitize_text_field( $_GET['s'] ) );
531
  }
532
 
533
+ /**
534
  * Adds post status to the "submitdiv" Meta Box and post type WP List Table screens. Based on https://gist.github.com/franz-josef-kaiser/2930190
 
 
535
  */
536
  public function extend_submitdiv_post_status() {
537
  global $post, $post_type;
567
  }
568
  }
569
 
570
+ WP_Job_Manager_CPT::instance();
includes/admin/class-wp-job-manager-settings.php CHANGED
@@ -3,15 +3,37 @@
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
- * WP_Job_Manager_Settings class.
 
 
 
7
  */
8
  class WP_Job_Manager_Settings {
9
 
10
  /**
11
- * __construct function.
12
  *
13
- * @access public
14
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  */
16
  public function __construct() {
17
  $this->settings_group = 'job_manager';
@@ -19,10 +41,9 @@ class WP_Job_Manager_Settings {
19
  }
20
 
21
  /**
22
- * init_settings function.
23
  *
24
  * @access protected
25
- * @return void
26
  */
27
  protected function init_settings() {
28
  // Prepare roles option
@@ -58,11 +79,20 @@ class WP_Job_Manager_Settings {
58
  'type' => 'checkbox',
59
  'attributes' => array()
60
  ),
 
 
 
 
 
 
 
 
 
61
  array(
62
  'name' => 'job_manager_hide_expired_content',
63
  'std' => '1',
64
- 'label' => __( 'Expired Listings', 'wp-job-manager' ),
65
- 'cb_label' => __( 'Hide content within expired listings', 'wp-job-manager' ),
66
  'desc' => __( 'If enabled, the content within expired listings will be hidden. Otherwise, expired listings will be displayed as normal (without the application area).', 'wp-job-manager' ),
67
  'type' => 'checkbox',
68
  'attributes' => array()
@@ -125,6 +155,13 @@ class WP_Job_Manager_Settings {
125
  'type' => 'checkbox',
126
  'attributes' => array()
127
  ),
 
 
 
 
 
 
 
128
  ),
129
  ),
130
  'job_submission' => array(
@@ -235,10 +272,7 @@ class WP_Job_Manager_Settings {
235
  }
236
 
237
  /**
238
- * register_settings function.
239
- *
240
- * @access public
241
- * @return void
242
  */
243
  public function register_settings() {
244
  $this->init_settings();
@@ -253,10 +287,7 @@ class WP_Job_Manager_Settings {
253
  }
254
 
255
  /**
256
- * output function.
257
- *
258
- * @access public
259
- * @return void
260
  */
261
  public function output() {
262
  $this->init_settings();
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
+ * Handles the management of plugin settings.
7
+ *
8
+ * @package wp-job-manager
9
+ * @since 1.0.0
10
  */
11
  class WP_Job_Manager_Settings {
12
 
13
  /**
14
+ * The single instance of the class.
15
  *
16
+ * @var self
17
+ * @since 1.26
18
+ */
19
+ private static $_instance = null;
20
+
21
+ /**
22
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
23
+ *
24
+ * @since 1.26
25
+ * @static
26
+ * @return self Main instance.
27
+ */
28
+ public static function instance() {
29
+ if ( is_null( self::$_instance ) ) {
30
+ self::$_instance = new self();
31
+ }
32
+ return self::$_instance;
33
+ }
34
+
35
+ /**
36
+ * Constructor.
37
  */
38
  public function __construct() {
39
  $this->settings_group = 'job_manager';
41
  }
42
 
43
  /**
44
+ * Initializes the configuration for the plugin's setting fields.
45
  *
46
  * @access protected
 
47
  */
48
  protected function init_settings() {
49
  // Prepare roles option
79
  'type' => 'checkbox',
80
  'attributes' => array()
81
  ),
82
+ array(
83
+ 'name' => 'job_manager_hide_expired',
84
+ 'std' => get_option( 'job_manager_hide_expired_content' ) ? '1' : '0', // back compat
85
+ 'label' => __( 'Hide Expired Listings', 'wp-job-manager' ),
86
+ 'cb_label' => __( 'Hide expired listings in job archive/search', 'wp-job-manager' ),
87
+ 'desc' => __( 'If enabled, expired job listing is not searchable.', 'wp-job-manager' ),
88
+ 'type' => 'checkbox',
89
+ 'attributes' => array()
90
+ ),
91
  array(
92
  'name' => 'job_manager_hide_expired_content',
93
  'std' => '1',
94
+ 'label' => __( 'Hide Expired Listings Content', 'wp-job-manager' ),
95
+ 'cb_label' => __( 'Hide expired listing content in single job listing (singular)', 'wp-job-manager' ),
96
  'desc' => __( 'If enabled, the content within expired listings will be hidden. Otherwise, expired listings will be displayed as normal (without the application area).', 'wp-job-manager' ),
97
  'type' => 'checkbox',
98
  'attributes' => array()
155
  'type' => 'checkbox',
156
  'attributes' => array()
157
  ),
158
+ array(
159
+ 'name' => 'job_manager_google_maps_api_key',
160
+ 'std' => '',
161
+ 'label' => __( 'Google Maps API Key', 'wp-job-manager' ),
162
+ 'desc' => sprintf( __( 'Google requires an API key to retrieve location information for job listings. Acquire an API key from the <a href="%s">Google Maps API developer site</a>.', 'wp-job-manager' ), 'https://developers.google.com/maps/documentation/geocoding/get-api-key' ),
163
+ 'attributes' => array()
164
+ ),
165
  ),
166
  ),
167
  'job_submission' => array(
272
  }
273
 
274
  /**
275
+ * Registers the plugin's settings with WordPress's Settings API.
 
 
 
276
  */
277
  public function register_settings() {
278
  $this->init_settings();
287
  }
288
 
289
  /**
290
+ * Shows the plugin's settings page.
 
 
 
291
  */
292
  public function output() {
293
  $this->init_settings();
includes/admin/class-wp-job-manager-setup.php CHANGED
@@ -4,15 +4,37 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  }
5
 
6
  /**
7
- * WP_Job_Manager_Setup class.
 
 
 
8
  */
9
  class WP_Job_Manager_Setup {
10
 
11
  /**
12
- * __construct function.
13
  *
14
- * @access public
15
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  */
17
  public function __construct() {
18
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 );
@@ -23,27 +45,21 @@ class WP_Job_Manager_Setup {
23
  }
24
 
25
  /**
26
- * admin_menu function.
27
- *
28
- * @access public
29
- * @return void
30
  */
31
  public function admin_menu() {
32
  add_dashboard_page( __( 'Setup', 'wp-job-manager' ), __( 'Setup', 'wp-job-manager' ), 'manage_options', 'job-manager-setup', array( $this, 'output' ) );
33
  }
34
 
35
  /**
36
- * Add styles just for this page, and remove dashboard page links.
37
- *
38
- * @access public
39
- * @return void
40
  */
41
  public function admin_head() {
42
  remove_submenu_page( 'index.php', 'job-manager-setup' );
43
  }
44
 
45
  /**
46
- * Sends user to the setup page on first activation
47
  */
48
  public function redirect() {
49
  // Bail if no activation redirect transient is set
@@ -72,14 +88,15 @@ class WP_Job_Manager_Setup {
72
  }
73
 
74
  /**
75
- * Enqueue scripts for setup page
76
  */
77
  public function admin_enqueue_scripts() {
78
- wp_enqueue_style( 'job_manager_setup_css', JOB_MANAGER_PLUGIN_URL . '/assets/css/setup.css', array( 'dashicons' ) );
79
  }
80
 
81
  /**
82
- * Create a page.
 
83
  * @param string $title
84
  * @param string $content
85
  * @param string $option
@@ -103,7 +120,7 @@ class WP_Job_Manager_Setup {
103
  }
104
 
105
  /**
106
- * Output addons page
107
  */
108
  public function output() {
109
  $step = ! empty( $_GET['step'] ) ? absint( $_GET['step'] ) : 1;
@@ -243,7 +260,7 @@ class WP_Job_Manager_Setup {
243
  <p><?php _e( 'There are many ways to support open-source projects such as WP Job Manager, for example code contribution, translation, or even telling your friends how awesome the plugin (hopefully) is. Thanks in advance for your support - it is much appreciated!', 'wp-job-manager' ); ?></p>
244
  <ul>
245
  <li class="icon-review"><a href="https://wordpress.org/support/view/plugin-reviews/wp-job-manager#postform"><?php _e( 'Leave a positive review', 'wp-job-manager' ); ?></a></li>
246
- <li class="icon-localization"><a href="https://www.transifex.com/projects/p/wp-job-manager/"><?php _e( 'Contribute a localization', 'wp-job-manager' ); ?></a></li>
247
  <li class="icon-code"><a href="https://github.com/mikejolley/WP-Job-Manager"><?php _e( 'Contribute code or report a bug', 'wp-job-manager' ); ?></a></li>
248
  <li class="icon-forum"><a href="https://wordpress.org/support/plugin/wp-job-manager"><?php _e( 'Help other users on the forums', 'wp-job-manager' ); ?></a></li>
249
  </ul>
@@ -255,4 +272,4 @@ class WP_Job_Manager_Setup {
255
  }
256
  }
257
 
258
- new WP_Job_Manager_Setup();
4
  }
5
 
6
  /**
7
+ * Handles initial environment setup after plugin is first activated.
8
+ *
9
+ * @package wp-job-manager
10
+ * @since 1.16.0
11
  */
12
  class WP_Job_Manager_Setup {
13
 
14
  /**
15
+ * The single instance of the class.
16
  *
17
+ * @var self
18
+ * @since 1.26
19
+ */
20
+ private static $_instance = null;
21
+
22
+ /**
23
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
24
+ *
25
+ * @since 1.26
26
+ * @static
27
+ * @return self Main instance.
28
+ */
29
+ public static function instance() {
30
+ if ( is_null( self::$_instance ) ) {
31
+ self::$_instance = new self();
32
+ }
33
+ return self::$_instance;
34
+ }
35
+
36
+ /**
37
+ * Constructor.
38
  */
39
  public function __construct() {
40
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 );
45
  }
46
 
47
  /**
48
+ * Adds setup link to admin dashboard menu briefly so the page callback is registered.
 
 
 
49
  */
50
  public function admin_menu() {
51
  add_dashboard_page( __( 'Setup', 'wp-job-manager' ), __( 'Setup', 'wp-job-manager' ), 'manage_options', 'job-manager-setup', array( $this, 'output' ) );
52
  }
53
 
54
  /**
55
+ * Removes the setup link from admin dashboard menu so just the handler callback is registered.
 
 
 
56
  */
57
  public function admin_head() {
58
  remove_submenu_page( 'index.php', 'job-manager-setup' );
59
  }
60
 
61
  /**
62
+ * Sends user to the setup page on first activation.
63
  */
64
  public function redirect() {
65
  // Bail if no activation redirect transient is set
88
  }
89
 
90
  /**
91
+ * Enqueues scripts for setup page.
92
  */
93
  public function admin_enqueue_scripts() {
94
+ wp_enqueue_style( 'job_manager_setup_css', JOB_MANAGER_PLUGIN_URL . '/assets/css/setup.css', array( 'dashicons' ), JOB_MANAGER_VERSION );
95
  }
96
 
97
  /**
98
+ * Creates a page.
99
+ *
100
  * @param string $title
101
  * @param string $content
102
  * @param string $option
120
  }
121
 
122
  /**
123
+ * Displays setup page.
124
  */
125
  public function output() {
126
  $step = ! empty( $_GET['step'] ) ? absint( $_GET['step'] ) : 1;
260
  <p><?php _e( 'There are many ways to support open-source projects such as WP Job Manager, for example code contribution, translation, or even telling your friends how awesome the plugin (hopefully) is. Thanks in advance for your support - it is much appreciated!', 'wp-job-manager' ); ?></p>
261
  <ul>
262
  <li class="icon-review"><a href="https://wordpress.org/support/view/plugin-reviews/wp-job-manager#postform"><?php _e( 'Leave a positive review', 'wp-job-manager' ); ?></a></li>
263
+ <li class="icon-localization"><a href="https://translate.wordpress.org/projects/wp-plugins/wp-job-manager"><?php _e( 'Contribute a localization', 'wp-job-manager' ); ?></a></li>
264
  <li class="icon-code"><a href="https://github.com/mikejolley/WP-Job-Manager"><?php _e( 'Contribute code or report a bug', 'wp-job-manager' ); ?></a></li>
265
  <li class="icon-forum"><a href="https://wordpress.org/support/plugin/wp-job-manager"><?php _e( 'Help other users on the forums', 'wp-job-manager' ); ?></a></li>
266
  </ul>
272
  }
273
  }
274
 
275
+ WP_Job_Manager_Setup::instance();
includes/admin/class-wp-job-manager-writepanels.php CHANGED
@@ -1,13 +1,38 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
 
 
 
 
 
 
4
  class WP_Job_Manager_Writepanels {
5
 
6
  /**
7
- * __construct function.
8
  *
9
- * @access public
10
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  */
12
  public function __construct() {
13
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
@@ -16,10 +41,9 @@ class WP_Job_Manager_Writepanels {
16
  }
17
 
18
  /**
19
- * job_listing_fields function.
20
  *
21
- * @access public
22
- * @return void
23
  */
24
  public function job_listing_fields() {
25
  global $post;
@@ -85,8 +109,8 @@ class WP_Job_Manager_Writepanels {
85
  'priority' => 11,
86
  'classes' => array( 'job-manager-datepicker' ),
87
  /* translators: date format placeholder, see https://secure.php.net/date */
88
- 'placeholder' => _x( 'yyyy-mm-dd', 'Date format placeholder.', 'wp-job-manager' ),
89
- 'value' => metadata_exists( 'post', $post->ID, '_job_expires' ) ? get_post_meta( $post->ID, '_job_expires', true ) : calculate_job_expiry( $post->ID ),
90
  );
91
  }
92
  if ( $current_user->has_cap( 'edit_others_job_listings' ) ) {
@@ -105,7 +129,11 @@ class WP_Job_Manager_Writepanels {
105
  }
106
 
107
  /**
108
- * Sort array by priority value
 
 
 
 
109
  */
110
  protected function sort_by_priority( $a, $b ) {
111
  if ( ! isset( $a['priority'] ) || ! isset( $b['priority'] ) || $a['priority'] === $b['priority'] ) {
@@ -115,10 +143,7 @@ class WP_Job_Manager_Writepanels {
115
  }
116
 
117
  /**
118
- * add_meta_boxes function.
119
- *
120
- * @access public
121
- * @return void
122
  */
123
  public function add_meta_boxes() {
124
  global $wp_post_types;
@@ -128,24 +153,30 @@ class WP_Job_Manager_Writepanels {
128
  remove_meta_box( 'job_listing_typediv', 'job_listing', 'side');
129
  } elseif ( false == job_manager_multi_job_type() ) {
130
  remove_meta_box( 'job_listing_typediv', 'job_listing', 'side');
131
- add_meta_box( 'job_listing_type', __( 'Job Listings', 'wp-job-manager' ), array( $this, 'job_listing_metabox' ),'job_listing' ,'side','core');
 
132
  }
133
  }
134
 
135
- function job_listing_metabox( $post ) {
136
- //Set up the taxonomy object and get terms
 
 
 
 
 
137
  $taxonomy = 'job_listing_type';
138
- $tax = get_taxonomy( $taxonomy );//This is the taxonomy object
139
 
140
- //The name of the form
141
  $name = 'tax_input[' . $taxonomy . ']';
142
 
143
- //Get all the terms for this taxonomy
144
  $terms = get_terms( $taxonomy, array( 'hide_empty' => 0 ) );
145
  $postterms = get_the_terms( $post->ID, $taxonomy );
146
  $current = ( $postterms ? array_pop( $postterms ) : false );
147
  $current = ( $current ? $current->term_id : 0 );
148
- //Get current and popular terms
149
  $popular = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
150
  $postterms = get_the_terms( $post->ID,$taxonomy );
151
  $current = ($postterms ? array_pop($postterms) : false);
@@ -189,10 +220,10 @@ class WP_Job_Manager_Writepanels {
189
  }
190
 
191
  /**
192
- * input_file function.
193
  *
194
- * @param mixed $key
195
- * @param mixed $field
196
  */
197
  public static function input_file( $key, $field ) {
198
  global $thepostid;
@@ -228,10 +259,10 @@ class WP_Job_Manager_Writepanels {
228
  }
229
 
230
  /**
231
- * input_text function.
232
  *
233
- * @param mixed $key
234
- * @param mixed $field
235
  */
236
  public static function input_text( $key, $field ) {
237
  global $thepostid;
@@ -252,16 +283,16 @@ class WP_Job_Manager_Writepanels {
252
  ?>
253
  <p class="form-field">
254
  <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>
255
- <input type="text" name="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $classes ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" />
256
  </p>
257
  <?php
258
  }
259
 
260
  /**
261
- * input_text function.
262
  *
263
- * @param mixed $key
264
- * @param mixed $field
265
  */
266
  public static function input_textarea( $key, $field ) {
267
  global $thepostid;
@@ -283,10 +314,10 @@ class WP_Job_Manager_Writepanels {
283
  }
284
 
285
  /**
286
- * input_select function.
287
  *
288
- * @param mixed $key
289
- * @param mixed $field
290
  */
291
  public static function input_select( $key, $field ) {
292
  global $thepostid;
@@ -312,10 +343,10 @@ class WP_Job_Manager_Writepanels {
312
  }
313
 
314
  /**
315
- * input_select function.
316
  *
317
- * @param mixed $key
318
- * @param mixed $field
319
  */
320
  public static function input_multiselect( $key, $field ) {
321
  global $thepostid;
@@ -341,10 +372,10 @@ class WP_Job_Manager_Writepanels {
341
  }
342
 
343
  /**
344
- * input_checkbox function.
345
  *
346
- * @param mixed $key
347
- * @param mixed $field
348
  */
349
  public static function input_checkbox( $key, $field ) {
350
  global $thepostid;
@@ -367,10 +398,10 @@ class WP_Job_Manager_Writepanels {
367
  }
368
 
369
  /**
370
- * Box to choose who posted the job
371
  *
372
- * @param mixed $key
373
- * @param mixed $field
374
  */
375
  public static function input_author( $key, $field ) {
376
  global $thepostid, $post;
@@ -406,10 +437,10 @@ class WP_Job_Manager_Writepanels {
406
  }
407
 
408
  /**
409
- * input_radio function.
410
  *
411
- * @param mixed $key
412
- * @param mixed $field
413
  */
414
  public static function input_radio( $key, $field ) {
415
  global $thepostid;
@@ -434,11 +465,9 @@ class WP_Job_Manager_Writepanels {
434
  }
435
 
436
  /**
437
- * job_listing_data function.
438
  *
439
- * @access public
440
- * @param mixed $post
441
- * @return void
442
  */
443
  public function job_listing_data( $post ) {
444
  global $post, $thepostid;
@@ -467,12 +496,10 @@ class WP_Job_Manager_Writepanels {
467
  }
468
 
469
  /**
470
- * save_post function.
471
  *
472
- * @access public
473
- * @param mixed $post_id
474
- * @param mixed $post
475
- * @return void
476
  */
477
  public function save_post( $post_id, $post ) {
478
  if ( empty( $post_id ) || empty( $post ) || empty( $_POST ) ) return;
@@ -487,12 +514,10 @@ class WP_Job_Manager_Writepanels {
487
  }
488
 
489
  /**
490
- * save_job_listing_data function.
491
  *
492
- * @access public
493
- * @param mixed $post_id
494
- * @param mixed $post
495
- * @return void
496
  */
497
  public function save_job_listing_data( $post_id, $post ) {
498
  global $wpdb;
@@ -508,7 +533,7 @@ class WP_Job_Manager_Writepanels {
508
  if ( ! empty( $_POST[ $key ] ) ) {
509
  update_post_meta( $post_id, $key, date( 'Y-m-d', strtotime( sanitize_text_field( $_POST[ $key ] ) ) ) );
510
  } else {
511
- update_post_meta( $post_id, $key, '' );
512
  }
513
  }
514
 
@@ -526,7 +551,7 @@ class WP_Job_Manager_Writepanels {
526
  }
527
 
528
  elseif ( '_application' === $key ) {
529
- update_post_meta( $post_id, $key, sanitize_text_field( urldecode( $_POST[ $key ] ) ) );
530
  }
531
 
532
  // Everything else
@@ -556,7 +581,37 @@ class WP_Job_Manager_Writepanels {
556
  }
557
  }
558
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
559
  }
560
  }
561
 
562
- new WP_Job_Manager_Writepanels();
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
+ /**
5
+ * Handles the management of Job Listing meta fields.
6
+ *
7
+ * @package wp-job-manager
8
+ * @since 1.0.0
9
+ */
10
  class WP_Job_Manager_Writepanels {
11
 
12
  /**
13
+ * The single instance of the class.
14
  *
15
+ * @var self
16
+ * @since 1.26
17
+ */
18
+ private static $_instance = null;
19
+
20
+ /**
21
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
22
+ *
23
+ * @since 1.26
24
+ * @static
25
+ * @return self Main instance.
26
+ */
27
+ public static function instance() {
28
+ if ( is_null( self::$_instance ) ) {
29
+ self::$_instance = new self();
30
+ }
31
+ return self::$_instance;
32
+ }
33
+
34
+ /**
35
+ * Constructor.
36
  */
37
  public function __construct() {
38
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
41
  }
42
 
43
  /**
44
+ * Returns configuration for custom fields on Job Listing posts.
45
  *
46
+ * @return array
 
47
  */
48
  public function job_listing_fields() {
49
  global $post;
109
  'priority' => 11,
110
  'classes' => array( 'job-manager-datepicker' ),
111
  /* translators: date format placeholder, see https://secure.php.net/date */
112
+ 'placeholder' => metadata_exists( 'post', $post->ID, '_job_expires' ) ? _x( 'yyyy-mm-dd', 'Date format placeholder.', 'wp-job-manager' ) : calculate_job_expiry( $post->ID ),
113
+ 'value' => get_post_meta( $post->ID, '_job_expires', true ),
114
  );
115
  }
116
  if ( $current_user->has_cap( 'edit_others_job_listings' ) ) {
129
  }
130
 
131
  /**
132
+ * Sorts array of custom fields by priority value.
133
+ *
134
+ * @param array $a
135
+ * @param array $b
136
+ * @return int
137
  */
138
  protected function sort_by_priority( $a, $b ) {
139
  if ( ! isset( $a['priority'] ) || ! isset( $b['priority'] ) || $a['priority'] === $b['priority'] ) {
143
  }
144
 
145
  /**
146
+ * Handles the hooks to add custom field meta boxes.
 
 
 
147
  */
148
  public function add_meta_boxes() {
149
  global $wp_post_types;
153
  remove_meta_box( 'job_listing_typediv', 'job_listing', 'side');
154
  } elseif ( false == job_manager_multi_job_type() ) {
155
  remove_meta_box( 'job_listing_typediv', 'job_listing', 'side');
156
+ $job_listing_type = get_taxonomy( 'job_listing_type' );
157
+ add_meta_box( 'job_listing_type', $job_listing_type->labels->menu_name, array( $this, 'job_listing_metabox' ),'job_listing' ,'side','core');
158
  }
159
  }
160
 
161
+ /**
162
+ * Displays job listing metabox.
163
+ *
164
+ * @param int|WP_Post $post
165
+ */
166
+ public function job_listing_metabox( $post ) {
167
+ // Set up the taxonomy object and get terms
168
  $taxonomy = 'job_listing_type';
169
+ $tax = get_taxonomy( $taxonomy );// This is the taxonomy object
170
 
171
+ // The name of the form
172
  $name = 'tax_input[' . $taxonomy . ']';
173
 
174
+ // Get all the terms for this taxonomy
175
  $terms = get_terms( $taxonomy, array( 'hide_empty' => 0 ) );
176
  $postterms = get_the_terms( $post->ID, $taxonomy );
177
  $current = ( $postterms ? array_pop( $postterms ) : false );
178
  $current = ( $current ? $current->term_id : 0 );
179
+ // Get current and popular terms
180
  $popular = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );
181
  $postterms = get_the_terms( $post->ID,$taxonomy );
182
  $current = ($postterms ? array_pop($postterms) : false);
220
  }
221
 
222
  /**
223
+ * Displays label and file input field.
224
  *
225
+ * @param string $key
226
+ * @param array $field
227
  */
228
  public static function input_file( $key, $field ) {
229
  global $thepostid;
259
  }
260
 
261
  /**
262
+ * Displays label and text input field.
263
  *
264
+ * @param string $key
265
+ * @param array $field
266
  */
267
  public static function input_text( $key, $field ) {
268
  global $thepostid;
283
  ?>
284
  <p class="form-field">
285
  <label for="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $field['label'] ) ; ?>: <?php if ( ! empty( $field['description'] ) ) : ?><span class="tips" data-tip="<?php echo esc_attr( $field['description'] ); ?>">[?]</span><?php endif; ?></label>
286
+ <input type="text" autocomplete="off" name="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $classes ); ?>" id="<?php echo esc_attr( $key ); ?>" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" />
287
  </p>
288
  <?php
289
  }
290
 
291
  /**
292
+ * Displays label and textarea input field.
293
  *
294
+ * @param string $key
295
+ * @param array $field
296
  */
297
  public static function input_textarea( $key, $field ) {
298
  global $thepostid;
314
  }
315
 
316
  /**
317
+ * Displays label and select input field.
318
  *
319
+ * @param string $key
320
+ * @param array $field
321
  */
322
  public static function input_select( $key, $field ) {
323
  global $thepostid;
343
  }
344
 
345
  /**
346
+ * Displays label and multi-select input field.
347
  *
348
+ * @param string $key
349
+ * @param array $field
350
  */
351
  public static function input_multiselect( $key, $field ) {
352
  global $thepostid;
372
  }
373
 
374
  /**
375
+ * Displays label and checkbox input field.
376
  *
377
+ * @param string $key
378
+ * @param array $field
379
  */
380
  public static function input_checkbox( $key, $field ) {
381
  global $thepostid;
398
  }
399
 
400
  /**
401
+ * Displays label and author select field.
402
  *
403
+ * @param string $key
404
+ * @param array $field
405
  */
406
  public static function input_author( $key, $field ) {
407
  global $thepostid, $post;
437
  }
438
 
439
  /**
440
+ * Displays label and radio input field.
441
  *
442
+ * @param string $key
443
+ * @param array $field
444
  */
445
  public static function input_radio( $key, $field ) {
446
  global $thepostid;
465
  }
466
 
467
  /**
468
+ * Displays metadata fields for Job Listings.
469
  *
470
+ * @param int|WP_Post $post
 
 
471
  */
472
  public function job_listing_data( $post ) {
473
  global $post, $thepostid;
496
  }
497
 
498
  /**
499
+ * Handles `save_post` action.
500
  *
501
+ * @param int $post_id
502
+ * @param WP_Post $post
 
 
503
  */
504
  public function save_post( $post_id, $post ) {
505
  if ( empty( $post_id ) || empty( $post ) || empty( $_POST ) ) return;
514
  }
515
 
516
  /**
517
+ * Handles the actual saving of job listing data fields.
518
  *
519
+ * @param int $post_id
520
+ * @param WP_Post $post (Unused)
 
 
521
  */
522
  public function save_job_listing_data( $post_id, $post ) {
523
  global $wpdb;
533
  if ( ! empty( $_POST[ $key ] ) ) {
534
  update_post_meta( $post_id, $key, date( 'Y-m-d', strtotime( sanitize_text_field( $_POST[ $key ] ) ) ) );
535
  } else {
536
+ update_post_meta( $post_id, $key, calculate_job_expiry( $post_id ) );
537
  }
538
  }
539
 
551
  }
552
 
553
  elseif ( '_application' === $key ) {
554
+ update_post_meta( $post_id, $key, sanitize_text_field( is_email( $_POST[ $key ] ) ? $_POST[ $key ] : urldecode( $_POST[ $key ] ) ) );
555
  }
556
 
557
  // Everything else
581
  }
582
  }
583
  }
584
+
585
+ /* Set Post Status To Expired If Already Expired */
586
+ $expiry_date = get_post_meta( $post_id, '_job_expires', true );
587
+ $today_date = date( 'Y-m-d', current_time( 'timestamp' ) );
588
+ $is_job_listing_expired = $expiry_date && $today_date > $expiry_date;
589
+ if( $is_job_listing_expired ) {
590
+ remove_action( 'job_manager_save_job_listing', array( $this, 'save_job_listing_data' ), 20, 2 );
591
+ if ( $this->is_job_listing_being_reactivated() ) {
592
+ update_post_meta( $post_id, '_job_expires', calculate_job_expiry( $post_id ) );
593
+ } else {
594
+ $job_data = array(
595
+ 'ID' => $post_id,
596
+ 'post_status' => 'expired',
597
+ );
598
+ wp_update_post( $job_data );
599
+ }
600
+ add_action( 'job_manager_save_job_listing', array( $this, 'save_job_listing_data' ), 20, 2 );
601
+ }
602
+ }
603
+
604
+ /**
605
+ * Checks if the job listing is being reactivated from an expired state.
606
+ *
607
+ * @return bool True if being reactivated.
608
+ */
609
+ protected function is_job_listing_being_reactivated() {
610
+ return isset( $_POST['post_status'] )
611
+ && isset( $_POST['original_post_status'] )
612
+ && 'expired' === $_POST['original_post_status']
613
+ && 'publish' === $_POST['post_status'];
614
  }
615
  }
616
 
617
+ WP_Job_Manager_Writepanels::instance();
includes/class-wp-job-manager-ajax.php CHANGED
@@ -1,18 +1,45 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 
 
4
 
5
  /**
6
- * WP_Job_Manager_Ajax class.
 
 
 
7
  */
8
  class WP_Job_Manager_Ajax {
9
 
10
  /**
11
- * Constructor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  */
13
  public function __construct() {
14
- add_action( 'init', array( __CLASS__, 'add_endpoint') );
15
- add_action( 'template_redirect', array( __CLASS__, 'do_jm_ajax'), 0 );
16
 
17
  // JM Ajax endpoints
18
  add_action( 'job_manager_ajax_get_listings', array( $this, 'get_listings' ) );
@@ -26,7 +53,7 @@ class WP_Job_Manager_Ajax {
26
  }
27
 
28
  /**
29
- * Add our endpoint for frontend ajax requests
30
  */
31
  public static function add_endpoint() {
32
  add_rewrite_tag( '%jm-ajax%', '([^/]*)' );
@@ -35,9 +62,10 @@ class WP_Job_Manager_Ajax {
35
  }
36
 
37
  /**
38
- * Get JM Ajax Endpoint
39
- * @param string $request Optional
40
- * @param string $ssl Optional
 
41
  * @return string
42
  */
43
  public static function get_endpoint( $request = '%%endpoint%%', $ssl = null ) {
@@ -52,7 +80,7 @@ class WP_Job_Manager_Ajax {
52
  }
53
 
54
  /**
55
- * Check for WC Ajax request and fire action
56
  */
57
  public static function do_jm_ajax() {
58
  global $wp_query;
@@ -61,21 +89,27 @@ class WP_Job_Manager_Ajax {
61
  $wp_query->set( 'jm-ajax', sanitize_text_field( $_GET['jm-ajax'] ) );
62
  }
63
 
64
- if ( $action = $wp_query->get( 'jm-ajax' ) ) {
65
- if ( ! defined( 'DOING_AJAX' ) ) {
66
  define( 'DOING_AJAX', true );
67
  }
68
 
69
  // Not home - this is an ajax endpoint
70
  $wp_query->is_home = false;
71
 
72
- do_action( 'job_manager_ajax_' . sanitize_text_field( $action ) );
73
- die();
74
- }
 
 
 
 
 
 
75
  }
76
 
77
  /**
78
- * Get listings via ajax
79
  */
80
  public function get_listings() {
81
  global $wp_post_types;
@@ -103,7 +137,7 @@ class WP_Job_Manager_Ajax {
103
  'orderby' => $orderby,
104
  'order' => sanitize_text_field( $_REQUEST['order'] ),
105
  'offset' => ( absint( $_REQUEST['page'] ) - 1 ) * absint( $_REQUEST['per_page'] ),
106
- 'posts_per_page' => absint( $_REQUEST['per_page'] )
107
  );
108
 
109
  if ( isset( $_REQUEST['filled'] ) && ( $_REQUEST['filled'] === 'true' || $_REQUEST['filled'] === 'false' ) ) {
@@ -115,88 +149,48 @@ class WP_Job_Manager_Ajax {
115
  $args['orderby'] = 'featured' === $orderby ? 'date' : $orderby;
116
  }
117
 
118
- ob_start();
119
-
 
 
 
 
 
120
  $jobs = get_job_listings( apply_filters( 'job_manager_get_listings_args', $args ) );
121
 
122
- $result['found_jobs'] = false;
123
-
124
- if ( $jobs->have_posts() ) : $result['found_jobs'] = true; ?>
125
-
126
- <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
127
-
128
- <?php get_job_manager_template_part( 'content', 'job_listing' ); ?>
129
-
130
- <?php endwhile; ?>
131
-
132
- <?php else : ?>
133
-
134
- <?php get_job_manager_template_part( 'content', 'no-jobs-found' ); ?>
135
-
136
- <?php endif;
137
-
138
- $result['html'] = ob_get_clean();
139
- $result['showing'] = array();
140
-
141
- // Generate 'showing' text
142
- $showing_types = array();
143
- $unmatched = false;
144
-
145
- foreach ( $types as $type ) {
146
- if ( is_array( $filter_job_types ) && in_array( $type->slug, $filter_job_types ) ) {
147
- $showing_types[] = $type->name;
148
- } else {
149
- $unmatched = true;
150
- }
151
- }
152
-
153
- if ( sizeof( $showing_types ) == 1 ) {
154
- $result['showing'][] = implode( ', ', $showing_types );
155
- } elseif ( $unmatched && $showing_types ) {
156
- $last_type = array_pop( $showing_types );
157
- $result['showing'][] = implode( ', ', $showing_types ) . " &amp; $last_type";
158
- }
159
-
160
- if ( $search_categories ) {
161
- $showing_categories = array();
162
-
163
- foreach ( $search_categories as $category ) {
164
- $category_object = get_term_by( is_numeric( $category ) ? 'id' : 'slug', $category, 'job_listing_category' );
165
-
166
- if ( ! is_wp_error( $category_object ) ) {
167
- $showing_categories[] = $category_object->name;
168
- }
169
- }
170
-
171
- $result['showing'][] = implode( ', ', $showing_categories );
172
- }
173
-
174
- if ( $search_keywords ) {
175
- $result['showing'][] = '&ldquo;' . $search_keywords . '&rdquo;';
176
- }
177
-
178
- $result['showing'][] = $post_type_label;
179
-
180
- if ( $search_location ) {
181
- $result['showing'][] = sprintf( __( 'located in &ldquo;%s&rdquo;', 'wp-job-manager' ), $search_location );
182
- }
183
-
184
- if ( 1 === sizeof( $result['showing'] ) ) {
185
- $result['showing_all'] = true;
186
- }
187
 
188
  if ( $jobs->post_count && ( $search_location || $search_keywords || $search_categories ) ) {
189
  $message = sprintf( _n( 'Search completed. Found %d matching record.', 'Search completed. Found %d matching records.', $jobs->post_count, 'wp-job-manager' ), $jobs->post_count );
190
  $result['showing_all'] = true;
191
  } else {
192
- $message = "";
193
  }
194
-
195
  $search_values = array(
196
- 'location' => $search_location,
197
- 'keywords' => $search_keywords,
198
- 'categories' => $search_categories
199
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  $result['showing'] = apply_filters( 'job_manager_get_listings_custom_filter_text', $message, $search_values );
201
 
202
  // Generate RSS link
@@ -204,35 +198,87 @@ class WP_Job_Manager_Ajax {
204
  'filter_job_types' => $filter_job_types,
205
  'search_location' => $search_location,
206
  'search_categories' => $search_categories,
207
- 'search_keywords' => $search_keywords
208
  ) );
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  // Generate pagination
211
  if ( isset( $_REQUEST['show_pagination'] ) && $_REQUEST['show_pagination'] === 'true' ) {
212
  $result['pagination'] = get_job_listing_pagination( $jobs->max_num_pages, absint( $_REQUEST['page'] ) );
213
  }
214
 
215
- $result['max_num_pages'] = $jobs->max_num_pages;
216
-
217
  wp_send_json( apply_filters( 'job_manager_get_listings_result', $result, $jobs ) );
218
  }
219
 
220
  /**
221
- * Upload file via ajax
222
  *
223
  * No nonce field since the form may be statically cached.
224
  */
225
  public function upload_file() {
226
- $data = array( 'files' => array() );
 
 
227
 
228
  if ( ! empty( $_FILES ) ) {
229
  foreach ( $_FILES as $file_key => $file ) {
230
  $files_to_upload = job_manager_prepare_uploaded_files( $file );
231
  foreach ( $files_to_upload as $file_to_upload ) {
232
- $uploaded_file = job_manager_upload_file( $file_to_upload, array( 'file_key' => $file_key ) );
 
 
233
 
234
  if ( is_wp_error( $uploaded_file ) ) {
235
- $data['files'][] = array( 'error' => $uploaded_file->get_error_message() );
 
 
236
  } else {
237
  $data['files'][] = $uploaded_file;
238
  }
@@ -244,4 +290,4 @@ class WP_Job_Manager_Ajax {
244
  }
245
  }
246
 
247
- new WP_Job_Manager_Ajax();
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly
5
+ }
6
 
7
  /**
8
+ * Handles Job Manager's Ajax endpoints.
9
+ *
10
+ * @package wp-job-manager
11
+ * @since 1.0.0
12
  */
13
  class WP_Job_Manager_Ajax {
14
 
15
  /**
16
+ * The single instance of the class.
17
+ *
18
+ * @var self
19
+ * @since 1.26
20
+ */
21
+ private static $_instance = null;
22
+
23
+ /**
24
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
25
+ *
26
+ * @since 1.26
27
+ * @static
28
+ * @return self Main instance.
29
+ */
30
+ public static function instance() {
31
+ if ( is_null( self::$_instance ) ) {
32
+ self::$_instance = new self();
33
+ }
34
+ return self::$_instance;
35
+ }
36
+
37
+ /**
38
+ * Constructor.
39
  */
40
  public function __construct() {
41
+ add_action( 'init', array( __CLASS__, 'add_endpoint' ) );
42
+ add_action( 'template_redirect', array( __CLASS__, 'do_jm_ajax' ), 0 );
43
 
44
  // JM Ajax endpoints
45
  add_action( 'job_manager_ajax_get_listings', array( $this, 'get_listings' ) );
53
  }
54
 
55
  /**
56
+ * Adds endpoint for frontend Ajax requests.
57
  */
58
  public static function add_endpoint() {
59
  add_rewrite_tag( '%jm-ajax%', '([^/]*)' );
62
  }
63
 
64
  /**
65
+ * Gets Job Manager's Ajax Endpoint.
66
+ *
67
+ * @param string $request Optional
68
+ * @param string $ssl (Unused) Optional
69
  * @return string
70
  */
71
  public static function get_endpoint( $request = '%%endpoint%%', $ssl = null ) {
80
  }
81
 
82
  /**
83
+ * Performs Job Manager's Ajax actions.
84
  */
85
  public static function do_jm_ajax() {
86
  global $wp_query;
89
  $wp_query->set( 'jm-ajax', sanitize_text_field( $_GET['jm-ajax'] ) );
90
  }
91
 
92
+ if ( $action = $wp_query->get( 'jm-ajax' ) ) {
93
+ if ( ! defined( 'DOING_AJAX' ) ) {
94
  define( 'DOING_AJAX', true );
95
  }
96
 
97
  // Not home - this is an ajax endpoint
98
  $wp_query->is_home = false;
99
 
100
+ /**
101
+ * Performs an Ajax action.
102
+ * The dynamic part of the action, $action, is the predefined Ajax action to be performed.
103
+ *
104
+ * @since 1.23.0
105
+ */
106
+ do_action( 'job_manager_ajax_' . sanitize_text_field( $action ) );
107
+ wp_die();
108
+ }
109
  }
110
 
111
  /**
112
+ * Returns Job Listings for Ajax endpoint.
113
  */
114
  public function get_listings() {
115
  global $wp_post_types;
137
  'orderby' => $orderby,
138
  'order' => sanitize_text_field( $_REQUEST['order'] ),
139
  'offset' => ( absint( $_REQUEST['page'] ) - 1 ) * absint( $_REQUEST['per_page'] ),
140
+ 'posts_per_page' => absint( $_REQUEST['per_page'] ),
141
  );
142
 
143
  if ( isset( $_REQUEST['filled'] ) && ( $_REQUEST['filled'] === 'true' || $_REQUEST['filled'] === 'false' ) ) {
149
  $args['orderby'] = 'featured' === $orderby ? 'date' : $orderby;
150
  }
151
 
152
+ /**
153
+ * Get the arguments to use when building the Job Listing WP Query.
154
+ *
155
+ * @since 1.0.0
156
+ *
157
+ * @param array $args Arguments used for generating Job Listing query (see `get_job_listings()`)
158
+ */
159
  $jobs = get_job_listings( apply_filters( 'job_manager_get_listings_args', $args ) );
160
 
161
+ $result = array(
162
+ 'found_jobs' => $jobs->have_posts(),
163
+ 'showing' => '',
164
+ 'max_num_pages' => $jobs->max_num_pages,
165
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
 
167
  if ( $jobs->post_count && ( $search_location || $search_keywords || $search_categories ) ) {
168
  $message = sprintf( _n( 'Search completed. Found %d matching record.', 'Search completed. Found %d matching records.', $jobs->post_count, 'wp-job-manager' ), $jobs->post_count );
169
  $result['showing_all'] = true;
170
  } else {
171
+ $message = '';
172
  }
173
+
174
  $search_values = array(
175
+ 'location' => $search_location,
176
+ 'keywords' => $search_keywords,
177
+ 'categories' => $search_categories,
178
+ );
179
+
180
+ /**
181
+ * Filter the message that describes the results of the search query.
182
+ *
183
+ * @since 1.0.0
184
+ *
185
+ * @param string $message Default message that is generated when posts are found.
186
+ * @param array $search_values {
187
+ * Helpful values often used in the generation of this message.
188
+ *
189
+ * @type string $location Query used to filter by job listing location.
190
+ * @type string $keywords Query used to filter by general keywords.
191
+ * @type array $categories List of the categories to filter by.
192
+ * }
193
+ */
194
  $result['showing'] = apply_filters( 'job_manager_get_listings_custom_filter_text', $message, $search_values );
195
 
196
  // Generate RSS link
198
  'filter_job_types' => $filter_job_types,
199
  'search_location' => $search_location,
200
  'search_categories' => $search_categories,
201
+ 'search_keywords' => $search_keywords,
202
  ) );
203
 
204
+ /**
205
+ * Send back a response to the AJAX request without creating HTML.
206
+ *
207
+ * @since 1.26.0
208
+ *
209
+ * @param array $result
210
+ * @param WP_Query $jobs
211
+ * @return bool True by default. Change to false to halt further response.
212
+ */
213
+ if ( true !== apply_filters( 'job_manager_ajax_get_jobs_html_results', true, $result, $jobs ) ) {
214
+ /**
215
+ * Filters the results of the job listing Ajax query to be sent back to the client.
216
+ *
217
+ * @since 1.0.0
218
+ *
219
+ * @param array $result {
220
+ * Package of the query results along with meta information.
221
+ *
222
+ * @type bool $found_jobs Whether or not jobs were found in the query.
223
+ * @type string $showing Description of the search query and results.
224
+ * @type int $max_num_pages Number of pages in the search result.
225
+ * @type string $html HTML representation of the search results (only if filter
226
+ * `job_manager_ajax_get_jobs_html_results` returns true).
227
+ * @type array $pagination Pagination links to use for stepping through filter results.
228
+ * }
229
+ */
230
+ return wp_send_json( apply_filters( 'job_manager_get_listings_result', $result, $jobs ) );
231
+ }
232
+
233
+ ob_start();
234
+
235
+ if ( $result['found_jobs'] ) : ?>
236
+
237
+ <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
238
+
239
+ <?php get_job_manager_template_part( 'content', 'job_listing' ); ?>
240
+
241
+ <?php endwhile; ?>
242
+
243
+ <?php else : ?>
244
+
245
+ <?php get_job_manager_template_part( 'content', 'no-jobs-found' ); ?>
246
+
247
+ <?php endif;
248
+
249
+ $result['html'] = ob_get_clean();
250
+
251
  // Generate pagination
252
  if ( isset( $_REQUEST['show_pagination'] ) && $_REQUEST['show_pagination'] === 'true' ) {
253
  $result['pagination'] = get_job_listing_pagination( $jobs->max_num_pages, absint( $_REQUEST['page'] ) );
254
  }
255
 
256
+ /** This filter is documented in includes/class-wp-job-manager-ajax.php (above) */
 
257
  wp_send_json( apply_filters( 'job_manager_get_listings_result', $result, $jobs ) );
258
  }
259
 
260
  /**
261
+ * Uploads file from an Ajax request.
262
  *
263
  * No nonce field since the form may be statically cached.
264
  */
265
  public function upload_file() {
266
+ $data = array(
267
+ 'files' => array(),
268
+ );
269
 
270
  if ( ! empty( $_FILES ) ) {
271
  foreach ( $_FILES as $file_key => $file ) {
272
  $files_to_upload = job_manager_prepare_uploaded_files( $file );
273
  foreach ( $files_to_upload as $file_to_upload ) {
274
+ $uploaded_file = job_manager_upload_file( $file_to_upload, array(
275
+ 'file_key' => $file_key,
276
+ ) );
277
 
278
  if ( is_wp_error( $uploaded_file ) ) {
279
+ $data['files'][] = array(
280
+ 'error' => $uploaded_file->get_error_message(),
281
+ );
282
  } else {
283
  $data['files'][] = $uploaded_file;
284
  }
290
  }
291
  }
292
 
293
+ WP_Job_Manager_Ajax::instance();
includes/class-wp-job-manager-api.php CHANGED
@@ -1,30 +1,52 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 
 
4
 
5
  /**
6
- * WP_Job_Manager_API API
7
  *
8
- * This API class handles API requests.
 
9
  */
10
  class WP_Job_Manager_API {
11
 
12
  /**
13
- * __construct function.
14
  *
15
- * @access public
16
- * @return void
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  */
18
  public function __construct() {
19
- add_filter( 'query_vars', array( $this, 'add_query_vars'), 0 );
20
- add_action( 'parse_request', array( $this, 'api_requests'), 0 );
21
  }
22
 
23
  /**
24
- * add_query_vars function.
25
  *
26
- * @access public
27
- * @return void
28
  */
29
  public function add_query_vars( $vars ) {
30
  $vars[] = 'job-manager-api';
@@ -32,10 +54,7 @@ class WP_Job_Manager_API {
32
  }
33
 
34
  /**
35
- * add_endpoint function.
36
- *
37
- * @access public
38
- * @return void
39
  */
40
  public function add_endpoint() {
41
  add_rewrite_endpoint( 'job-manager-api', EP_ALL );
@@ -43,15 +62,13 @@ class WP_Job_Manager_API {
43
 
44
  /**
45
  * API request - Trigger any API requests (handy for third party plugins/gateways).
46
- *
47
- * @access public
48
- * @return void
49
  */
50
  public function api_requests() {
51
  global $wp;
52
 
53
- if ( ! empty( $_GET['job-manager-api'] ) )
54
  $wp->query_vars['job-manager-api'] = $_GET['job-manager-api'];
 
55
 
56
  if ( ! empty( $wp->query_vars['job-manager-api'] ) ) {
57
  // Buffer, we won't want any output here
@@ -61,17 +78,23 @@ class WP_Job_Manager_API {
61
  $api = strtolower( esc_attr( $wp->query_vars['job-manager-api'] ) );
62
 
63
  // Load class if exists
64
- if ( has_action( 'job_manager_api_' . $api ) && class_exists( $api ) )
65
  $api_class = new $api();
 
66
 
67
- // Trigger actions
 
 
 
 
 
68
  do_action( 'job_manager_api_' . $api );
69
 
70
  // Done, clear buffer and exit
71
  ob_end_clean();
72
- die('1');
73
  }
74
  }
75
  }
76
 
77
- new WP_Job_Manager_API();
1
  <?php
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly
5
+ }
6
 
7
  /**
8
+ * Handles API requests for WP Job Manager.
9
  *
10
+ * @package wp-job-manager
11
+ * @since 1.0.0
12
  */
13
  class WP_Job_Manager_API {
14
 
15
  /**
16
+ * The single instance of the class.
17
  *
18
+ * @var self
19
+ * @since 1.26
20
+ */
21
+ private static $_instance = null;
22
+
23
+ /**
24
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
25
+ *
26
+ * @since 1.26
27
+ * @static
28
+ * @return self Main instance.
29
+ */
30
+ public static function instance() {
31
+ if ( is_null( self::$_instance ) ) {
32
+ self::$_instance = new self();
33
+ }
34
+ return self::$_instance;
35
+ }
36
+
37
+ /**
38
+ * Constructor.
39
  */
40
  public function __construct() {
41
+ add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );
42
+ add_action( 'parse_request', array( $this, 'api_requests' ), 0 );
43
  }
44
 
45
  /**
46
+ * Adds query vars used in API calls.
47
  *
48
+ * @param array $vars the query vars
49
+ * @return array
50
  */
51
  public function add_query_vars( $vars ) {
52
  $vars[] = 'job-manager-api';
54
  }
55
 
56
  /**
57
+ * Adds endpoint for API requests.
 
 
 
58
  */
59
  public function add_endpoint() {
60
  add_rewrite_endpoint( 'job-manager-api', EP_ALL );
62
 
63
  /**
64
  * API request - Trigger any API requests (handy for third party plugins/gateways).
 
 
 
65
  */
66
  public function api_requests() {
67
  global $wp;
68
 
69
+ if ( ! empty( $_GET['job-manager-api'] ) ) {
70
  $wp->query_vars['job-manager-api'] = $_GET['job-manager-api'];
71
+ }
72
 
73
  if ( ! empty( $wp->query_vars['job-manager-api'] ) ) {
74
  // Buffer, we won't want any output here
78
  $api = strtolower( esc_attr( $wp->query_vars['job-manager-api'] ) );
79
 
80
  // Load class if exists
81
+ if ( has_action( 'job_manager_api_' . $api ) && class_exists( $api ) ) {
82
  $api_class = new $api();
83
+ }
84
 
85
+ /**
86
+ * Performs an API action.
87
+ * The dynamic part of the action, $api, is the API action.
88
+ *
89
+ * @since 1.0.0
90
+ */
91
  do_action( 'job_manager_api_' . $api );
92
 
93
  // Done, clear buffer and exit
94
  ob_end_clean();
95
+ wp_die();
96
  }
97
  }
98
  }
99
 
100
+ WP_Job_Manager_API::instance();
includes/class-wp-job-manager-cache-helper.php CHANGED
@@ -5,10 +5,16 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  }
6
 
7
  /**
8
- * WP_Job_Manager_Cache_Helper class.
 
 
 
9
  */
10
  class WP_Job_Manager_Cache_Helper {
11
 
 
 
 
12
  public static function init() {
13
  add_action( 'save_post', array( __CLASS__, 'flush_get_job_listings_cache' ) );
14
  add_action( 'job_manager_my_job_do_action', array( __CLASS__, 'job_manager_my_job_do_action' ) );
@@ -20,7 +26,9 @@ class WP_Job_Manager_Cache_Helper {
20
  }
21
 
22
  /**
23
- * Flush the cache
 
 
24
  */
25
  public static function flush_get_job_listings_cache( $post_id ) {
26
  if ( 'job_listing' === get_post_type( $post_id ) ) {
@@ -29,7 +37,9 @@ class WP_Job_Manager_Cache_Helper {
29
  }
30
 
31
  /**
32
- * Flush the cache
 
 
33
  */
34
  public static function job_manager_my_job_do_action( $action ) {
35
  if ( 'mark_filled' === $action || 'mark_not_filled' === $action ) {
@@ -38,21 +48,30 @@ class WP_Job_Manager_Cache_Helper {
38
  }
39
 
40
  /**
41
- * When any post has a term set
 
 
 
 
 
42
  */
43
  public static function set_term( $object_id = '', $terms = '', $tt_ids = '', $taxonomy = '' ) {
44
  self::get_transient_version( 'jm_get_' . sanitize_text_field( $taxonomy ), true );
45
  }
46
 
47
  /**
48
- * When any term is edited
 
 
 
 
49
  */
50
  public static function edited_term( $term_id = '', $tt_id = '', $taxonomy = '' ) {
51
  self::get_transient_version( 'jm_get_' . sanitize_text_field( $taxonomy ), true );
52
  }
53
 
54
  /**
55
- * Get transient version
56
  *
57
  * When using transients with unpredictable names, e.g. those containing an md5
58
  * hash in the name, we need a way to invalidate them all at once.
@@ -64,9 +83,9 @@ class WP_Job_Manager_Cache_Helper {
64
  * to append a unique string (based on time()) to each transient. When transients
65
  * are invalidated, the transient version will increment and data will be regenerated.
66
  *
67
- * @param string $group Name for the group of transients we need to invalidate
68
- * @param boolean $refresh true to force a new version
69
- * @return string transient version based on time(), 10 digits
70
  */
71
  public static function get_transient_version( $group, $refresh = false ) {
72
  $transient_name = $group . '-transient-version';
@@ -83,6 +102,8 @@ class WP_Job_Manager_Cache_Helper {
83
  * When the transient version increases, this is used to remove all past transients to avoid filling the DB.
84
  *
85
  * Note; this only works on transients appended with the transient version, and when object caching is not being used.
 
 
86
  */
87
  private static function delete_version_transients( $version ) {
88
  if ( ! wp_using_ext_object_cache() && ! empty( $version ) ) {
@@ -91,8 +112,8 @@ class WP_Job_Manager_Cache_Helper {
91
  }
92
  }
93
 
94
- /**
95
- * Clear expired transients
96
  */
97
  public static function clear_expired_transients() {
98
  global $wpdb;
5
  }
6
 
7
  /**
8
+ * Assists in cache management for WP Job Management posts and terms.
9
+ *
10
+ * @package wp-job-manager
11
+ * @since 1.0.0
12
  */
13
  class WP_Job_Manager_Cache_Helper {
14
 
15
+ /**
16
+ * Initializes cache hooks.
17
+ */
18
  public static function init() {
19
  add_action( 'save_post', array( __CLASS__, 'flush_get_job_listings_cache' ) );
20
  add_action( 'job_manager_my_job_do_action', array( __CLASS__, 'job_manager_my_job_do_action' ) );
26
  }
27
 
28
  /**
29
+ * Flushes the cache.
30
+ *
31
+ * @param int|WP_Post $post_id
32
  */
33
  public static function flush_get_job_listings_cache( $post_id ) {
34
  if ( 'job_listing' === get_post_type( $post_id ) ) {
37
  }
38
 
39
  /**
40
+ * Refreshes the Job Listing cache when performing actions on it.
41
+ *
42
+ * @param string $action
43
  */
44
  public static function job_manager_my_job_do_action( $action ) {
45
  if ( 'mark_filled' === $action || 'mark_not_filled' === $action ) {
48
  }
49
 
50
  /**
51
+ * Refreshes the Job Listing cache when terms are updated.
52
+ *
53
+ * @param string|int $object_id
54
+ * @param string $terms
55
+ * @param string $tt_ids
56
+ * @param string $taxonomy
57
  */
58
  public static function set_term( $object_id = '', $terms = '', $tt_ids = '', $taxonomy = '' ) {
59
  self::get_transient_version( 'jm_get_' . sanitize_text_field( $taxonomy ), true );
60
  }
61
 
62
  /**
63
+ * Refreshes the Job Listing cache when terms are updated.
64
+ *
65
+ * @param string|int $term_id
66
+ * @param string|int $tt_id
67
+ * @param string $taxonomy
68
  */
69
  public static function edited_term( $term_id = '', $tt_id = '', $taxonomy = '' ) {
70
  self::get_transient_version( 'jm_get_' . sanitize_text_field( $taxonomy ), true );
71
  }
72
 
73
  /**
74
+ * Gets transient version.
75
  *
76
  * When using transients with unpredictable names, e.g. those containing an md5
77
  * hash in the name, we need a way to invalidate them all at once.
83
  * to append a unique string (based on time()) to each transient. When transients
84
  * are invalidated, the transient version will increment and data will be regenerated.
85
  *
86
+ * @param string $group Name for the group of transients we need to invalidate.
87
+ * @param boolean $refresh True to force a new version (Default: false).
88
+ * @return string Transient version based on time(), 10 digits.
89
  */
90
  public static function get_transient_version( $group, $refresh = false ) {
91
  $transient_name = $group . '-transient-version';
102
  * When the transient version increases, this is used to remove all past transients to avoid filling the DB.
103
  *
104
  * Note; this only works on transients appended with the transient version, and when object caching is not being used.
105
+ *
106
+ * @param string $version
107
  */
108
  private static function delete_version_transients( $version ) {
109
  if ( ! wp_using_ext_object_cache() && ! empty( $version ) ) {
112
  }
113
  }
114
 
115
+ /**
116
+ * Clear expired transients.
117
  */
118
  public static function clear_expired_transients() {
119
  global $wpdb;
includes/class-wp-job-manager-category-walker.php CHANGED
@@ -2,24 +2,24 @@
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  /**
5
- * WP_Job_Manager_Category_Walker class.
6
  *
7
  * @extends Walker
 
 
8
  */
9
  class WP_Job_Manager_Category_Walker extends Walker {
10
 
11
  /**
12
- * Tree type
13
  *
14
- * @access public
15
  * @var string
16
  */
17
  public $tree_type = 'category';
18
 
19
  /**
20
- * Database fields
21
  *
22
- * @access public
23
  * @var array
24
  */
25
  public $db_fields = array ('parent' => 'parent', 'id' => 'term_id', 'slug' => 'slug' );
@@ -29,9 +29,10 @@ class WP_Job_Manager_Category_Walker extends Walker {
29
  * @since 2.1.0
30
  *
31
  * @param string $output Passed by reference. Used to append additional content.
32
- * @param object $category Category data object.
33
- * @param int $depth Depth of category in reference to parents.
34
- * @param array $args
 
35
  */
36
  public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
37
 
2
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
 
4
  /**
5
+ * Walks through categories.
6
  *
7
  * @extends Walker
8
+ * @package wp-job-manager
9
+ * @since 1.0.0
10
  */
11
  class WP_Job_Manager_Category_Walker extends Walker {
12
 
13
  /**
14
+ * Tree type that the class handles.
15
  *
 
16
  * @var string
17
  */
18
  public $tree_type = 'category';
19
 
20
  /**
21
+ * Database fields to use.
22
  *
 
23
  * @var array
24
  */
25
  public $db_fields = array ('parent' => 'parent', 'id' => 'term_id', 'slug' => 'slug' );
29
  * @since 2.1.0
30
  *
31
  * @param string $output Passed by reference. Used to append additional content.
32
+ * @param object $object Category data object.
33
+ * @param int $depth Depth of category in reference to parents.
34
+ * @param array $args
35
+ * @param int $current_object_id
36
  */
37
  public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
38
 
includes/class-wp-job-manager-forms.php CHANGED
@@ -1,11 +1,36 @@
1
  <?php
2
  /**
3
- * WP_Job_Manager_Forms class.
 
 
 
4
  */
5
  class WP_Job_Manager_Forms {
6
 
7
  /**
8
- * Constructor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
  public function __construct() {
11
  add_action( 'init', array( $this, 'load_posted_form' ) );
@@ -52,11 +77,11 @@ class WP_Job_Manager_Forms {
52
  }
53
 
54
  /**
55
- * get_form function.
56
  *
57
  * @param string $form_name
58
- * @param array $atts Optional passed attributes
59
- * @return string
60
  */
61
  public function get_form( $form_name, $atts = array() ) {
62
  if ( $form = $this->load_form_class( $form_name ) ) {
@@ -65,4 +90,4 @@ class WP_Job_Manager_Forms {
65
  return ob_get_clean();
66
  }
67
  }
68
- }
1
  <?php
2
  /**
3
+ * Base class for all WP Job Manager forms.
4
+ *
5
+ * @package wp-job-manager
6
+ * @since 1.0.0
7
  */
8
  class WP_Job_Manager_Forms {
9
 
10
  /**
11
+ * The single instance of the class.
12
+ *
13
+ * @var self
14
+ * @since 1.26
15
+ */
16
+ private static $_instance = null;
17
+
18
+ /**
19
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
20
+ *
21
+ * @since 1.26
22
+ * @static
23
+ * @return self Main instance.
24
+ */
25
+ public static function instance() {
26
+ if ( is_null( self::$_instance ) ) {
27
+ self::$_instance = new self();
28
+ }
29
+ return self::$_instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor.
34
  */
35
  public function __construct() {
36
  add_action( 'init', array( $this, 'load_posted_form' ) );
77
  }
78
 
79
  /**
80
+ * Returns the form content.
81
  *
82
  * @param string $form_name
83
+ * @param array $atts Optional passed attributes
84
+ * @return string|null
85
  */
86
  public function get_form( $form_name, $atts = array() ) {
87
  if ( $form = $this->load_form_class( $form_name ) ) {
90
  return ob_get_clean();
91
  }
92
  }
93
+ }
includes/class-wp-job-manager-geocode.php CHANGED
@@ -3,22 +3,52 @@
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
- * WP_Job_Manager_Geocode
7
- *
8
  * Obtains Geolocation data for posted jobs from Google.
 
 
 
9
  */
10
  class WP_Job_Manager_Geocode {
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
- * Constructor
14
  */
15
  public function __construct() {
 
 
16
  add_action( 'job_manager_update_job_data', array( $this, 'update_location_data' ), 20, 2 );
17
  add_action( 'job_manager_job_location_edited', array( $this, 'change_location_data' ), 20, 2 );
18
  }
19
 
20
  /**
21
- * Update location data - when submitting a job
 
 
 
22
  */
23
  public function update_location_data( $job_id, $values ) {
24
  if ( apply_filters( 'job_manager_geolocation_enabled', true ) && isset( $values['job']['job_location'] ) ) {
@@ -28,8 +58,9 @@ class WP_Job_Manager_Geocode {
28
  }
29
 
30
  /**
31
- * Change a jobs location data upon editing
32
- * @param int $job_id
 
33
  * @param string $new_location
34
  */
35
  public function change_location_data( $job_id, $new_location ) {
@@ -41,8 +72,9 @@ class WP_Job_Manager_Geocode {
41
  }
42
 
43
  /**
44
- * Checks if a job has location data or not
45
- * @param int $job_id
 
46
  * @return boolean
47
  */
48
  public static function has_location_data( $job_id ) {
@@ -50,8 +82,9 @@ class WP_Job_Manager_Geocode {
50
  }
51
 
52
  /**
53
- * Called manually to generate location data and save to a post
54
- * @param int $job_id
 
55
  * @param string $location
56
  */
57
  public static function generate_location_data( $job_id, $location ) {
@@ -60,7 +93,8 @@ class WP_Job_Manager_Geocode {
60
  }
61
 
62
  /**
63
- * Delete a job's location data
 
64
  * @param int $job_id
65
  */
66
  public static function clear_location_data( $job_id ) {
@@ -80,8 +114,9 @@ class WP_Job_Manager_Geocode {
80
  }
81
 
82
  /**
83
- * Save any returned data to post meta
84
- * @param int $job_id
 
85
  * @param array $address_data
86
  */
87
  public static function save_location_data( $job_id, $address_data ) {
@@ -96,12 +131,48 @@ class WP_Job_Manager_Geocode {
96
  }
97
 
98
  /**
99
- * Get Location Data from Google
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  *
101
  * Based on code by Eyal Fitoussi.
102
  *
103
  * @param string $raw_address
104
- * @return array location data
105
  */
106
  public static function get_location_data( $raw_address ) {
107
  $invalid_chars = array( " " => "+", "," => "", "?" => "", "&" => "", "=" => "" , "#" => "" );
@@ -120,17 +191,22 @@ class WP_Job_Manager_Geocode {
120
  return false;
121
  }
122
 
 
 
 
 
 
123
  try {
124
  if ( false === $geocoded_address || empty( $geocoded_address->results[0] ) ) {
125
  $result = wp_remote_get(
126
- apply_filters( 'job_manager_geolocation_endpoint', "http://maps.googleapis.com/maps/api/geocode/json?address=" . $raw_address . "&sensor=false&region=" . apply_filters( 'job_manager_geolocation_region_cctld', '', $raw_address ), $raw_address ),
127
  array(
128
  'timeout' => 5,
129
- 'redirection' => 1,
130
- 'httpversion' => '1.1',
131
- 'user-agent' => 'WordPress/WP-Job-Manager-' . JOB_MANAGER_VERSION . '; ' . get_bloginfo( 'url' ),
132
- 'sslverify' => false
133
- )
134
  );
135
  $result = wp_remote_retrieve_body( $result );
136
  $geocoded_address = json_decode( $result );
@@ -212,4 +288,4 @@ class WP_Job_Manager_Geocode {
212
  }
213
  }
214
 
215
- new WP_Job_Manager_Geocode();
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
 
 
6
  * Obtains Geolocation data for posted jobs from Google.
7
+ *
8
+ * @package wp-job-manager
9
+ * @since 1.6.1
10
  */
11
  class WP_Job_Manager_Geocode {
12
 
13
+ const GOOGLE_MAPS_GEOCODE_API_URL = 'https://maps.googleapis.com/maps/api/geocode/json';
14
+
15
+ /**
16
+ * The single instance of the class.
17
+ *
18
+ * @var self
19
+ * @since 1.26
20
+ */
21
+ private static $_instance = null;
22
+
23
+ /**
24
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
25
+ *
26
+ * @since 1.26
27
+ * @static
28
+ * @return self Main instance.
29
+ */
30
+ public static function instance() {
31
+ if ( is_null( self::$_instance ) ) {
32
+ self::$_instance = new self();
33
+ }
34
+ return self::$_instance;
35
+ }
36
+
37
  /**
38
+ * Constructor.
39
  */
40
  public function __construct() {
41
+ add_filter( 'job_manager_geolocation_endpoint', array( $this, 'add_geolocation_endpoint_query_args' ), 0, 2 );
42
+ add_filter( 'job_manager_geolocation_api_key', array( $this, 'get_google_maps_api_key' ), 0 );
43
  add_action( 'job_manager_update_job_data', array( $this, 'update_location_data' ), 20, 2 );
44
  add_action( 'job_manager_job_location_edited', array( $this, 'change_location_data' ), 20, 2 );
45
  }
46
 
47
  /**
48
+ * Updates location data when submitting a job.
49
+ *
50
+ * @param int $job_id
51
+ * @param array $values
52
  */
53
  public function update_location_data( $job_id, $values ) {
54
  if ( apply_filters( 'job_manager_geolocation_enabled', true ) && isset( $values['job']['job_location'] ) ) {
58
  }
59
 
60
  /**
61
+ * Changes a jobs location data upon editing.
62
+ *
63
+ * @param int $job_id
64
  * @param string $new_location
65
  */
66
  public function change_location_data( $job_id, $new_location ) {
72
  }
73
 
74
  /**
75
+ * Checks if a job has location data or not.
76
+ *
77
+ * @param int $job_id
78
  * @return boolean
79
  */
80
  public static function has_location_data( $job_id ) {
82
  }
83
 
84
  /**
85
+ * Generates location data and saves to a post.
86
+ *
87
+ * @param int $job_id
88
  * @param string $location
89
  */
90
  public static function generate_location_data( $job_id, $location ) {
93
  }
94
 
95
  /**
96
+ * Deletes a job's location data.
97
+ *
98
  * @param int $job_id
99
  */
100
  public static function clear_location_data( $job_id ) {
114
  }
115
 
116
  /**
117
+ * Saves any returned data to post meta.
118
+ *
119
+ * @param int $job_id
120
  * @param array $address_data
121
  */
122
  public static function save_location_data( $job_id, $address_data ) {
131
  }
132
 
133
  /**
134
+ * Retrieves the Google Maps API key from the plugin's settings.
135
+ *
136
+ * @param string $key
137
+ * @return string
138
+ */
139
+ public function get_google_maps_api_key( $key ) {
140
+ return get_option( 'job_manager_google_maps_api_key' );
141
+ }
142
+
143
+ /**
144
+ * Adds the necessary query arguments for a Google Maps Geocode API request.
145
+ *
146
+ * @param string $geocode_endpoint_url
147
+ * @param string $raw_address
148
+ * @return string|bool
149
+ */
150
+ public function add_geolocation_endpoint_query_args( $geocode_endpoint_url, $raw_address ) {
151
+ $api_key = apply_filters( 'job_manager_geolocation_api_key', '', $raw_address );
152
+
153
+ // Google Maps API no longer accepts requests without an API key
154
+ if ( '' === $api_key ) {
155
+ return false;
156
+ }
157
+
158
+ $geocode_endpoint_url = add_query_arg( 'key', urlencode( $api_key ), $geocode_endpoint_url );
159
+ $geocode_endpoint_url = add_query_arg( 'address', urlencode( $raw_address ), $geocode_endpoint_url );
160
+
161
+ $region = apply_filters( 'job_manager_geolocation_region_cctld', '', $raw_address );
162
+ if ( '' !== $region ) {
163
+ $geocode_endpoint_url = add_query_arg( 'region', urlencode( $region ), $geocode_endpoint_url );
164
+ }
165
+
166
+ return $geocode_endpoint_url;
167
+ }
168
+
169
+ /**
170
+ * Gets Location Data from Google.
171
  *
172
  * Based on code by Eyal Fitoussi.
173
  *
174
  * @param string $raw_address
175
+ * @return array|bool location data
176
  */
177
  public static function get_location_data( $raw_address ) {
178
  $invalid_chars = array( " " => "+", "," => "", "?" => "", "&" => "", "=" => "" , "#" => "" );
191
  return false;
192
  }
193
 
194
+ $geocode_api_url = apply_filters( 'job_manager_geolocation_endpoint', self::GOOGLE_MAPS_GEOCODE_API_URL, $raw_address );
195
+ if ( false === $geocode_api_url ) {
196
+ return false;
197
+ }
198
+
199
  try {
200
  if ( false === $geocoded_address || empty( $geocoded_address->results[0] ) ) {
201
  $result = wp_remote_get(
202
+ $geocode_api_url,
203
  array(
204
  'timeout' => 5,
205
+ 'redirection' => 1,
206
+ 'httpversion' => '1.1',
207
+ 'user-agent' => 'WordPress/WP-Job-Manager-' . JOB_MANAGER_VERSION . '; ' . get_bloginfo( 'url' ),
208
+ 'sslverify' => false
209
+ )
210
  );
211
  $result = wp_remote_retrieve_body( $result );
212
  $geocoded_address = json_decode( $result );
288
  }
289
  }
290
 
291
+ WP_Job_Manager_Geocode::instance();
includes/class-wp-job-manager-install.php CHANGED
@@ -5,12 +5,15 @@ if ( ! defined( 'ABSPATH' ) ) {
5
  }
6
 
7
  /**
8
- * WP_Job_Manager_Install
 
 
 
9
  */
10
  class WP_Job_Manager_Install {
11
 
12
  /**
13
- * Install WP Job Manager
14
  */
15
  public static function install() {
16
  global $wpdb;
@@ -45,7 +48,7 @@ class WP_Job_Manager_Install {
45
  }
46
 
47
  /**
48
- * Init user roles
49
  */
50
  private static function init_user_roles() {
51
  global $wp_roles;
@@ -72,7 +75,8 @@ class WP_Job_Manager_Install {
72
  }
73
 
74
  /**
75
- * Get capabilities
 
76
  * @return array
77
  */
78
  private static function get_core_capabilities() {
@@ -103,7 +107,7 @@ class WP_Job_Manager_Install {
103
  }
104
 
105
  /**
106
- * default_terms function.
107
  */
108
  private static function default_terms() {
109
  if ( get_option( 'job_manager_installed_terms' ) == 1 ) {
@@ -132,7 +136,7 @@ class WP_Job_Manager_Install {
132
  }
133
 
134
  /**
135
- * Setup cron jobs
136
  */
137
  private static function schedule_cron() {
138
  wp_clear_scheduled_hook( 'job_manager_check_for_expired_jobs' );
5
  }
6
 
7
  /**
8
+ * Handles the installation of the WP Job Manager plugin.s
9
+ *
10
+ * @package wp-job-manager
11
+ * @since 1.0.0
12
  */
13
  class WP_Job_Manager_Install {
14
 
15
  /**
16
+ * Installs WP Job Manager.
17
  */
18
  public static function install() {
19
  global $wpdb;
48
  }
49
 
50
  /**
51
+ * Initializes user roles.
52
  */
53
  private static function init_user_roles() {
54
  global $wp_roles;
75
  }
76
 
77
  /**
78
+ * Returns capabilities.
79
+ *
80
  * @return array
81
  */
82
  private static function get_core_capabilities() {
107
  }
108
 
109
  /**
110
+ * Returns the default Job Manager terms.
111
  */
112
  private static function default_terms() {
113
  if ( get_option( 'job_manager_installed_terms' ) == 1 ) {
136
  }
137
 
138
  /**
139
+ * Setup cron jobs.
140
  */
141
  private static function schedule_cron() {
142
  wp_clear_scheduled_hook( 'job_manager_check_for_expired_jobs' );
includes/class-wp-job-manager-post-types.php CHANGED
@@ -1,11 +1,36 @@
1
  <?php
2
  /**
3
- * WP_Job_Manager_Content class.
 
 
 
4
  */
5
  class WP_Job_Manager_Post_Types {
6
 
7
  /**
8
- * Constructor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
  public function __construct() {
11
  add_action( 'init', array( $this, 'register_post_types' ), 0 );
@@ -38,6 +63,8 @@ class WP_Job_Manager_Post_Types {
38
  add_action( 'update_post_meta', array( $this, 'update_post_meta' ), 10, 4 );
39
  add_action( 'wp_insert_post', array( $this, 'maybe_add_default_meta_data' ), 10, 2 );
40
 
 
 
41
  // WP ALL Import
42
  add_action( 'pmxi_saved_post', array( $this, 'pmxi_saved_post' ), 10, 1 );
43
 
@@ -51,10 +78,7 @@ class WP_Job_Manager_Post_Types {
51
  }
52
 
53
  /**
54
- * register_post_types function.
55
- *
56
- * @access public
57
- * @return void
58
  */
59
  public function register_post_types() {
60
  if ( post_type_exists( "job_listing" ) )
@@ -248,7 +272,7 @@ class WP_Job_Manager_Post_Types {
248
  }
249
 
250
  /**
251
- * Change label
252
  */
253
  public function admin_head() {
254
  global $menu;
@@ -269,7 +293,9 @@ class WP_Job_Manager_Post_Types {
269
  }
270
 
271
  /**
272
- * Toggle filter on and off
 
 
273
  */
274
  private function job_content_filter( $enable ) {
275
  if ( ! $enable ) {
@@ -280,7 +306,10 @@ class WP_Job_Manager_Post_Types {
280
  }
281
 
282
  /**
283
- * Add extra content before/after the post for single job listings.
 
 
 
284
  */
285
  public function job_content( $content ) {
286
  global $post;
@@ -305,7 +334,7 @@ class WP_Job_Manager_Post_Types {
305
  }
306
 
307
  /**
308
- * Job listing feeds
309
  */
310
  public function job_feed() {
311
  $query_args = array(
@@ -351,9 +380,10 @@ class WP_Job_Manager_Post_Types {
351
  );
352
  }
353
 
354
- if ( $job_manager_keyword = sanitize_text_field( $_GET['search_keywords'] ) ) {
355
- $query_args['_keyword'] = $job_manager_keyword; // Does nothing but needed for unique hash
356
- add_filter( 'posts_clauses', 'get_job_listings_keyword_search' );
 
357
  }
358
 
359
  if ( empty( $query_args['meta_query'] ) ) {
@@ -368,17 +398,43 @@ class WP_Job_Manager_Post_Types {
368
  add_action( 'rss2_ns', array( $this, 'job_feed_namespace' ) );
369
  add_action( 'rss2_item', array( $this, 'job_feed_item' ) );
370
  do_feed_rss2( false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  }
372
 
373
  /**
374
- * Add a custom namespace to the job feed
375
  */
376
  public function job_feed_namespace() {
377
  echo 'xmlns:job_listing="' . site_url() . '"' . "\n";
378
  }
379
 
380
  /**
381
- * Add custom data to the job feed
382
  */
383
  public function job_feed_item() {
384
  $post_id = get_the_ID();
@@ -395,7 +451,7 @@ class WP_Job_Manager_Post_Types {
395
  if ( $company ) {
396
  echo "<job_listing:company><![CDATA[" . esc_html( $company ) . "]]></job_listing:company>\n";
397
  }
398
-
399
  /**
400
  * Fires at the end of each job RSS feed item.
401
  *
@@ -405,7 +461,7 @@ class WP_Job_Manager_Post_Types {
405
  }
406
 
407
  /**
408
- * Expire jobs
409
  */
410
  public function check_for_expired_jobs() {
411
  global $wpdb;
@@ -448,7 +504,7 @@ class WP_Job_Manager_Post_Types {
448
  }
449
 
450
  /**
451
- * Delete old previewed jobs after 30 days to keep the DB clean
452
  */
453
  public function delete_old_previews() {
454
  global $wpdb;
@@ -469,14 +525,19 @@ class WP_Job_Manager_Post_Types {
469
  }
470
 
471
  /**
472
- * Typo -.-
 
 
 
473
  */
474
  public function set_expirey( $post ) {
475
  $this->set_expiry( $post );
476
  }
477
 
478
  /**
479
- * Set expirey date when job status changes
 
 
480
  */
481
  public function set_expiry( $post ) {
482
  if ( $post->post_type !== 'job_listing' ) {
@@ -508,22 +569,28 @@ class WP_Job_Manager_Post_Types {
508
  }
509
 
510
  /**
511
- * The application content when the application method is an email
 
 
512
  */
513
  public function application_details_email( $apply ) {
514
  get_job_manager_template( 'job-application-email.php', array( 'apply' => $apply ) );
515
  }
516
 
517
  /**
518
- * The application content when the application method is a url
 
 
519
  */
520
  public function application_details_url( $apply ) {
521
  get_job_manager_template( 'job-application-url.php', array( 'apply' => $apply ) );
522
  }
523
 
524
  /**
525
- * Fix post name when wp_update_post changes it
526
- * @param array $data
 
 
527
  * @return array
528
  */
529
  public function fix_post_name( $data, $postarr ) {
@@ -534,9 +601,11 @@ class WP_Job_Manager_Post_Types {
534
  }
535
 
536
  /**
537
- * Generate location data if a post is added
538
- * @param int $post_id
539
- * @param array $post
 
 
540
  */
541
  public function maybe_add_geolocation_data( $object_id, $meta_key, $meta_value ) {
542
  if ( '_job_location' !== $meta_key || 'job_listing' !== get_post_type( $object_id ) ) {
@@ -546,7 +615,12 @@ class WP_Job_Manager_Post_Types {
546
  }
547
 
548
  /**
549
- * Triggered when updating meta on a job listing
 
 
 
 
 
550
  */
551
  public function update_post_meta( $meta_id, $object_id, $meta_key, $meta_value ) {
552
  if ( 'job_listing' === get_post_type( $object_id ) ) {
@@ -562,14 +636,24 @@ class WP_Job_Manager_Post_Types {
562
  }
563
 
564
  /**
565
- * Generate location data if a post is updated
 
 
 
 
 
566
  */
567
  public function maybe_update_geolocation_data( $meta_id, $object_id, $meta_key, $meta_value ) {
568
  do_action( 'job_manager_job_location_edited', $object_id, $meta_value );
569
  }
570
 
571
  /**
572
- * Maybe set menu_order if the featured status of a job is changed
 
 
 
 
 
573
  */
574
  public function maybe_update_menu_order( $meta_id, $object_id, $meta_key, $meta_value ) {
575
  global $wpdb;
@@ -584,7 +668,12 @@ class WP_Job_Manager_Post_Types {
584
  }
585
 
586
  /**
587
- * Legacy
 
 
 
 
 
588
  * @deprecated 1.19.1
589
  */
590
  public function maybe_generate_geolocation_data( $meta_id, $object_id, $meta_key, $meta_value ) {
@@ -592,9 +681,10 @@ class WP_Job_Manager_Post_Types {
592
  }
593
 
594
  /**
595
- * Maybe set default meta data for job listings
596
- * @param int $post_id
597
- * @param WP_Post $post
 
598
  */
599
  public function maybe_add_default_meta_data( $post_id, $post = '' ) {
600
  if ( empty( $post ) || 'job_listing' === $post->post_type ) {
@@ -604,7 +694,8 @@ class WP_Job_Manager_Post_Types {
604
  }
605
 
606
  /**
607
- * After importing via WP ALL Import, add default meta data
 
608
  * @param int $post_id
609
  */
610
  public function pmxi_saved_post( $post_id ) {
@@ -617,10 +708,11 @@ class WP_Job_Manager_Post_Types {
617
  }
618
 
619
  /**
620
- * Replace RP4WP template with the template from Job Manager
 
621
  * @param string $located
622
  * @param string $template_name
623
- * @param array $args
624
  * @return string
625
  */
626
  public function rp4wp_template( $located, $template_name, $args ) {
@@ -631,9 +723,10 @@ class WP_Job_Manager_Post_Types {
631
  }
632
 
633
  /**
634
- * Add meta fields for RP4WP to relate jobs by
635
- * @param array $meta_fields
636
- * @param int $post_id
 
637
  * @param WP_Post $post
638
  * @return array
639
  */
@@ -646,10 +739,11 @@ class WP_Job_Manager_Post_Types {
646
  }
647
 
648
  /**
649
- * Add meta fields for RP4WP to relate jobs by
650
- * @param int $weight
 
651
  * @param WP_Post $post
652
- * @param string $meta_field
653
  * @return int
654
  */
655
  public function rp4wp_related_meta_fields_weight( $weight, $post, $meta_field ) {
1
  <?php
2
  /**
3
+ * Handles displays and hooks for the Job Listing custom post type.
4
+ *
5
+ * @package wp-job-manager
6
+ * @since 1.0.0
7
  */
8
  class WP_Job_Manager_Post_Types {
9
 
10
  /**
11
+ * The single instance of the class.
12
+ *
13
+ * @var self
14
+ * @since 1.26
15
+ */
16
+ private static $_instance = null;
17
+
18
+ /**
19
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
20
+ *
21
+ * @since 1.26
22
+ * @static
23
+ * @return self Main instance.
24
+ */
25
+ public static function instance() {
26
+ if ( is_null( self::$_instance ) ) {
27
+ self::$_instance = new self();
28
+ }
29
+ return self::$_instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor.
34
  */
35
  public function __construct() {
36
  add_action( 'init', array( $this, 'register_post_types' ), 0 );
63
  add_action( 'update_post_meta', array( $this, 'update_post_meta' ), 10, 4 );
64
  add_action( 'wp_insert_post', array( $this, 'maybe_add_default_meta_data' ), 10, 2 );
65
 
66
+ add_action( 'parse_query', array( $this, 'add_feed_query_args' ) );
67
+
68
  // WP ALL Import
69
  add_action( 'pmxi_saved_post', array( $this, 'pmxi_saved_post' ), 10, 1 );
70
 
78
  }
79
 
80
  /**
81
+ * Registers the custom post type and taxonomies.
 
 
 
82
  */
83
  public function register_post_types() {
84
  if ( post_type_exists( "job_listing" ) )
272
  }
273
 
274
  /**
275
+ * Change label for admin menu item to show number of Job Listing items pending approval.
276
  */
277
  public function admin_head() {
278
  global $menu;
293
  }
294
 
295
  /**
296
+ * Toggles content filter on and off.
297
+ *
298
+ * @param bool $enable
299
  */
300
  private function job_content_filter( $enable ) {
301
  if ( ! $enable ) {
306
  }
307
 
308
  /**
309
+ * Adds extra content before/after the post for single job listings.
310
+ *
311
+ * @param string $content
312
+ * @return string
313
  */
314
  public function job_content( $content ) {
315
  global $post;
334
  }
335
 
336
  /**
337
+ * Generates the RSS feed for Job Listings.
338
  */
339
  public function job_feed() {
340
  $query_args = array(
380
  );
381
  }
382
 
383
+ $job_manager_keyword = isset( $_GET['search_keywords'] ) ? sanitize_text_field( $_GET['search_keywords'] ) : '';
384
+ if ( !empty( $job_manager_keyword ) ) {
385
+ $query_args['s'] = $job_manager_keyword;
386
+ add_filter( 'posts_search', 'get_job_listings_keyword_search' );
387
  }
388
 
389
  if ( empty( $query_args['meta_query'] ) ) {
398
  add_action( 'rss2_ns', array( $this, 'job_feed_namespace' ) );
399
  add_action( 'rss2_item', array( $this, 'job_feed_item' ) );
400
  do_feed_rss2( false );
401
+ remove_filter( 'posts_search', 'get_job_listings_keyword_search' );
402
+ }
403
+
404
+ /**
405
+ * Adds query arguments in order to make sure that the feed properly queries the 'job_listing' type.
406
+ *
407
+ * @param WP_Query $wp
408
+ */
409
+ public function add_feed_query_args( $wp ) {
410
+
411
+ // Let's leave if not the job feed
412
+ if ( ! isset( $wp->query_vars['feed'] ) || 'job_feed' !== $wp->query_vars['feed'] ) {
413
+ return;
414
+ }
415
+
416
+ // Leave if not a feed.
417
+ if ( false === $wp->is_feed ) {
418
+ return;
419
+ }
420
+
421
+ // If the post_type was already set, let's get out of here.
422
+ if ( isset( $wp->query_vars['post_type'] ) && ! empty( $wp->query_vars['post_type'] ) ) {
423
+ return;
424
+ }
425
+
426
+ $wp->query_vars['post_type'] = 'job_listing';
427
  }
428
 
429
  /**
430
+ * Adds a custom namespace to the job feed.
431
  */
432
  public function job_feed_namespace() {
433
  echo 'xmlns:job_listing="' . site_url() . '"' . "\n";
434
  }
435
 
436
  /**
437
+ * Adds custom data to the job feed.
438
  */
439
  public function job_feed_item() {
440
  $post_id = get_the_ID();
451
  if ( $company ) {
452
  echo "<job_listing:company><![CDATA[" . esc_html( $company ) . "]]></job_listing:company>\n";
453
  }
454
+
455
  /**
456
  * Fires at the end of each job RSS feed item.
457
  *
461
  }
462
 
463
  /**
464
+ * Maintenance task to expire jobs.
465
  */
466
  public function check_for_expired_jobs() {
467
  global $wpdb;
504
  }
505
 
506
  /**
507
+ * Deletes old previewed jobs after 30 days to keep the DB clean.
508
  */
509
  public function delete_old_previews() {
510
  global $wpdb;
525
  }
526
 
527
  /**
528
+ * Typo wrapper for `set_expiry` method.
529
+ *
530
+ * @param WP_Post $post
531
+ * @deprecated
532
  */
533
  public function set_expirey( $post ) {
534
  $this->set_expiry( $post );
535
  }
536
 
537
  /**
538
+ * Sets expiry date when job status changes.
539
+ *
540
+ * @param WP_Post $post
541
  */
542
  public function set_expiry( $post ) {
543
  if ( $post->post_type !== 'job_listing' ) {
569
  }
570
 
571
  /**
572
+ * Displays the application content when the application method is an email.
573
+ *
574
+ * @param stdClass $apply
575
  */
576
  public function application_details_email( $apply ) {
577
  get_job_manager_template( 'job-application-email.php', array( 'apply' => $apply ) );
578
  }
579
 
580
  /**
581
+ * Displays the application content when the application method is a url.
582
+ *
583
+ * @param stdClass $apply
584
  */
585
  public function application_details_url( $apply ) {
586
  get_job_manager_template( 'job-application-url.php', array( 'apply' => $apply ) );
587
  }
588
 
589
  /**
590
+ * Fixes post name when wp_update_post changes it.
591
+ *
592
+ * @param array $data
593
+ * @param array $postarr
594
  * @return array
595
  */
596
  public function fix_post_name( $data, $postarr ) {
601
  }
602
 
603
  /**
604
+ * Generates location data if a post is added.
605
+ *
606
+ * @param int $object_id
607
+ * @param string $meta_key
608
+ * @param mixed $meta_value
609
  */
610
  public function maybe_add_geolocation_data( $object_id, $meta_key, $meta_value ) {
611
  if ( '_job_location' !== $meta_key || 'job_listing' !== get_post_type( $object_id ) ) {
615
  }
616
 
617
  /**
618
+ * Triggered when updating meta on a job listing.
619
+ *
620
+ * @param int $meta_id
621
+ * @param int $object_id
622
+ * @param string $meta_key
623
+ * @param mixed $meta_value
624
  */
625
  public function update_post_meta( $meta_id, $object_id, $meta_key, $meta_value ) {
626
  if ( 'job_listing' === get_post_type( $object_id ) ) {
636
  }
637
 
638
  /**
639
+ * Generates location data if a post is updated.
640
+ *
641
+ * @param int $meta_id (Unused)
642
+ * @param int $object_id
643
+ * @param string $meta_key (Unused)
644
+ * @param mixed $meta_value
645
  */
646
  public function maybe_update_geolocation_data( $meta_id, $object_id, $meta_key, $meta_value ) {
647
  do_action( 'job_manager_job_location_edited', $object_id, $meta_value );
648
  }
649
 
650
  /**
651
+ * Maybe sets menu_order if the featured status of a job is changed.
652
+ *
653
+ * @param int $meta_id (Unused)
654
+ * @param int $object_id
655
+ * @param string $meta_key (Unused)
656
+ * @param mixed $meta_value
657
  */
658
  public function maybe_update_menu_order( $meta_id, $object_id, $meta_key, $meta_value ) {
659
  global $wpdb;
668
  }
669
 
670
  /**
671
+ * Legacy.
672
+ *
673
+ * @param int $meta_id
674
+ * @param int $object_id
675
+ * @param string $meta_key
676
+ * @param mixed $meta_value
677
  * @deprecated 1.19.1
678
  */
679
  public function maybe_generate_geolocation_data( $meta_id, $object_id, $meta_key, $meta_value ) {
681
  }
682
 
683
  /**
684
+ * Maybe sets default meta data for job listings.
685
+ *
686
+ * @param int $post_id
687
+ * @param WP_Post|string $post
688
  */
689
  public function maybe_add_default_meta_data( $post_id, $post = '' ) {
690
  if ( empty( $post ) || 'job_listing' === $post->post_type ) {
694
  }
695
 
696
  /**
697
+ * After importing via WP All Import, adds default meta data.
698
+ *
699
  * @param int $post_id
700
  */
701
  public function pmxi_saved_post( $post_id ) {
708
  }
709
 
710
  /**
711
+ * Replaces RP4WP template with the template from Job Manager.
712
+ *
713
  * @param string $located
714
  * @param string $template_name
715
+ * @param array $args
716
  * @return string
717
  */
718
  public function rp4wp_template( $located, $template_name, $args ) {
723
  }
724
 
725
  /**
726
+ * Adds meta fields for RP4WP to relate jobs by.
727
+ *
728
+ * @param array $meta_fields
729
+ * @param int $post_id
730
  * @param WP_Post $post
731
  * @return array
732
  */
739
  }
740
 
741
  /**
742
+ * Adds meta fields for RP4WP to relate jobs by.
743
+ *
744
+ * @param int $weight
745
  * @param WP_Post $post
746
+ * @param string $meta_field
747
  * @return int
748
  */
749
  public function rp4wp_related_meta_fields_weight( $weight, $post, $meta_field ) {
includes/class-wp-job-manager-shortcodes.php CHANGED
@@ -3,12 +3,15 @@
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
- * WP_Job_Manager_Shortcodes class.
 
 
 
7
  */
8
  class WP_Job_Manager_Shortcodes {
9
 
10
  /**
11
- * Dashboard message
12
  *
13
  * @access private
14
  * @var string
@@ -16,7 +19,29 @@ class WP_Job_Manager_Shortcodes {
16
  private $job_dashboard_message = '';
17
 
18
  /**
19
- * Constructor
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  */
21
  public function __construct() {
22
  add_action( 'wp', array( $this, 'shortcode_action_handler' ) );
@@ -33,25 +58,28 @@ class WP_Job_Manager_Shortcodes {
33
  }
34
 
35
  /**
36
- * Handle actions which need to be run before the shortcode e.g. post actions
37
  */
38
  public function shortcode_action_handler() {
39
  global $post;
40
 
41
- if ( is_page() && strstr( $post->post_content, '[job_dashboard' ) ) {
42
  $this->job_dashboard_handler();
43
  }
44
  }
45
 
46
  /**
47
- * Show the job submission form
 
 
 
48
  */
49
  public function submit_job_form( $atts = array() ) {
50
  return $GLOBALS['job_manager']->forms->get_form( 'submit-job', $atts );
51
  }
52
 
53
  /**
54
- * Handles actions on job dashboard
55
  */
56
  public function job_dashboard_handler() {
57
  if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'job_manager_my_job_actions' ) ) {
@@ -137,7 +165,10 @@ class WP_Job_Manager_Shortcodes {
137
  }
138
 
139
  /**
140
- * Shortcode which lists the logged in user's jobs
 
 
 
141
  */
142
  public function job_dashboard( $atts ) {
143
  if ( ! is_user_logged_in() ) {
@@ -195,7 +226,7 @@ class WP_Job_Manager_Shortcodes {
195
  }
196
 
197
  /**
198
- * Edit job form
199
  */
200
  public function edit_job() {
201
  global $job_manager;
@@ -204,11 +235,10 @@ class WP_Job_Manager_Shortcodes {
204
  }
205
 
206
  /**
207
- * output_jobs function.
208
  *
209
- * @access public
210
- * @param mixed $args
211
- * @return void
212
  */
213
  public function output_jobs( $atts ) {
214
  ob_start();
@@ -354,14 +384,15 @@ class WP_Job_Manager_Shortcodes {
354
  }
355
 
356
  /**
357
- * Output some content when no results were found
358
  */
359
  public function output_no_results() {
360
  get_job_manager_template( 'content-no-jobs-found.php' );
361
  }
362
 
363
  /**
364
- * Get string as a bool
 
365
  * @param string $value
366
  * @return bool
367
  */
@@ -370,7 +401,8 @@ class WP_Job_Manager_Shortcodes {
370
  }
371
 
372
  /**
373
- * Show job types
 
374
  * @param array $atts
375
  */
376
  public function job_filter_job_types( $atts ) {
@@ -383,26 +415,26 @@ class WP_Job_Manager_Shortcodes {
383
  }
384
 
385
  /**
386
- * Show results div
387
  */
388
  public function job_filter_results() {
389
  echo '<div class="showing_jobs"></div>';
390
  }
391
 
392
  /**
393
- * output_job function.
394
  *
395
- * @access public
396
- * @param array $args
397
- * @return string
398
  */
399
  public function output_job( $atts ) {
400
  extract( shortcode_atts( array(
401
  'id' => '',
402
  ), $atts ) );
403
 
404
- if ( ! $id )
405
  return;
 
406
 
407
  ob_start();
408
 
@@ -432,10 +464,9 @@ class WP_Job_Manager_Shortcodes {
432
  }
433
 
434
  /**
435
- * Job Summary shortcode
436
  *
437
- * @access public
438
- * @param array $args
439
  * @return string
440
  */
441
  public function output_job_summary( $atts ) {
@@ -490,7 +521,10 @@ class WP_Job_Manager_Shortcodes {
490
  }
491
 
492
  /**
493
- * Show the application area
 
 
 
494
  */
495
  public function output_job_apply( $atts ) {
496
  extract( shortcode_atts( array(
@@ -539,4 +573,4 @@ class WP_Job_Manager_Shortcodes {
539
  }
540
  }
541
 
542
- new WP_Job_Manager_Shortcodes();
3
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
 
5
  /**
6
+ * Handles the shortcodes for WP Job Manager.
7
+ *
8
+ * @package wp-job-manager
9
+ * @since 1.0.0
10
  */
11
  class WP_Job_Manager_Shortcodes {
12
 
13
  /**
14
+ * Dashboard message.
15
  *
16
  * @access private
17
  * @var string
19
  private $job_dashboard_message = '';
20
 
21
  /**
22
+ * The single instance of the class.
23
+ *
24
+ * @var self
25
+ * @since 1.26
26
+ */
27
+ private static $_instance = null;
28
+
29
+ /**
30
+ * Allows for accessing single instance of class. Class should only be constructed once per call.
31
+ *
32
+ * @since 1.26
33
+ * @static
34
+ * @return self Main instance.
35
+ */
36
+ public static function instance() {
37
+ if ( is_null( self::$_instance ) ) {
38
+ self::$_instance = new self();
39
+ }
40
+ return self::$_instance;
41
+ }
42
+
43
+ /**
44
+ * Constructor.
45
  */
46
  public function __construct() {
47
  add_action( 'wp', array( $this, 'shortcode_action_handler' ) );
58
  }
59
 
60
  /**
61
+ * Handles actions which need to be run before the shortcode e.g. post actions.
62
  */
63
  public function shortcode_action_handler() {
64
  global $post;
65
 
66
+ if ( is_page() && has_shortcode($post->post_content, 'job_dashboard' ) ) {
67
  $this->job_dashboard_handler();
68
  }
69
  }
70
 
71
  /**
72
+ * Shows the job submission form.
73
+ *
74
+ * @param array $atts
75
+ * @return string|null
76
  */
77
  public function submit_job_form( $atts = array() ) {
78
  return $GLOBALS['job_manager']->forms->get_form( 'submit-job', $atts );
79
  }
80
 
81
  /**
82
+ * Handles actions on job dashboard.
83
  */
84
  public function job_dashboard_handler() {
85
  if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'job_manager_my_job_actions' ) ) {
165
  }
166
 
167
  /**
168
+ * Handles shortcode which lists the logged in user's jobs.
169
+ *
170
+ * @param array $atts
171
+ * @return string
172
  */
173
  public function job_dashboard( $atts ) {
174
  if ( ! is_user_logged_in() ) {
226
  }
227
 
228
  /**
229
+ * Displays edit job form.
230
  */
231
  public function edit_job() {
232
  global $job_manager;
235
  }
236
 
237
  /**
238
+ * Lists all job listings.
239
  *
240
+ * @param array $atts
241
+ * @return string
 
242
  */
243
  public function output_jobs( $atts ) {
244
  ob_start();
384
  }
385
 
386
  /**
387
+ * Displays some content when no results were found.
388
  */
389
  public function output_no_results() {
390
  get_job_manager_template( 'content-no-jobs-found.php' );
391
  }
392
 
393
  /**
394
+ * Gets string as a bool.
395
+ *
396
  * @param string $value
397
  * @return bool
398
  */
401
  }
402
 
403
  /**
404
+ * Shows job types.
405
+ *
406
  * @param array $atts
407
  */
408
  public function job_filter_job_types( $atts ) {
415
  }
416
 
417
  /**
418
+ * Shows results div.
419
  */
420
  public function job_filter_results() {
421
  echo '<div class="showing_jobs"></div>';
422
  }
423
 
424
  /**
425
+ * Shows a single job.
426
  *
427
+ * @param array $atts
428
+ * @return string|null
 
429
  */
430
  public function output_job( $atts ) {
431
  extract( shortcode_atts( array(
432
  'id' => '',
433
  ), $atts ) );
434
 
435
+ if ( ! $id ) {
436
  return;
437
+ }
438
 
439
  ob_start();
440
 
464
  }
465
 
466
  /**
467
+ * Handles the Job Summary shortcode.
468
  *
469
+ * @param array $atts
 
470
  * @return string
471
  */
472
  public function output_job_summary( $atts ) {
521
  }
522
 
523
  /**
524
+ * Shows the application area.
525
+ *
526
+ * @param array $atts
527
+ * @return string
528
  */
529
  public function output_job_apply( $atts ) {
530
  extract( shortcode_atts( array(
573
  }
574
  }
575
 
576
+ WP_Job_Manager_Shortcodes::instance();
includes/class-wp-job-manager-widget.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Job Manager Widget base.
8
+ *
9
+ * @package wp-job-manager
10
+ * @since 1.0.0
11
+ */
12
+ class WP_Job_Manager_Widget extends WP_Widget {
13
+
14
+ /**
15
+ * Widget CSS class.
16
+ *
17
+ * @var string
18
+ */
19
+ public $widget_cssclass;
20
+
21
+ /**
22
+ * Widget description.
23
+ *
24
+ * @var string
25
+ */
26
+ public $widget_description;
27
+
28
+ /**
29
+ * Widget id.
30
+ *
31
+ * @var string
32
+ */
33
+ public $widget_id;
34
+
35
+ /**
36
+ * Widget name.
37
+ *
38
+ * @var string
39
+ */
40
+ public $widget_name;
41
+
42
+ /**
43
+ * Widget settings.
44
+ *
45
+ * @var array
46
+ */
47
+ public $settings;
48
+
49
+ /**
50
+ * Constructor.
51
+ */
52
+ public function __construct() {
53
+ $this->register();
54
+ }
55
+
56
+ /**
57
+ * Registers widget.
58
+ */
59
+ public function register() {
60
+ $widget_ops = array(
61
+ 'classname' => $this->widget_cssclass,
62
+ 'description' => $this->widget_description,
63
+ );
64
+
65
+ parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );
66
+
67
+ add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
68
+ add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
69
+ add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
70
+ }
71
+
72
+ /**
73
+ * Checks for cached version of widget and outputs it if found.
74
+ *
75
+ * @param array $args
76
+ * @return bool
77
+ */
78
+ public function get_cached_widget( $args ) {
79
+ $cache = wp_cache_get( $this->widget_id, 'widget' );
80
+
81
+ if ( ! is_array( $cache ) ) {
82
+ $cache = array();
83
+ }
84
+
85
+ if ( isset( $cache[ $args['widget_id'] ] ) ) {
86
+ echo $cache[ $args['widget_id'] ];
87
+ return true;
88
+ }
89
+
90
+ return false;
91
+ }
92
+
93
+ /**
94
+ * Caches the widget.
95
+ *
96
+ * @param array $args
97
+ * @param string $content
98
+ */
99
+ public function cache_widget( $args, $content ) {
100
+ $cache[ $args['widget_id'] ] = $content;
101
+
102
+ wp_cache_set( $this->widget_id, $cache, 'widget' );
103
+ }
104
+
105
+ /**
106
+ * Flushes the cache for a widget.
107
+ */
108
+ public function flush_widget_cache() {
109
+ wp_cache_delete( $this->widget_id, 'widget' );
110
+ }
111
+
112
+ /**
113
+ * Updates a widget instance settings.
114
+ *
115
+ * @see WP_Widget->update
116
+ * @param array $new_instance
117
+ * @param array $old_instance
118
+ * @return array
119
+ */
120
+ public function update( $new_instance, $old_instance ) {
121
+ $instance = $old_instance;
122
+
123
+ if ( ! $this->settings ) {
124
+ return $instance;
125
+ }
126
+
127
+ foreach ( $this->settings as $key => $setting ) {
128
+ $instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );
129
+ }
130
+
131
+ $this->flush_widget_cache();
132
+
133
+ return $instance;
134
+ }
135
+
136
+ /**
137
+ * Displays widget setup form.
138
+ *
139
+ * @see WP_Widget->form
140
+ * @param array $instance
141
+ * @return void
142
+ */
143
+ public function form( $instance ) {
144
+
145
+ if ( ! $this->settings ) {
146
+ return;
147
+ }
148
+
149
+ foreach ( $this->settings as $key => $setting ) {
150
+
151
+ $value = isset( $instance[ $key ] ) ? $instance[ $key ] : $setting['std'];
152
+
153
+ switch ( $setting['type'] ) {
154
+ case 'text' :
155
+ ?>
156
+ <p>
157
+ <label for="<?php echo $this->get_field_id( $key ); ?>"><?php echo $setting['label']; ?></label>
158
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" name="<?php echo $this->get_field_name( $key ); ?>" type="text" value="<?php echo esc_attr( $value ); ?>" />
159
+ </p>
160
+ <?php
161
+ break;
162
+ case 'number' :
163
+ ?>
164
+ <p>
165
+ <label for="<?php echo $this->get_field_id( $key ); ?>"><?php echo $setting['label']; ?></label>
166
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" name="<?php echo $this->get_field_name( $key ); ?>" type="number" step="<?php echo esc_attr( $setting['step'] ); ?>" min="<?php echo esc_attr( $setting['min'] ); ?>" max="<?php echo esc_attr( $setting['max'] ); ?>" value="<?php echo esc_attr( $value ); ?>" />
167
+ </p>
168
+ <?php
169
+ break;
170
+ }
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Echoes the widget content.
176
+ *
177
+ * @see WP_Widget
178
+ *
179
+ * @param array $args
180
+ * @param array $instance
181
+ */
182
+ public function widget( $args, $instance ) {}
183
+ }
includes/class-wp-job-manager-widgets.php DELETED
@@ -1,383 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) exit;
4
-
5
- /**
6
- * Job Manager Widget base
7
- */
8
- class WP_Job_Manager_Widget extends WP_Widget {
9
-
10
- /**
11
- * Widget CSS class
12
- *
13
- * @access public
14
- * @var string
15
- */
16
- public $widget_cssclass;
17
-
18
- /**
19
- * Widget description
20
- *
21
- * @access public
22
- * @var string
23
- */
24
- public $widget_description;
25
-
26
- /**
27
- * Widget id
28
- *
29
- * @access public
30
- * @var string
31
- */
32
- public $widget_id;
33
-
34
- /**
35
- * Widget name
36
- *
37
- * @access public
38
- * @var string
39
- */
40
- public $widget_name;
41
-
42
- /**
43
- * Widget settings
44
- *
45
- * @access public
46
- * @var array
47
- */
48
- public $settings;
49
-
50
- /**
51
- * Constructor
52
- */
53
- public function __construct() {
54
- $this->register();
55
- }
56
-
57
- /**
58
- * Register Widget
59
- */
60
- public function register() {
61
- $widget_ops = array(
62
- 'classname' => $this->widget_cssclass,
63
- 'description' => $this->widget_description
64
- );
65
-
66
- parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );
67
-
68
- add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
69
- add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
70
- add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
71
- }
72
-
73
- /**
74
- * get_cached_widget function.
75
- */
76
- public function get_cached_widget( $args ) {
77
- $cache = wp_cache_get( $this->widget_id, 'widget' );
78
-
79
- if ( ! is_array( $cache ) )
80
- $cache = array();
81
-
82
- if ( isset( $cache[ $args['widget_id'] ] ) ) {
83
- echo $cache[ $args['widget_id'] ];
84
- return true;
85
- }
86
-
87
- return false;
88
- }
89
-
90
- /**
91
- * Cache the widget
92
- */
93
- public function cache_widget( $args, $content ) {
94
- $cache[ $args['widget_id'] ] = $content;
95
-
96
- wp_cache_set( $this->widget_id, $cache, 'widget' );
97
- }
98
-
99
- /**
100
- * Flush the cache
101
- * @return [type]
102
- */
103
- public function flush_widget_cache() {
104
- wp_cache_delete( $this->widget_id, 'widget' );
105
- }
106
-
107
- /**
108
- * update function.
109
- *
110
- * @see WP_Widget->update
111
- * @access public
112
- * @param array $new_instance
113
- * @param array $old_instance
114
- * @return array
115
- */
116
- public function update( $new_instance, $old_instance ) {
117
- $instance = $old_instance;
118
-
119
- if ( ! $this->settings )
120
- return $instance;
121
-
122
- foreach ( $this->settings as $key => $setting ) {
123
- $instance[ $key ] = sanitize_text_field( $new_instance[ $key ] );
124
- }
125
-
126
- $this->flush_widget_cache();
127
-
128
- return $instance;
129
- }
130
-
131
- /**
132
- * form function.
133
- *
134
- * @see WP_Widget->form
135
- * @access public
136
- * @param array $instance
137
- * @return void
138
- */
139
- function form( $instance ) {
140
-
141
- if ( ! $this->settings )
142
- return;
143
-
144
- foreach ( $this->settings as $key => $setting ) {
145
-
146
- $value = isset( $instance[ $key ] ) ? $instance[ $key ] : $setting['std'];
147
-
148
- switch ( $setting['type'] ) {
149
- case 'text' :
150
- ?>
151
- <p>
152
- <label for="<?php echo $this->get_field_id( $key ); ?>"><?php echo $setting['label']; ?></label>
153
- <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" name="<?php echo $this->get_field_name( $key ); ?>" type="text" value="<?php echo esc_attr( $value ); ?>" />
154
- </p>
155
- <?php
156
- break;
157
- case 'number' :
158
- ?>
159
- <p>
160
- <label for="<?php echo $this->get_field_id( $key ); ?>"><?php echo $setting['label']; ?></label>
161
- <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( $key ) ); ?>" name="<?php echo $this->get_field_name( $key ); ?>" type="number" step="<?php echo esc_attr( $setting['step'] ); ?>" min="<?php echo esc_attr( $setting['min'] ); ?>" max="<?php echo esc_attr( $setting['max'] ); ?>" value="<?php echo esc_attr( $value ); ?>" />
162
- </p>
163
- <?php
164
- break;
165
- }
166
- }
167
- }
168
-
169
- /**
170
- * widget function.
171
- *
172
- * @see WP_Widget
173
- * @access public
174
- *
175
- * @param array $args
176
- * @param array $instance
177
- *
178
- * @return void
179
- */
180
- public function widget( $args, $instance ) {}
181
- }
182
-
183
- /**
184
- * Recent Jobs Widget
185
- */
186
- class WP_Job_Manager_Widget_Recent_Jobs extends WP_Job_Manager_Widget {
187
-
188
- /**
189
- * Constructor
190
- */
191
- public function __construct() {
192
- global $wp_post_types;
193
-
194
- $this->widget_cssclass = 'job_manager widget_recent_jobs';
195
- $this->widget_description = __( 'Display a list of recent listings on your site, optionally matching a keyword and location.', 'wp-job-manager' );
196
- $this->widget_id = 'widget_recent_jobs';
197
- $this->widget_name = sprintf( __( 'Recent %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name );
198
- $this->settings = array(
199
- 'title' => array(
200
- 'type' => 'text',
201
- 'std' => sprintf( __( 'Recent %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name ),
202
- 'label' => __( 'Title', 'wp-job-manager' )
203
- ),
204
- 'keyword' => array(
205
- 'type' => 'text',
206
- 'std' => '',
207
- 'label' => __( 'Keyword', 'wp-job-manager' )
208
- ),
209
- 'location' => array(
210
- 'type' => 'text',
211
- 'std' => '',
212
- 'label' => __( 'Location', 'wp-job-manager' )
213
- ),
214
- 'number' => array(
215
- 'type' => 'number',
216
- 'step' => 1,
217
- 'min' => 1,
218
- 'max' => '',
219
- 'std' => 10,
220
- 'label' => __( 'Number of listings to show', 'wp-job-manager' )
221
- )
222
- );
223
- $this->register();
224
- }
225
-
226
- /**
227
- * widget function.
228
- *
229
- * @see WP_Widget
230
- * @access public
231
- * @param array $args
232
- * @param array $instance
233
- * @return void
234
- */
235
- public function widget( $args, $instance ) {
236
- if ( $this->get_cached_widget( $args ) ) {
237
- return;
238
- }
239
-
240
- ob_start();
241
-
242
- extract( $args );
243
-
244
- $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
245
- $number = absint( $instance['number'] );
246
- $jobs = get_job_listings( array(
247
- 'search_location' => isset( $instance['location'] ) ? $instance['location'] : '',
248
- 'search_keywords' => isset( $instance['keyword'] ) ? $instance['keyword'] : '',
249
- 'posts_per_page' => $number,
250
- 'orderby' => 'date',
251
- 'order' => 'DESC',
252
- ) );
253
-
254
- if ( $jobs->have_posts() ) : ?>
255
-
256
- <?php echo $before_widget; ?>
257
-
258
- <?php if ( $title ) echo $before_title . $title . $after_title; ?>
259
-
260
- <ul class="job_listings">
261
-
262
- <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
263
-
264
- <?php get_job_manager_template_part( 'content-widget', 'job_listing' ); ?>
265
-
266
- <?php endwhile; ?>
267
-
268
- </ul>
269
-
270
- <?php echo $after_widget; ?>
271
-
272
- <?php else : ?>
273
-
274
- <?php get_job_manager_template_part( 'content-widget', 'no-jobs-found' ); ?>
275
-
276
- <?php endif;
277
-
278
- wp_reset_postdata();
279
-
280
- $content = ob_get_clean();
281
-
282
- echo $content;
283
-
284
- $this->cache_widget( $args, $content );
285
- }
286
- }
287
-
288
- /**
289
- * Featured Jobs Widget
290
- */
291
- class WP_Job_Manager_Widget_Featured_Jobs extends WP_Job_Manager_Widget {
292
-
293
- /**
294
- * Constructor
295
- */
296
- public function __construct() {
297
- global $wp_post_types;
298
-
299
- $this->widget_cssclass = 'job_manager widget_featured_jobs';
300
- $this->widget_description = __( 'Display a list of featured listings on your site.', 'wp-job-manager' );
301
- $this->widget_id = 'widget_featured_jobs';
302
- $this->widget_name = sprintf( __( 'Featured %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name );
303
- $this->settings = array(
304
- 'title' => array(
305
- 'type' => 'text',
306
- 'std' => sprintf( __( 'Featured %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name ),
307
- 'label' => __( 'Title', 'wp-job-manager' )
308
- ),
309
- 'number' => array(
310
- 'type' => 'number',
311
- 'step' => 1,
312
- 'min' => 1,
313
- 'max' => '',
314
- 'std' => 10,
315
- 'label' => __( 'Number of listings to show', 'wp-job-manager' )
316
- )
317
- );
318
- $this->register();
319
- }
320
-
321
- /**
322
- * widget function.
323
- *
324
- * @see WP_Widget
325
- * @access public
326
- * @param array $args
327
- * @param array $instance
328
- * @return void
329
- */
330
- public function widget( $args, $instance ) {
331
- if ( $this->get_cached_widget( $args ) ) {
332
- return;
333
- }
334
-
335
- ob_start();
336
-
337
- extract( $args );
338
-
339
- $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
340
- $number = absint( $instance['number'] );
341
- $jobs = get_job_listings( array(
342
- 'posts_per_page' => $number,
343
- 'orderby' => 'date',
344
- 'order' => 'DESC',
345
- 'featured' => true
346
- ) );
347
-
348
- if ( $jobs->have_posts() ) : ?>
349
-
350
- <?php echo $before_widget; ?>
351
-
352
- <?php if ( $title ) echo $before_title . $title . $after_title; ?>
353
-
354
- <ul class="job_listings">
355
-
356
- <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
357
-
358
- <?php get_job_manager_template_part( 'content-widget', 'job_listing' ); ?>
359
-
360
- <?php endwhile; ?>
361
-
362
- </ul>
363
-
364
- <?php echo $after_widget; ?>
365
-
366
- <?php else : ?>
367
-
368
- <?php get_job_manager_template_part( 'content-widget', 'no-jobs-found' ); ?>
369
-
370
- <?php endif;
371
-
372
- wp_reset_postdata();
373
-
374
- $content = ob_get_clean();
375
-
376
- echo $content;
377
-
378
- $this->cache_widget( $args, $content );
379
- }
380
- }
381
-
382
- register_widget( 'WP_Job_Manager_Widget_Recent_Jobs' );
383
- register_widget( 'WP_Job_Manager_Widget_Featured_Jobs' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/forms/class-wp-job-manager-form-edit-job.php CHANGED
@@ -3,14 +3,17 @@
3
  include_once( 'class-wp-job-manager-form-submit-job.php' );
4
 
5
  /**
6
- * WP_Job_Manager_Form_Edit_Job class.
 
 
 
 
7
  */
8
  class WP_Job_Manager_Form_Edit_Job extends WP_Job_Manager_Form_Submit_Job {
9
 
10
  /**
11
  * Form name
12
  *
13
- * @access public
14
  * @var string
15
  */
16
  public $form_name = 'edit-job';
@@ -46,6 +49,8 @@ class WP_Job_Manager_Form_Edit_Job extends WP_Job_Manager_Form_Submit_Job {
46
 
47
  /**
48
  * output function.
 
 
49
  */
50
  public function output( $atts = array() ) {
51
  $this->submit_handler();
3
  include_once( 'class-wp-job-manager-form-submit-job.php' );
4
 
5
  /**
6
+ * Handles the editing of Job Listings from the public facing frontend (from within `[job_dashboard]` shortcode).
7
+ *
8
+ * @package wp-job-manager
9
+ * @since 1.0.0
10
+ * @extends WP_Job_Manager_Form_Submit_Job
11
  */
12
  class WP_Job_Manager_Form_Edit_Job extends WP_Job_Manager_Form_Submit_Job {
13
 
14
  /**
15
  * Form name
16
  *
 
17
  * @var string
18
  */
19
  public $form_name = 'edit-job';
49
 
50
  /**
51
  * output function.
52
+ *
53
+ * @param array $atts
54
  */
55
  public function output( $atts = array() ) {
56
  $this->submit_handler();
includes/forms/class-wp-job-manager-form-submit-job.php CHANGED
@@ -1,20 +1,23 @@
1
  <?php
2
 
3
  /**
4
- * WP_Job_Manager_Form_Submit_Job class.
 
 
 
 
5
  */
6
  class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
7
 
8
  /**
9
- * Form name
10
  *
11
- * @access public
12
  * @var string
13
  */
14
  public $form_name = 'submit-job';
15
 
16
  /**
17
- * Job id
18
  *
19
  * @access protected
20
  * @var int
@@ -22,7 +25,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
22
  protected $job_id;
23
 
24
  /**
25
- * Preview job
26
  *
27
  * @access protected
28
  * @var string
@@ -30,7 +33,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
30
  protected $preview_job;
31
 
32
  /**
33
- * Instance
34
  *
35
  * @access protected
36
  * @var WP_Job_Manager_Form_Submit_Job The single instance of the class
@@ -38,7 +41,9 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
38
  protected static $_instance = null;
39
 
40
  /**
41
- * Main Instance
 
 
42
  */
43
  public static function instance() {
44
  if ( is_null( self::$_instance ) ) {
@@ -89,12 +94,14 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
89
  }
90
 
91
  // Allow resuming from cookie.
92
- if ( ! $this->job_id && ! empty( $_COOKIE['wp-job-manager-submitting-job-id'] ) && ! empty( $_COOKIE['wp-job-manager-submitting-job-key'] ) ) {
 
93
  $job_id = absint( $_COOKIE['wp-job-manager-submitting-job-id'] );
94
  $job_status = get_post_status( $job_id );
95
 
96
  if ( ( 'preview' === $job_status || 'pending_payment' === $job_status ) && get_post_meta( $job_id, '_submitting_key', true ) === $_COOKIE['wp-job-manager-submitting-job-key'] ) {
97
  $this->job_id = $job_id;
 
98
  }
99
  }
100
 
@@ -114,7 +121,8 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
114
  }
115
 
116
  /**
117
- * Get the submitted job ID
 
118
  * @return int
119
  */
120
  public function get_job_id() {
@@ -122,7 +130,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
122
  }
123
 
124
  /**
125
- * init_fields function.
126
  */
127
  public function init_fields() {
128
  if ( $this->fields ) {
@@ -171,7 +179,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
171
  'label' => __( 'Job type', 'wp-job-manager' ),
172
  'type' => $job_type,
173
  'required' => true,
174
- 'placeholder' => '',
175
  'priority' => 3,
176
  'default' => 'full-time',
177
  'taxonomy' => 'job_listing_type'
@@ -264,9 +272,11 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
264
  }
265
 
266
  /**
267
- * Validate the posted fields
268
  *
269
- * @return bool on success, WP_ERROR on failure
 
 
270
  */
271
  protected function validate_fields( $values ) {
272
  foreach ( $this->fields as $group_key => $group_fields ) {
@@ -343,7 +353,9 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
343
  }
344
 
345
  /**
346
- * job_types function.
 
 
347
  */
348
  private function job_types() {
349
  $options = array();
@@ -355,7 +367,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
355
  }
356
 
357
  /**
358
- * Submit Step
359
  */
360
  public function submit() {
361
  $this->init_fields();
@@ -412,6 +424,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
412
  get_job_manager_template( 'job-submit.php', array(
413
  'form' => $this->form_name,
414
  'job_id' => $this->get_job_id(),
 
415
  'action' => $this->get_action(),
416
  'job_fields' => $this->get_fields( 'job' ),
417
  'company_fields' => $this->get_fields( 'company' ),
@@ -421,7 +434,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
421
  }
422
 
423
  /**
424
- * Submit Step is posted
425
  */
426
  public function submit_handler() {
427
  try {
@@ -485,13 +498,13 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
485
  }
486
 
487
  /**
488
- * Update or create a job listing from posted data
489
  *
490
  * @param string $post_title
491
  * @param string $post_content
492
  * @param string $status
493
- * @param array $values
494
- * @param bool $update_slug
495
  */
496
  protected function save_job( $post_title, $post_content, $status = 'preview', $values = array(), $update_slug = true ) {
497
  $job_data = array(
@@ -547,7 +560,8 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
547
  }
548
 
549
  /**
550
- * Create an attachment
 
551
  * @param string $attachment_url
552
  * @return int attachment id
553
  */
@@ -585,7 +599,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
585
  }
586
 
587
  /**
588
- * Set job meta + terms based on posted values
589
  *
590
  * @param array $values
591
  */
@@ -664,7 +678,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
664
  }
665
 
666
  /**
667
- * Preview Step
668
  */
669
  public function preview() {
670
  global $post, $job_preview;
@@ -685,7 +699,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
685
  }
686
 
687
  /**
688
- * Preview Step Form handler
689
  */
690
  public function preview_handler() {
691
  if ( ! $_POST ) {
@@ -721,7 +735,7 @@ class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
721
  }
722
 
723
  /**
724
- * Done Step
725
  */
726
  public function done() {
727
  do_action( 'job_manager_job_submitted', $this->job_id );
1
  <?php
2
 
3
  /**
4
+ * Handles the editing of Job Listings from the public facing frontend (from within `[submit_job_form]` shortcode).
5
+ *
6
+ * @package wp-job-manager
7
+ * @extends WP_Job_Manager_Form
8
+ * @since 1.0.0
9
  */
10
  class WP_Job_Manager_Form_Submit_Job extends WP_Job_Manager_Form {
11
 
12
  /**
13
+ * Form name.
14
  *
 
15
  * @var string
16
  */
17
  public $form_name = 'submit-job';
18
 
19
  /**
20
+ * Job listing ID.
21
  *
22
  * @access protected
23
  * @var int
25
  protected $job_id;
26
 
27
  /**
28
+ * Preview job (unused)
29
  *
30
  * @access protected
31
  * @var string
33
  protected $preview_job;
34
 
35
  /**
36
+ * Stores static instance of class.
37
  *
38
  * @access protected
39
  * @var WP_Job_Manager_Form_Submit_Job The single instance of the class
41
  protected static $_instance = null;
42
 
43
  /**
44
+ * Returns static instance of class.
45
+ *
46
+ * @return self
47
  */
48
  public static function instance() {
49
  if ( is_null( self::$_instance ) ) {
94
  }
95
 
96
  // Allow resuming from cookie.
97
+ $this->resume_edit = false;
98
+ if ( ! isset( $_GET[ 'new' ] ) && ( 'before' === get_option( 'job_manager_paid_listings_flow' ) || ! $this->job_id ) && ! empty( $_COOKIE['wp-job-manager-submitting-job-id'] ) && ! empty( $_COOKIE['wp-job-manager-submitting-job-key'] ) ) {
99
  $job_id = absint( $_COOKIE['wp-job-manager-submitting-job-id'] );
100
  $job_status = get_post_status( $job_id );
101
 
102
  if ( ( 'preview' === $job_status || 'pending_payment' === $job_status ) && get_post_meta( $job_id, '_submitting_key', true ) === $_COOKIE['wp-job-manager-submitting-job-key'] ) {
103
  $this->job_id = $job_id;
104
+ $this->resume_edit = get_post_meta( $job_id, '_submitting_key', true );
105
  }
106
  }
107
 
121
  }
122
 
123
  /**
124
+ * Gets the submitted job ID.
125
+ *
126
  * @return int
127
  */
128
  public function get_job_id() {
130
  }
131
 
132
  /**
133
+ * Initializes the fields used in the form.
134
  */
135
  public function init_fields() {
136
  if ( $this->fields ) {
179
  'label' => __( 'Job type', 'wp-job-manager' ),
180
  'type' => $job_type,
181
  'required' => true,
182
+ 'placeholder' => __( 'Choose job type&hellip;', 'wp-job-manager' ),
183
  'priority' => 3,
184
  'default' => 'full-time',
185
  'taxonomy' => 'job_listing_type'
272
  }
273
 
274
  /**
275
+ * Validates the posted fields.
276
  *
277
+ * @param array $values
278
+ * @throws Exception Uploaded file is not a valid mime-type or other validation error
279
+ * @return bool|WP_Error True on success, WP_Error on failure
280
  */
281
  protected function validate_fields( $values ) {
282
  foreach ( $this->fields as $group_key => $group_fields ) {
353
  }
354
 
355
  /**
356
+ * Returns an array of the job types indexed by slug. (Unused)
357
+ *
358
+ * @return array
359
  */
360
  private function job_types() {
361
  $options = array();
367
  }
368
 
369
  /**
370
+ * Displays the form.
371
  */
372
  public function submit() {
373
  $this->init_fields();
424
  get_job_manager_template( 'job-submit.php', array(
425
  'form' => $this->form_name,
426
  'job_id' => $this->get_job_id(),
427
+ 'resume_edit' => $this->resume_edit,
428
  'action' => $this->get_action(),
429
  'job_fields' => $this->get_fields( 'job' ),
430
  'company_fields' => $this->get_fields( 'company' ),
434
  }
435
 
436
  /**
437
+ * Handles the submission of form data.
438
  */
439
  public function submit_handler() {
440
  try {
498
  }
499
 
500
  /**
501
+ * Updates or creates a job listing from posted data.
502
  *
503
  * @param string $post_title
504
  * @param string $post_content
505
  * @param string $status
506
+ * @param array $values
507
+ * @param bool $update_slug
508
  */
509
  protected function save_job( $post_title, $post_content, $status = 'preview', $values = array(), $update_slug = true ) {
510
  $job_data = array(
560
  }
561
 
562
  /**
563
+ * Creates a file attachment.
564
+ *
565
  * @param string $attachment_url
566
  * @return int attachment id
567
  */
599
  }
600
 
601
  /**
602
+ * Sets job meta and terms based on posted values.
603
  *
604
  * @param array $values
605
  */
678
  }
679
 
680
  /**
681
+ * Displays preview of Job Listing.
682
  */
683
  public function preview() {
684
  global $post, $job_preview;
699
  }
700
 
701
  /**
702
+ * Handles the preview step form response.
703
  */
704
  public function preview_handler() {
705
  if ( ! $_POST ) {
735
  }
736
 
737
  /**
738
+ * Displays the final screen after a job listing has been submitted.
739
  */
740
  public function done() {
741
  do_action( 'job_manager_job_submitted', $this->job_id );
includes/widgets/class-wp-job-manager-widget-featured-jobs.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Featured Jobs widget.
8
+ *
9
+ * @package wp-job-manager
10
+ * @since 1.21.0
11
+ */
12
+ class WP_Job_Manager_Widget_Featured_Jobs extends WP_Job_Manager_Widget {
13
+
14
+ /**
15
+ * Constructor.
16
+ */
17
+ public function __construct() {
18
+ global $wp_post_types;
19
+
20
+ $this->widget_cssclass = 'job_manager widget_featured_jobs';
21
+ $this->widget_description = __( 'Display a list of featured listings on your site.', 'wp-job-manager' );
22
+ $this->widget_id = 'widget_featured_jobs';
23
+ $this->widget_name = sprintf( __( 'Featured %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name );
24
+ $this->settings = array(
25
+ 'title' => array(
26
+ 'type' => 'text',
27
+ 'std' => sprintf( __( 'Featured %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name ),
28
+ 'label' => __( 'Title', 'wp-job-manager' ),
29
+ ),
30
+ 'number' => array(
31
+ 'type' => 'number',
32
+ 'step' => 1,
33
+ 'min' => 1,
34
+ 'max' => '',
35
+ 'std' => 10,
36
+ 'label' => __( 'Number of listings to show', 'wp-job-manager' ),
37
+ ),
38
+ );
39
+ $this->register();
40
+ }
41
+
42
+ /**
43
+ * Echoes the widget content.
44
+ *
45
+ * @see WP_Widget
46
+ * @param array $args
47
+ * @param array $instance
48
+ */
49
+ public function widget( $args, $instance ) {
50
+ if ( $this->get_cached_widget( $args ) ) {
51
+ return;
52
+ }
53
+
54
+ ob_start();
55
+
56
+ extract( $args );
57
+
58
+ $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
59
+ $number = absint( $instance['number'] );
60
+ $jobs = get_job_listings( array(
61
+ 'posts_per_page' => $number,
62
+ 'orderby' => 'date',
63
+ 'order' => 'DESC',
64
+ 'featured' => true,
65
+ ) );
66
+
67
+ if ( $jobs->have_posts() ) : ?>
68
+
69
+ <?php echo $before_widget; ?>
70
+
71
+ <?php if ( $title ) { echo $before_title . $title . $after_title;} ?>
72
+
73
+ <ul class="job_listings">
74
+
75
+ <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
76
+
77
+ <?php get_job_manager_template_part( 'content-widget', 'job_listing' ); ?>
78
+
79
+ <?php endwhile; ?>
80
+
81
+ </ul>
82
+
83
+ <?php echo $after_widget; ?>
84
+
85
+ <?php else : ?>
86
+
87
+ <?php get_job_manager_template_part( 'content-widget', 'no-jobs-found' ); ?>
88
+
89
+ <?php endif;
90
+
91
+ wp_reset_postdata();
92
+
93
+ $content = ob_get_clean();
94
+
95
+ echo $content;
96
+
97
+ $this->cache_widget( $args, $content );
98
+ }
99
+ }
100
+
101
+ register_widget( 'WP_Job_Manager_Widget_Featured_Jobs' );
includes/widgets/class-wp-job-manager-widget-recent-jobs.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Recent Jobs widget.
8
+ *
9
+ * @package wp-job-manager
10
+ * @since 1.0.0
11
+ */
12
+ class WP_Job_Manager_Widget_Recent_Jobs extends WP_Job_Manager_Widget {
13
+
14
+ /**
15
+ * Constructor.
16
+ */
17
+ public function __construct() {
18
+ global $wp_post_types;
19
+
20
+ $this->widget_cssclass = 'job_manager widget_recent_jobs';
21
+ $this->widget_description = __( 'Display a list of recent listings on your site, optionally matching a keyword and location.', 'wp-job-manager' );
22
+ $this->widget_id = 'widget_recent_jobs';
23
+ $this->widget_name = sprintf( __( 'Recent %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name );
24
+ $this->settings = array(
25
+ 'title' => array(
26
+ 'type' => 'text',
27
+ 'std' => sprintf( __( 'Recent %s', 'wp-job-manager' ), $wp_post_types['job_listing']->labels->name ),
28
+ 'label' => __( 'Title', 'wp-job-manager' ),
29
+ ),
30
+ 'keyword' => array(
31
+ 'type' => 'text',
32
+ 'std' => '',
33
+ 'label' => __( 'Keyword', 'wp-job-manager' ),
34
+ ),
35
+ 'location' => array(
36
+ 'type' => 'text',
37
+ 'std' => '',
38
+ 'label' => __( 'Location', 'wp-job-manager' ),
39
+ ),
40
+ 'number' => array(
41
+ 'type' => 'number',
42
+ 'step' => 1,
43
+ 'min' => 1,
44
+ 'max' => '',
45
+ 'std' => 10,
46
+ 'label' => __( 'Number of listings to show', 'wp-job-manager' ),
47
+ ),
48
+ );
49
+ $this->register();
50
+ }
51
+
52
+ /**
53
+ * Echoes the widget content.
54
+ *
55
+ * @see WP_Widget
56
+ * @param array $args
57
+ * @param array $instance
58
+ */
59
+ public function widget( $args, $instance ) {
60
+ if ( $this->get_cached_widget( $args ) ) {
61
+ return;
62
+ }
63
+
64
+ ob_start();
65
+
66
+ extract( $args );
67
+
68
+ $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
69
+ $number = absint( $instance['number'] );
70
+ $jobs = get_job_listings( array(
71
+ 'search_location' => isset( $instance['location'] ) ? $instance['location'] : '',
72
+ 'search_keywords' => isset( $instance['keyword'] ) ? $instance['keyword'] : '',
73
+ 'posts_per_page' => $number,
74
+ 'orderby' => 'date',
75
+ 'order' => 'DESC',
76
+ ) );
77
+
78
+ if ( $jobs->have_posts() ) : ?>
79
+
80
+ <?php echo $before_widget; ?>
81
+
82
+ <?php if ( $title ) { echo $before_title . $title . $after_title;} ?>
83
+
84
+ <ul class="job_listings">
85
+
86
+ <?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
87
+
88
+ <?php get_job_manager_template_part( 'content-widget', 'job_listing' ); ?>
89
+
90
+ <?php endwhile; ?>
91
+
92
+ </ul>
93
+
94
+ <?php echo $after_widget; ?>
95
+
96
+ <?php else : ?>
97
+
98
+ <?php get_job_manager_template_part( 'content-widget', 'no-jobs-found' ); ?>
99
+
100
+ <?php endif;
101
+
102
+ wp_reset_postdata();
103
+
104
+ $content = ob_get_clean();
105
+
106
+ echo $content;
107
+
108
+ $this->cache_widget( $args, $content );
109
+ }
110
+ }
111
+
112
+ register_widget( 'WP_Job_Manager_Widget_Recent_Jobs' );
languages/wp-job-manager.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL2+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WP Job Manager 1.25.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-job-manager\n"
7
- "POT-Creation-Date: 2017-03-08 15:09:11+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -13,527 +13,549 @@ msgstr ""
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "X-Generator: grunt-wp-i18n 0.5.4\n"
15
 
16
- #: includes/admin/class-wp-job-manager-addons.php:57
17
- #: includes/admin/class-wp-job-manager-admin.php:66
18
  msgid "WP Job Manager Add-ons"
19
  msgstr ""
20
 
21
- #: includes/admin/class-wp-job-manager-addons.php:59
22
  msgid "Do you need multiple add-ons?"
23
  msgstr ""
24
 
25
- #: includes/admin/class-wp-job-manager-addons.php:59
26
  msgid "Check out the core add-on bundle &rarr;"
27
  msgstr ""
28
 
29
- #: includes/admin/class-wp-job-manager-admin.php:63
30
  msgid "Settings"
31
  msgstr ""
32
 
33
- #: includes/admin/class-wp-job-manager-admin.php:66
34
  msgid "Add-ons"
35
  msgstr ""
36
 
37
- #: includes/admin/class-wp-job-manager-cpt.php:50
38
- #: includes/admin/class-wp-job-manager-cpt.php:51
39
  msgid "Approve %s"
40
  msgstr ""
41
 
42
- #: includes/admin/class-wp-job-manager-cpt.php:53
43
- #: includes/admin/class-wp-job-manager-cpt.php:54
44
  msgid "Expire %s"
45
  msgstr ""
46
 
47
- #: includes/admin/class-wp-job-manager-cpt.php:142
48
- #: includes/admin/class-wp-job-manager-cpt.php:144
49
  msgid "%s approved"
50
  msgstr ""
51
 
52
- #: includes/admin/class-wp-job-manager-cpt.php:162
53
- #: includes/admin/class-wp-job-manager-cpt.php:164
54
  msgid "%s expired"
55
  msgstr ""
56
 
57
- #: includes/admin/class-wp-job-manager-cpt.php:196
58
  msgid "Select category"
59
  msgstr ""
60
 
61
- #: includes/admin/class-wp-job-manager-cpt.php:211
62
- #: includes/admin/class-wp-job-manager-cpt.php:257
63
  msgid "Position"
64
  msgstr ""
65
 
66
- #: includes/admin/class-wp-job-manager-cpt.php:227
67
  msgid "%s updated. <a href=\"%s\">View</a>"
68
  msgstr ""
69
 
70
- #: includes/admin/class-wp-job-manager-cpt.php:228
71
  msgid "Custom field updated."
72
  msgstr ""
73
 
74
- #: includes/admin/class-wp-job-manager-cpt.php:229
75
  msgid "Custom field deleted."
76
  msgstr ""
77
 
78
- #: includes/admin/class-wp-job-manager-cpt.php:230
79
  msgid "%s updated."
80
  msgstr ""
81
 
82
- #: includes/admin/class-wp-job-manager-cpt.php:231
83
  msgid "%s restored to revision from %s"
84
  msgstr ""
85
 
86
- #: includes/admin/class-wp-job-manager-cpt.php:232
87
  msgid "%s published. <a href=\"%s\">View</a>"
88
  msgstr ""
89
 
90
- #: includes/admin/class-wp-job-manager-cpt.php:233
91
  msgid "%s saved."
92
  msgstr ""
93
 
94
- #: includes/admin/class-wp-job-manager-cpt.php:234
95
  msgid "%s submitted. <a target=\"_blank\" href=\"%s\">Preview</a>"
96
  msgstr ""
97
 
98
- #: includes/admin/class-wp-job-manager-cpt.php:235
99
  msgid ""
100
  "%s scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" "
101
  "href=\"%2$s\">Preview</a>"
102
  msgstr ""
103
 
104
- #: includes/admin/class-wp-job-manager-cpt.php:236
105
  msgid "M j, Y @ G:i"
106
  msgstr ""
107
 
108
- #: includes/admin/class-wp-job-manager-cpt.php:237
109
  msgid "%s draft updated. <a target=\"_blank\" href=\"%s\">Preview</a>"
110
  msgstr ""
111
 
112
- #: includes/admin/class-wp-job-manager-cpt.php:256
113
  msgid "Type"
114
  msgstr ""
115
 
116
- #: includes/admin/class-wp-job-manager-cpt.php:258
117
- #: includes/admin/class-wp-job-manager-writepanels.php:31
118
- #: includes/class-wp-job-manager-widgets.php:212
119
- #: includes/forms/class-wp-job-manager-form-submit-job.php:163
120
  #: templates/job-filters.php:17 templates/job-filters.php:18
121
  msgid "Location"
122
  msgstr ""
123
 
124
- #: includes/admin/class-wp-job-manager-cpt.php:259
125
  msgid "Status"
126
  msgstr ""
127
 
128
- #: includes/admin/class-wp-job-manager-cpt.php:260
129
  msgid "Posted"
130
  msgstr ""
131
 
132
- #: includes/admin/class-wp-job-manager-cpt.php:261
133
  msgid "Expires"
134
  msgstr ""
135
 
136
- #: includes/admin/class-wp-job-manager-cpt.php:262
137
- #: includes/admin/class-wp-job-manager-settings.php:73
138
  msgid "Categories"
139
  msgstr ""
140
 
141
- #: includes/admin/class-wp-job-manager-cpt.php:263
142
  msgid "Featured?"
143
  msgstr ""
144
 
145
- #: includes/admin/class-wp-job-manager-cpt.php:264
146
- #: includes/class-wp-job-manager-shortcodes.php:187
147
  msgid "Filled?"
148
  msgstr ""
149
 
150
- #: includes/admin/class-wp-job-manager-cpt.php:265
151
  msgid "Actions"
152
  msgstr ""
153
 
154
- #: includes/admin/class-wp-job-manager-cpt.php:296
155
  msgid "ID: %d"
156
  msgstr ""
157
 
158
- #: includes/admin/class-wp-job-manager-cpt.php:324
159
- #: includes/admin/class-wp-job-manager-cpt.php:329
160
  msgid "M j, Y"
161
  msgstr ""
162
 
163
- #: includes/admin/class-wp-job-manager-cpt.php:325
164
  msgid "by a guest"
165
  msgstr ""
166
 
167
- #: includes/admin/class-wp-job-manager-cpt.php:325
168
  msgid "by %s"
169
  msgstr ""
170
 
171
- #: includes/admin/class-wp-job-manager-cpt.php:343
172
  msgid "Approve"
173
  msgstr ""
174
 
175
- #: includes/admin/class-wp-job-manager-cpt.php:351
176
- #: includes/admin/class-wp-job-manager-writepanels.php:217
177
- #: includes/admin/class-wp-job-manager-writepanels.php:220
178
- #: includes/admin/class-wp-job-manager-writepanels.php:223
179
  msgid "View"
180
  msgstr ""
181
 
182
- #: includes/admin/class-wp-job-manager-cpt.php:358
183
- #: includes/class-wp-job-manager-post-types.php:193
184
  #: templates/job-dashboard.php:33 templates/job-dashboard.php:51
185
  msgid "Edit"
186
  msgstr ""
187
 
188
- #: includes/admin/class-wp-job-manager-cpt.php:365
189
  #: templates/job-dashboard.php:56
190
  msgid "Delete"
191
  msgstr ""
192
 
193
- #: includes/admin/class-wp-job-manager-settings.php:42
194
- #: includes/admin/class-wp-job-manager-writepanels.php:131
195
- #: includes/class-wp-job-manager-post-types.php:189
196
- #: includes/class-wp-job-manager-post-types.php:256
197
  msgid "Job Listings"
198
  msgstr ""
199
 
200
- #: includes/admin/class-wp-job-manager-settings.php:48
201
  msgid "Listings Per Page"
202
  msgstr ""
203
 
204
- #: includes/admin/class-wp-job-manager-settings.php:49
205
  msgid "How many listings should be shown per page by default?"
206
  msgstr ""
207
 
208
- #: includes/admin/class-wp-job-manager-settings.php:55
209
  msgid "Filled Positions"
210
  msgstr ""
211
 
212
- #: includes/admin/class-wp-job-manager-settings.php:56
213
  msgid "Hide filled positions"
214
  msgstr ""
215
 
216
- #: includes/admin/class-wp-job-manager-settings.php:57
217
  msgid "If enabled, filled positions will be hidden from archives."
218
  msgstr ""
219
 
220
- #: includes/admin/class-wp-job-manager-settings.php:64
221
- msgid "Expired Listings"
 
 
 
 
 
 
 
 
222
  msgstr ""
223
 
224
- #: includes/admin/class-wp-job-manager-settings.php:65
225
- msgid "Hide content within expired listings"
226
  msgstr ""
227
 
228
- #: includes/admin/class-wp-job-manager-settings.php:66
 
 
 
 
229
  msgid ""
230
  "If enabled, the content within expired listings will be hidden. Otherwise, "
231
  "expired listings will be displayed as normal (without the application area)."
232
  msgstr ""
233
 
234
- #: includes/admin/class-wp-job-manager-settings.php:74
235
  msgid "Enable categories for listings"
236
  msgstr ""
237
 
238
- #: includes/admin/class-wp-job-manager-settings.php:75
239
  msgid ""
240
  "Choose whether to enable categories. Categories must be setup by an admin "
241
  "to allow users to choose them during submission."
242
  msgstr ""
243
 
244
- #: includes/admin/class-wp-job-manager-settings.php:82
245
  msgid "Multi-select Categories"
246
  msgstr ""
247
 
248
- #: includes/admin/class-wp-job-manager-settings.php:83
249
  msgid "Enable category multiselect by default"
250
  msgstr ""
251
 
252
- #: includes/admin/class-wp-job-manager-settings.php:84
253
  msgid ""
254
  "If enabled, the category select box will default to a multiselect on the "
255
  "[jobs] shortcode."
256
  msgstr ""
257
 
258
- #: includes/admin/class-wp-job-manager-settings.php:91
259
  msgid "Category Filter Type"
260
  msgstr ""
261
 
262
- #: includes/admin/class-wp-job-manager-settings.php:92
263
  msgid ""
264
  "Determines the logic used to display jobs when selecting multiple "
265
  "categories."
266
  msgstr ""
267
 
268
- #: includes/admin/class-wp-job-manager-settings.php:95
269
  msgid "Jobs will be shown if within ANY selected category"
270
  msgstr ""
271
 
272
- #: includes/admin/class-wp-job-manager-settings.php:96
273
  msgid "Jobs will be shown if within ALL selected categories"
274
  msgstr ""
275
 
276
- #: includes/admin/class-wp-job-manager-settings.php:102
277
  msgid "Date Format"
278
  msgstr ""
279
 
280
- #: includes/admin/class-wp-job-manager-settings.php:103
281
  msgid ""
282
  "Choose how you want the published date for jobs to be displayed on the "
283
  "front-end."
284
  msgstr ""
285
 
286
- #: includes/admin/class-wp-job-manager-settings.php:106
287
  msgid "Relative to the current date (e.g., 1 day, 1 week, 1 month ago)"
288
  msgstr ""
289
 
290
- #: includes/admin/class-wp-job-manager-settings.php:107
291
  msgid "Default date format as defined in Setttings"
292
  msgstr ""
293
 
294
- #: includes/admin/class-wp-job-manager-settings.php:113
295
  msgid "Types"
296
  msgstr ""
297
 
298
- #: includes/admin/class-wp-job-manager-settings.php:114
299
  msgid "Enable types for listings"
300
  msgstr ""
301
 
302
- #: includes/admin/class-wp-job-manager-settings.php:115
303
  msgid ""
304
  "Choose whether to enable types. Types must be setup by an admin to allow "
305
  "users to choose them during submission."
306
  msgstr ""
307
 
308
- #: includes/admin/class-wp-job-manager-settings.php:122
309
  msgid "Multi-select Listing Types"
310
  msgstr ""
311
 
312
- #: includes/admin/class-wp-job-manager-settings.php:123
313
  msgid "Enable multiple types for listings"
314
  msgstr ""
315
 
316
- #: includes/admin/class-wp-job-manager-settings.php:124
317
  msgid ""
318
  "If enabled each job can have more than one type. The metabox on the post "
319
  "editor and the select box on the frontend job submission form are changed "
320
  "by this."
321
  msgstr ""
322
 
323
- #: includes/admin/class-wp-job-manager-settings.php:131
 
 
 
 
 
 
 
 
 
 
 
324
  msgid "Job Submission"
325
  msgstr ""
326
 
327
- #: includes/admin/class-wp-job-manager-settings.php:136
328
  msgid "Account Required"
329
  msgstr ""
330
 
331
- #: includes/admin/class-wp-job-manager-settings.php:137
332
  msgid "Submitting listings requires an account"
333
  msgstr ""
334
 
335
- #: includes/admin/class-wp-job-manager-settings.php:138
336
  msgid ""
337
  "If disabled, non-logged in users will be able to submit listings without "
338
  "creating an account."
339
  msgstr ""
340
 
341
- #: includes/admin/class-wp-job-manager-settings.php:145
342
  msgid "Account Creation"
343
  msgstr ""
344
 
345
- #: includes/admin/class-wp-job-manager-settings.php:146
346
  msgid "Allow account creation"
347
  msgstr ""
348
 
349
- #: includes/admin/class-wp-job-manager-settings.php:147
350
  msgid ""
351
  "If enabled, non-logged in users will be able to create an account by "
352
  "entering their email address on the submission form."
353
  msgstr ""
354
 
355
- #: includes/admin/class-wp-job-manager-settings.php:154
356
  msgid "Account Username"
357
  msgstr ""
358
 
359
- #: includes/admin/class-wp-job-manager-settings.php:155
360
  msgid "Automatically Generate Username from Email Address"
361
  msgstr ""
362
 
363
- #: includes/admin/class-wp-job-manager-settings.php:156
364
  msgid ""
365
  "If enabled, a username will be generated from the first part of the user "
366
  "email address. Otherwise, a username field will be shown."
367
  msgstr ""
368
 
369
- #: includes/admin/class-wp-job-manager-settings.php:163
370
  msgid "Account Role"
371
  msgstr ""
372
 
373
- #: includes/admin/class-wp-job-manager-settings.php:164
374
  msgid ""
375
  "If you enable registration on your submission form, choose a role for the "
376
  "new user."
377
  msgstr ""
378
 
379
- #: includes/admin/class-wp-job-manager-settings.php:171
380
  msgid "Moderate New Listings"
381
  msgstr ""
382
 
383
- #: includes/admin/class-wp-job-manager-settings.php:172
384
  msgid "New listing submissions require admin approval"
385
  msgstr ""
386
 
387
- #: includes/admin/class-wp-job-manager-settings.php:173
388
  msgid "If enabled, new submissions will be inactive, pending admin approval."
389
  msgstr ""
390
 
391
- #: includes/admin/class-wp-job-manager-settings.php:180
392
  msgid "Allow Pending Edits"
393
  msgstr ""
394
 
395
- #: includes/admin/class-wp-job-manager-settings.php:181
396
  msgid "Submissions awaiting approval can be edited"
397
  msgstr ""
398
 
399
- #: includes/admin/class-wp-job-manager-settings.php:182
400
  msgid "If enabled, submissions awaiting admin approval can be edited by the user."
401
  msgstr ""
402
 
403
- #: includes/admin/class-wp-job-manager-settings.php:189
404
  msgid "Listing Duration"
405
  msgstr ""
406
 
407
- #: includes/admin/class-wp-job-manager-settings.php:190
408
  msgid ""
409
  "How many <strong>days</strong> listings are live before expiring. Can be "
410
  "left blank to never expire."
411
  msgstr ""
412
 
413
- #: includes/admin/class-wp-job-manager-settings.php:196
414
  msgid "Application Method"
415
  msgstr ""
416
 
417
- #: includes/admin/class-wp-job-manager-settings.php:197
418
  msgid "Choose the contact method for listings."
419
  msgstr ""
420
 
421
- #: includes/admin/class-wp-job-manager-settings.php:200
422
  msgid "Email address or website URL"
423
  msgstr ""
424
 
425
- #: includes/admin/class-wp-job-manager-settings.php:201
426
  msgid "Email addresses only"
427
  msgstr ""
428
 
429
- #: includes/admin/class-wp-job-manager-settings.php:202
430
  msgid "Website URLs only"
431
  msgstr ""
432
 
433
- #: includes/admin/class-wp-job-manager-settings.php:208
434
  msgid "Pages"
435
  msgstr ""
436
 
437
- #: includes/admin/class-wp-job-manager-settings.php:213
438
  msgid "Submit Job Form Page"
439
  msgstr ""
440
 
441
- #: includes/admin/class-wp-job-manager-settings.php:214
442
  msgid ""
443
  "Select the page where you have placed the [submit_job_form] shortcode. This "
444
  "lets the plugin know where the form is located."
445
  msgstr ""
446
 
447
- #: includes/admin/class-wp-job-manager-settings.php:220
448
  msgid "Job Dashboard Page"
449
  msgstr ""
450
 
451
- #: includes/admin/class-wp-job-manager-settings.php:221
452
  msgid ""
453
  "Select the page where you have placed the [job_dashboard] shortcode. This "
454
  "lets the plugin know where the dashboard is located."
455
  msgstr ""
456
 
457
- #: includes/admin/class-wp-job-manager-settings.php:227
458
  msgid "Job Listings Page"
459
  msgstr ""
460
 
461
- #: includes/admin/class-wp-job-manager-settings.php:228
462
  msgid ""
463
  "Select the page where you have placed the [jobs] shortcode. This lets the "
464
  "plugin know where the job listings page is located."
465
  msgstr ""
466
 
467
- #: includes/admin/class-wp-job-manager-settings.php:280
468
  msgid "Settings successfully saved"
469
  msgstr ""
470
 
471
- #: includes/admin/class-wp-job-manager-settings.php:340
472
  msgid "--no page--"
473
  msgstr ""
474
 
475
- #: includes/admin/class-wp-job-manager-settings.php:345
476
  msgid "Select a page&hellip;"
477
  msgstr ""
478
 
479
- #: includes/admin/class-wp-job-manager-settings.php:391
480
  msgid "Save Changes"
481
  msgstr ""
482
 
483
- #: includes/admin/class-wp-job-manager-setup.php:32
484
  msgid "Setup"
485
  msgstr ""
486
 
487
- #: includes/admin/class-wp-job-manager-setup.php:131
488
  msgid "WP Job Manager Setup"
489
  msgstr ""
490
 
491
- #: includes/admin/class-wp-job-manager-setup.php:134
492
  msgid "1. Introduction"
493
  msgstr ""
494
 
495
- #: includes/admin/class-wp-job-manager-setup.php:135
496
  msgid "2. Page Setup"
497
  msgstr ""
498
 
499
- #: includes/admin/class-wp-job-manager-setup.php:136
500
  msgid "3. Done"
501
  msgstr ""
502
 
503
- #: includes/admin/class-wp-job-manager-setup.php:141
504
  msgid "Setup Wizard Introduction"
505
  msgstr ""
506
 
507
- #: includes/admin/class-wp-job-manager-setup.php:143
508
  msgid "Thanks for installing <em>WP Job Manager</em>!"
509
  msgstr ""
510
 
511
- #: includes/admin/class-wp-job-manager-setup.php:144
512
  msgid ""
513
  "This setup wizard will help you get started by creating the pages for job "
514
  "submission, job management, and listing your jobs."
515
  msgstr ""
516
 
517
- #: includes/admin/class-wp-job-manager-setup.php:145
518
  msgid ""
519
  "If you want to skip the wizard and setup the pages and shortcodes yourself "
520
  "manually, the process is still relatively simple. Refer to the "
521
  "%sdocumentation%s for help."
522
  msgstr ""
523
 
524
- #: includes/admin/class-wp-job-manager-setup.php:148
525
  msgid "Continue to page setup"
526
  msgstr ""
527
 
528
- #: includes/admin/class-wp-job-manager-setup.php:149
529
  msgid "Skip setup. I will setup the plugin manually"
530
  msgstr ""
531
 
532
- #: includes/admin/class-wp-job-manager-setup.php:155
533
  msgid "Page Setup"
534
  msgstr ""
535
 
536
- #: includes/admin/class-wp-job-manager-setup.php:157
537
  msgid ""
538
  "<em>WP Job Manager</em> includes %1$sshortcodes%2$s which can be used "
539
  "within your %3$spages%2$s to output content. These can be created for you "
@@ -541,104 +563,104 @@ msgid ""
541
  "documentation%2$s."
542
  msgstr ""
543
 
544
- #: includes/admin/class-wp-job-manager-setup.php:165
545
  msgid "Page Title"
546
  msgstr ""
547
 
548
- #: includes/admin/class-wp-job-manager-setup.php:166
549
  msgid "Page Description"
550
  msgstr ""
551
 
552
- #: includes/admin/class-wp-job-manager-setup.php:167
553
  msgid "Content Shortcode"
554
  msgstr ""
555
 
556
- #: includes/admin/class-wp-job-manager-setup.php:175
557
  msgid "This page allows employers to post jobs to your website from the front-end."
558
  msgstr ""
559
 
560
- #: includes/admin/class-wp-job-manager-setup.php:177
561
  msgid ""
562
  "If you do not want to accept submissions from users in this way (for "
563
  "example you just want to post jobs from the admin dashboard) you can skip "
564
  "creating this page."
565
  msgstr ""
566
 
567
- #: includes/admin/class-wp-job-manager-setup.php:185
568
  msgid ""
569
  "This page allows employers to manage and edit their own jobs from the "
570
  "front-end."
571
  msgstr ""
572
 
573
- #: includes/admin/class-wp-job-manager-setup.php:187
574
  msgid ""
575
  "If you plan on managing all listings from the admin dashboard you can skip "
576
  "creating this page."
577
  msgstr ""
578
 
579
- #: includes/admin/class-wp-job-manager-setup.php:194
580
  msgid ""
581
  "This page allows users to browse, search, and filter job listings on the "
582
  "front-end of your site."
583
  msgstr ""
584
 
585
- #: includes/admin/class-wp-job-manager-setup.php:202
586
  msgid "Skip this step"
587
  msgstr ""
588
 
589
- #: includes/admin/class-wp-job-manager-setup.php:212
590
  msgid "All Done!"
591
  msgstr ""
592
 
593
- #: includes/admin/class-wp-job-manager-setup.php:214
594
  msgid ""
595
  "Looks like you're all set to start using the plugin. In case you're "
596
  "wondering where to go next:"
597
  msgstr ""
598
 
599
- #: includes/admin/class-wp-job-manager-setup.php:217
600
  msgid "Tweak the plugin settings"
601
  msgstr ""
602
 
603
- #: includes/admin/class-wp-job-manager-setup.php:218
604
  msgid "Add a job via the back-end"
605
  msgstr ""
606
 
607
- #: includes/admin/class-wp-job-manager-setup.php:221
608
  msgid "Add a job via the front-end"
609
  msgstr ""
610
 
611
- #: includes/admin/class-wp-job-manager-setup.php:223
612
  msgid "Find out more about the front-end job submission form"
613
  msgstr ""
614
 
615
- #: includes/admin/class-wp-job-manager-setup.php:227
616
  msgid "View submitted job listings"
617
  msgstr ""
618
 
619
- #: includes/admin/class-wp-job-manager-setup.php:229
620
  msgid "Add the [jobs] shortcode to a page to list jobs"
621
  msgstr ""
622
 
623
- #: includes/admin/class-wp-job-manager-setup.php:233
624
  msgid "View the job dashboard"
625
  msgstr ""
626
 
627
- #: includes/admin/class-wp-job-manager-setup.php:235
628
  msgid "Find out more about the front-end job dashboard"
629
  msgstr ""
630
 
631
- #: includes/admin/class-wp-job-manager-setup.php:239
632
  msgid ""
633
  "And don't forget, if you need any more help using <em>WP Job Manager</em> "
634
  "you can consult the %1$sdocumentation%2$s or %3$spost on the forums%2$s!"
635
  msgstr ""
636
 
637
- #: includes/admin/class-wp-job-manager-setup.php:242
638
  msgid "Support the Ongoing Development of this Plugin"
639
  msgstr ""
640
 
641
- #: includes/admin/class-wp-job-manager-setup.php:243
642
  msgid ""
643
  "There are many ways to support open-source projects such as WP Job Manager, "
644
  "for example code contribution, translation, or even telling your friends "
@@ -646,514 +668,514 @@ msgid ""
646
  "it is much appreciated!"
647
  msgstr ""
648
 
649
- #: includes/admin/class-wp-job-manager-setup.php:245
650
  msgid "Leave a positive review"
651
  msgstr ""
652
 
653
- #: includes/admin/class-wp-job-manager-setup.php:246
654
  msgid "Contribute a localization"
655
  msgstr ""
656
 
657
- #: includes/admin/class-wp-job-manager-setup.php:247
658
  msgid "Contribute code or report a bug"
659
  msgstr ""
660
 
661
- #: includes/admin/class-wp-job-manager-setup.php:248
662
  msgid "Help other users on the forums"
663
  msgstr ""
664
 
665
- #: includes/admin/class-wp-job-manager-writepanels.php:32
666
- #: includes/forms/class-wp-job-manager-form-submit-job.php:167
667
  msgid "e.g. \"London\""
668
  msgstr ""
669
 
670
- #: includes/admin/class-wp-job-manager-writepanels.php:33
671
  msgid "Leave this blank if the location is not important."
672
  msgstr ""
673
 
674
- #: includes/admin/class-wp-job-manager-writepanels.php:37
675
  msgid "Application Email or URL"
676
  msgstr ""
677
 
678
- #: includes/admin/class-wp-job-manager-writepanels.php:38
679
  msgid "URL or email which applicants use to apply"
680
  msgstr ""
681
 
682
- #: includes/admin/class-wp-job-manager-writepanels.php:39
683
  msgid ""
684
  "This field is required for the \"application\" area to appear beneath the "
685
  "listing."
686
  msgstr ""
687
 
688
- #: includes/admin/class-wp-job-manager-writepanels.php:44
689
  msgid "Company Name"
690
  msgstr ""
691
 
692
- #: includes/admin/class-wp-job-manager-writepanels.php:49
693
  msgid "Company Website"
694
  msgstr ""
695
 
696
- #: includes/admin/class-wp-job-manager-writepanels.php:54
697
  msgid "Company Tagline"
698
  msgstr ""
699
 
700
- #: includes/admin/class-wp-job-manager-writepanels.php:55
701
  msgid "Brief description about the company"
702
  msgstr ""
703
 
704
- #: includes/admin/class-wp-job-manager-writepanels.php:59
705
  msgid "Company Twitter"
706
  msgstr ""
707
 
708
- #: includes/admin/class-wp-job-manager-writepanels.php:64
709
  msgid "Company Video"
710
  msgstr ""
711
 
712
- #: includes/admin/class-wp-job-manager-writepanels.php:65
713
  msgid "URL to the company video"
714
  msgstr ""
715
 
716
- #: includes/admin/class-wp-job-manager-writepanels.php:70
717
  msgid "Position Filled"
718
  msgstr ""
719
 
720
- #: includes/admin/class-wp-job-manager-writepanels.php:73
721
  msgid "Filled listings will no longer accept applications."
722
  msgstr ""
723
 
724
- #: includes/admin/class-wp-job-manager-writepanels.php:78
725
  msgid "Featured Listing"
726
  msgstr ""
727
 
728
- #: includes/admin/class-wp-job-manager-writepanels.php:80
729
  msgid ""
730
  "Featured listings will be sticky during searches, and can be styled "
731
  "differently."
732
  msgstr ""
733
 
734
- #: includes/admin/class-wp-job-manager-writepanels.php:84
735
  msgid "Listing Expiry Date"
736
  msgstr ""
737
 
738
- #: includes/admin/class-wp-job-manager-writepanels.php:94
739
  msgid "Posted by"
740
  msgstr ""
741
 
742
- #: includes/admin/class-wp-job-manager-writepanels.php:126
743
  msgid "%s Data"
744
  msgstr ""
745
 
746
- #: includes/admin/class-wp-job-manager-writepanels.php:160
747
  msgid "Most Used"
748
  msgstr ""
749
 
750
- #: includes/admin/class-wp-job-manager-writepanels.php:217
751
- #: includes/admin/class-wp-job-manager-writepanels.php:220
752
- #: includes/admin/class-wp-job-manager-writepanels.php:223
753
  msgid "Use file"
754
  msgstr ""
755
 
756
- #: includes/admin/class-wp-job-manager-writepanels.php:217
757
- #: includes/admin/class-wp-job-manager-writepanels.php:220
758
- #: includes/admin/class-wp-job-manager-writepanels.php:223
759
  msgid "Upload"
760
  msgstr ""
761
 
762
- #: includes/admin/class-wp-job-manager-writepanels.php:223
763
  msgid "Add file"
764
  msgstr ""
765
 
766
- #: includes/admin/class-wp-job-manager-writepanels.php:396
767
  msgid "Guest User"
768
  msgstr ""
769
 
770
- #: includes/admin/class-wp-job-manager-writepanels.php:398
771
  msgid "Change"
772
  msgstr ""
773
 
774
- #: includes/admin/class-wp-job-manager-writepanels.php:402
775
  msgid "Enter the ID of the user, or leave blank if submitted by a guest."
776
  msgstr ""
777
 
778
- #: includes/class-wp-job-manager-ajax.php:181
779
- msgid "located in &ldquo;%s&rdquo;"
780
- msgstr ""
781
-
782
- #: includes/class-wp-job-manager-ajax.php:189
783
  msgid "Search completed. Found %d matching record."
784
  msgid_plural "Search completed. Found %d matching records."
785
  msgstr[0] ""
786
  msgstr[1] ""
787
 
788
- #: includes/class-wp-job-manager-geocode.php:141
789
  msgid "No results found"
790
  msgstr ""
791
 
792
- #: includes/class-wp-job-manager-geocode.php:145
793
  msgid "Query limit reached"
794
  msgstr ""
795
 
796
- #: includes/class-wp-job-manager-geocode.php:151
797
- #: includes/class-wp-job-manager-geocode.php:155
798
- #: includes/class-wp-job-manager-geocode.php:159
799
  msgid "Geocoding error"
800
  msgstr ""
801
 
802
- #: includes/class-wp-job-manager-install.php:58
803
  msgid "Employer"
804
  msgstr ""
805
 
806
- #: includes/class-wp-job-manager-post-types.php:69
807
- #: includes/forms/class-wp-job-manager-form-submit-job.php:180
808
  msgid "Job category"
809
  msgstr ""
810
 
811
- #: includes/class-wp-job-manager-post-types.php:70
812
  msgid "Job categories"
813
  msgstr ""
814
 
815
- #: includes/class-wp-job-manager-post-types.php:94
816
- #: includes/class-wp-job-manager-post-types.php:142
817
- #: includes/class-wp-job-manager-post-types.php:198
818
  msgid "Search %s"
819
  msgstr ""
820
 
821
- #: includes/class-wp-job-manager-post-types.php:95
822
- #: includes/class-wp-job-manager-post-types.php:143
823
- #: includes/class-wp-job-manager-post-types.php:190
824
  msgid "All %s"
825
  msgstr ""
826
 
827
- #: includes/class-wp-job-manager-post-types.php:96
828
- #: includes/class-wp-job-manager-post-types.php:144
829
- #: includes/class-wp-job-manager-post-types.php:201
830
  msgid "Parent %s"
831
  msgstr ""
832
 
833
- #: includes/class-wp-job-manager-post-types.php:97
834
- #: includes/class-wp-job-manager-post-types.php:145
835
  msgid "Parent %s:"
836
  msgstr ""
837
 
838
- #: includes/class-wp-job-manager-post-types.php:98
839
- #: includes/class-wp-job-manager-post-types.php:146
840
- #: includes/class-wp-job-manager-post-types.php:194
841
  msgid "Edit %s"
842
  msgstr ""
843
 
844
- #: includes/class-wp-job-manager-post-types.php:99
845
- #: includes/class-wp-job-manager-post-types.php:147
846
  msgid "Update %s"
847
  msgstr ""
848
 
849
- #: includes/class-wp-job-manager-post-types.php:100
850
- #: includes/class-wp-job-manager-post-types.php:148
851
  msgid "Add New %s"
852
  msgstr ""
853
 
854
- #: includes/class-wp-job-manager-post-types.php:101
855
- #: includes/class-wp-job-manager-post-types.php:149
856
  msgid "New %s Name"
857
  msgstr ""
858
 
859
- #: includes/class-wp-job-manager-post-types.php:118
860
- #: includes/forms/class-wp-job-manager-form-submit-job.php:171
861
  msgid "Job type"
862
  msgstr ""
863
 
864
- #: includes/class-wp-job-manager-post-types.php:119
865
  msgid "Job types"
866
  msgstr ""
867
 
868
- #: includes/class-wp-job-manager-post-types.php:168
869
  msgid "Job"
870
  msgstr ""
871
 
872
- #: includes/class-wp-job-manager-post-types.php:169
873
  msgid "Jobs"
874
  msgstr ""
875
 
876
- #: includes/class-wp-job-manager-post-types.php:191
877
  msgid "Add New"
878
  msgstr ""
879
 
880
- #: includes/class-wp-job-manager-post-types.php:192
881
  msgid "Add %s"
882
  msgstr ""
883
 
884
- #: includes/class-wp-job-manager-post-types.php:195
885
  msgid "New %s"
886
  msgstr ""
887
 
888
- #: includes/class-wp-job-manager-post-types.php:196
889
- #: includes/class-wp-job-manager-post-types.php:197
890
  msgid "View %s"
891
  msgstr ""
892
 
893
- #: includes/class-wp-job-manager-post-types.php:199
894
  msgid "No %s found"
895
  msgstr ""
896
 
897
- #: includes/class-wp-job-manager-post-types.php:200
898
  msgid "No %s found in trash"
899
  msgstr ""
900
 
901
- #: includes/class-wp-job-manager-post-types.php:202
902
  msgid "Company Logo"
903
  msgstr ""
904
 
905
- #: includes/class-wp-job-manager-post-types.php:203
906
  msgid "Set company logo"
907
  msgstr ""
908
 
909
- #: includes/class-wp-job-manager-post-types.php:204
910
  msgid "Remove company logo"
911
  msgstr ""
912
 
913
- #: includes/class-wp-job-manager-post-types.php:205
914
  msgid "Use as company logo"
915
  msgstr ""
916
 
917
- #: includes/class-wp-job-manager-post-types.php:207
918
  msgid "This is where you can create and manage %s."
919
  msgstr ""
920
 
921
- #: includes/class-wp-job-manager-post-types.php:238
922
  msgid "Expired <span class=\"count\">(%s)</span>"
923
  msgid_plural "Expired <span class=\"count\">(%s)</span>"
924
  msgstr[0] ""
925
  msgstr[1] ""
926
 
927
- #: includes/class-wp-job-manager-post-types.php:246
928
  msgid "Preview <span class=\"count\">(%s)</span>"
929
  msgid_plural "Preview <span class=\"count\">(%s)</span>"
930
  msgstr[0] ""
931
  msgstr[1] ""
932
 
933
- #: includes/class-wp-job-manager-shortcodes.php:68
934
  msgid "Invalid ID"
935
  msgstr ""
936
 
937
- #: includes/class-wp-job-manager-shortcodes.php:75
938
  msgid "This position has already been filled"
939
  msgstr ""
940
 
941
- #: includes/class-wp-job-manager-shortcodes.php:81
942
  msgid "%s has been filled"
943
  msgstr ""
944
 
945
- #: includes/class-wp-job-manager-shortcodes.php:86
946
  msgid "This position is not filled"
947
  msgstr ""
948
 
949
- #: includes/class-wp-job-manager-shortcodes.php:93
950
  msgid "%s has been marked as not filled"
951
  msgstr ""
952
 
953
- #: includes/class-wp-job-manager-shortcodes.php:100
954
  msgid "%s has been deleted"
955
  msgstr ""
956
 
957
- #: includes/class-wp-job-manager-shortcodes.php:105
958
- #: includes/class-wp-job-manager-shortcodes.php:118
959
  msgid "Missing submission page."
960
  msgstr ""
961
 
962
- #: includes/class-wp-job-manager-shortcodes.php:186
963
- #: includes/class-wp-job-manager-widgets.php:202
964
- #: includes/class-wp-job-manager-widgets.php:307
965
  msgid "Title"
966
  msgstr ""
967
 
968
- #: includes/class-wp-job-manager-shortcodes.php:188
969
  msgid "Date Posted"
970
  msgstr ""
971
 
972
- #: includes/class-wp-job-manager-shortcodes.php:189
973
  msgid "Listing Expires"
974
  msgstr ""
975
 
976
- #: includes/class-wp-job-manager-shortcodes.php:284
977
- #: includes/class-wp-job-manager-shortcodes.php:318
978
  msgid "Load more listings"
979
  msgstr ""
980
 
981
- #: includes/class-wp-job-manager-widgets.php:195
982
- msgid ""
983
- "Display a list of recent listings on your site, optionally matching a "
984
- "keyword and location."
985
- msgstr ""
986
-
987
- #: includes/class-wp-job-manager-widgets.php:197
988
- #: includes/class-wp-job-manager-widgets.php:201
989
- msgid "Recent %s"
990
- msgstr ""
991
-
992
- #: includes/class-wp-job-manager-widgets.php:207
993
- msgid "Keyword"
994
- msgstr ""
995
-
996
- #: includes/class-wp-job-manager-widgets.php:220
997
- #: includes/class-wp-job-manager-widgets.php:315
998
- msgid "Number of listings to show"
999
- msgstr ""
1000
-
1001
- #: includes/class-wp-job-manager-widgets.php:300
1002
- msgid "Display a list of featured listings on your site."
1003
- msgstr ""
1004
-
1005
- #: includes/class-wp-job-manager-widgets.php:302
1006
- #: includes/class-wp-job-manager-widgets.php:306
1007
- msgid "Featured %s"
1008
- msgstr ""
1009
-
1010
- #: includes/forms/class-wp-job-manager-form-edit-job.php:62
1011
  msgid "Invalid listing"
1012
  msgstr ""
1013
 
1014
- #: includes/forms/class-wp-job-manager-form-edit-job.php:101
1015
  msgid "Save changes"
1016
  msgstr ""
1017
 
1018
- #: includes/forms/class-wp-job-manager-form-edit-job.php:130
1019
- #: includes/forms/class-wp-job-manager-form-edit-job.php:133
1020
  msgid "Your changes have been saved."
1021
  msgstr ""
1022
 
1023
- #: includes/forms/class-wp-job-manager-form-edit-job.php:130
1024
  msgid "View &rarr;"
1025
  msgstr ""
1026
 
1027
- #: includes/forms/class-wp-job-manager-form-submit-job.php:58
1028
  msgid "Submit Details"
1029
  msgstr ""
1030
 
1031
- #: includes/forms/class-wp-job-manager-form-submit-job.php:64
1032
- #: includes/forms/class-wp-job-manager-form-submit-job.php:419
1033
  #: templates/job-preview.php:5
1034
  msgid "Preview"
1035
  msgstr ""
1036
 
1037
- #: includes/forms/class-wp-job-manager-form-submit-job.php:70
1038
  msgid "Done"
1039
  msgstr ""
1040
 
1041
- #: includes/forms/class-wp-job-manager-form-submit-job.php:135
1042
  msgid "Application email"
1043
  msgstr ""
1044
 
1045
- #: includes/forms/class-wp-job-manager-form-submit-job.php:136
1046
  #: templates/account-signin.php:49
1047
  msgid "you@yourdomain.com"
1048
  msgstr ""
1049
 
1050
- #: includes/forms/class-wp-job-manager-form-submit-job.php:139
1051
  msgid "Application URL"
1052
  msgstr ""
1053
 
1054
- #: includes/forms/class-wp-job-manager-form-submit-job.php:140
1055
- #: includes/forms/class-wp-job-manager-form-submit-job.php:215
1056
  msgid "http://"
1057
  msgstr ""
1058
 
1059
- #: includes/forms/class-wp-job-manager-form-submit-job.php:143
1060
  msgid "Application email/URL"
1061
  msgstr ""
1062
 
1063
- #: includes/forms/class-wp-job-manager-form-submit-job.php:144
1064
  msgid "Enter an email address or website URL"
1065
  msgstr ""
1066
 
1067
- #: includes/forms/class-wp-job-manager-form-submit-job.php:156
1068
  msgid "Job Title"
1069
  msgstr ""
1070
 
1071
- #: includes/forms/class-wp-job-manager-form-submit-job.php:164
1072
  msgid "Leave this blank if the location is not important"
1073
  msgstr ""
1074
 
1075
- #: includes/forms/class-wp-job-manager-form-submit-job.php:189
 
 
 
 
1076
  msgid "Description"
1077
  msgstr ""
1078
 
1079
- #: includes/forms/class-wp-job-manager-form-submit-job.php:205
1080
  msgid "Company name"
1081
  msgstr ""
1082
 
1083
- #: includes/forms/class-wp-job-manager-form-submit-job.php:208
1084
  msgid "Enter the name of the company"
1085
  msgstr ""
1086
 
1087
- #: includes/forms/class-wp-job-manager-form-submit-job.php:212
1088
  #: templates/content-single-job_listing-company.php:19
1089
  msgid "Website"
1090
  msgstr ""
1091
 
1092
- #: includes/forms/class-wp-job-manager-form-submit-job.php:219
1093
  msgid "Tagline"
1094
  msgstr ""
1095
 
1096
- #: includes/forms/class-wp-job-manager-form-submit-job.php:222
1097
  msgid "Briefly describe your company"
1098
  msgstr ""
1099
 
1100
- #: includes/forms/class-wp-job-manager-form-submit-job.php:227
1101
  msgid "Video"
1102
  msgstr ""
1103
 
1104
- #: includes/forms/class-wp-job-manager-form-submit-job.php:230
1105
  msgid "A link to a video about your company"
1106
  msgstr ""
1107
 
1108
- #: includes/forms/class-wp-job-manager-form-submit-job.php:234
1109
  msgid "Twitter username"
1110
  msgstr ""
1111
 
1112
- #: includes/forms/class-wp-job-manager-form-submit-job.php:237
1113
  msgid "@yourcompany"
1114
  msgstr ""
1115
 
1116
- #: includes/forms/class-wp-job-manager-form-submit-job.php:241
1117
  msgid "Logo"
1118
  msgstr ""
1119
 
1120
- #: includes/forms/class-wp-job-manager-form-submit-job.php:275
1121
  msgid "%s is a required field"
1122
  msgstr ""
1123
 
1124
- #: includes/forms/class-wp-job-manager-form-submit-job.php:285
1125
  msgid "%s is invalid"
1126
  msgstr ""
1127
 
1128
- #: includes/forms/class-wp-job-manager-form-submit-job.php:301
1129
- #: wp-job-manager-functions.php:777
1130
  msgid "\"%s\" (filetype %s) needs to be one of the following file types: %s"
1131
  msgstr ""
1132
 
1133
- #: includes/forms/class-wp-job-manager-form-submit-job.php:316
1134
  msgid "Please enter a valid application email address"
1135
  msgstr ""
1136
 
1137
- #: includes/forms/class-wp-job-manager-form-submit-job.php:325
1138
  msgid "Please enter a valid application URL"
1139
  msgstr ""
1140
 
1141
- #: includes/forms/class-wp-job-manager-form-submit-job.php:335
1142
  msgid "Please enter a valid application email address or URL"
1143
  msgstr ""
1144
 
1145
- #: includes/forms/class-wp-job-manager-form-submit-job.php:450
1146
  msgid "Please enter a username."
1147
  msgstr ""
1148
 
1149
- #: includes/forms/class-wp-job-manager-form-submit-job.php:453
1150
  msgid "Please enter your email address."
1151
  msgstr ""
1152
 
1153
- #: includes/forms/class-wp-job-manager-form-submit-job.php:471
1154
  msgid "You must be signed in to post a new listing."
1155
  msgstr ""
1156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1157
  #: templates/account-signin.php:4
1158
  msgid "Your account"
1159
  msgstr ""
@@ -1194,7 +1216,7 @@ msgid "Username"
1194
  msgstr ""
1195
 
1196
  #: templates/account-signin.php:40 templates/account-signin.php:47
1197
- #: templates/job-submit.php:26 templates/job-submit.php:43
1198
  msgid "(optional)"
1199
  msgstr ""
1200
 
@@ -1227,12 +1249,12 @@ msgid "Maximum file size: %s."
1227
  msgstr ""
1228
 
1229
  #: templates/form-fields/multiselect-field.php:3
1230
- #: wp-job-manager-functions.php:578
1231
  msgid "No results match"
1232
  msgstr ""
1233
 
1234
  #: templates/form-fields/multiselect-field.php:3
1235
- #: wp-job-manager-functions.php:579
1236
  msgid "Select Some Options"
1237
  msgstr ""
1238
 
@@ -1247,10 +1269,6 @@ msgid ""
1247
  "class=\"job_application_email\" href=\"mailto:%1$s%2$s\">%1$s</a>"
1248
  msgstr ""
1249
 
1250
- #: templates/job-application-email.php:4
1251
- msgid "Apply using webmail: "
1252
- msgstr ""
1253
-
1254
  #: templates/job-application-url.php:1
1255
  msgid "To apply for this job please visit the following URL:"
1256
  msgstr ""
@@ -1313,7 +1331,15 @@ msgstr ""
1313
  msgid "Edit listing"
1314
  msgstr ""
1315
 
1316
- #: templates/job-submit.php:37
 
 
 
 
 
 
 
 
1317
  msgid "Company Details"
1318
  msgstr ""
1319
 
@@ -1325,63 +1351,63 @@ msgstr ""
1325
  msgid "%s submitted successfully. Your listing will be visible once approved."
1326
  msgstr ""
1327
 
1328
- #: wp-job-manager-functions.php:322
1329
  msgid "Reset"
1330
  msgstr ""
1331
 
1332
- #: wp-job-manager-functions.php:326
1333
  msgid "RSS"
1334
  msgstr ""
1335
 
1336
- #: wp-job-manager-functions.php:413
1337
  msgid "Invalid email address."
1338
  msgstr ""
1339
 
1340
- #: wp-job-manager-functions.php:421
1341
  msgid "Your email address isn&#8217;t correct."
1342
  msgstr ""
1343
 
1344
- #: wp-job-manager-functions.php:425
1345
  msgid "This email is already registered, please choose another one."
1346
  msgstr ""
1347
 
1348
- #: wp-job-manager-functions.php:577
1349
  msgid "Choose a category&hellip;"
1350
  msgstr ""
1351
 
1352
- #: wp-job-manager-functions.php:779
1353
  msgid "Uploaded files need to be one of the following file types: %s"
1354
  msgstr ""
1355
 
1356
- #: wp-job-manager-template.php:135
1357
  msgid "Inactive"
1358
  msgstr ""
1359
 
1360
- #: wp-job-manager-template.php:222
1361
  msgid "Application via \"%s\" listing on %s"
1362
  msgstr ""
1363
 
1364
- #: wp-job-manager-template.php:281
1365
  msgid "Posted on "
1366
  msgstr ""
1367
 
1368
- #: wp-job-manager-template.php:283 wp-job-manager-template.php:301
1369
  msgid "Posted %s ago"
1370
  msgstr ""
1371
 
1372
- #: wp-job-manager-template.php:322
1373
  msgid "Anywhere"
1374
  msgstr ""
1375
 
1376
- #: wp-job-manager.php:119
1377
  msgid "Load previous listings"
1378
  msgstr ""
1379
 
1380
- #: wp-job-manager.php:156
1381
  msgid "Invalid file type. Accepted types:"
1382
  msgstr ""
1383
 
1384
- #: wp-job-manager.php:167
1385
  msgid "Are you sure you want to delete this listing?"
1386
  msgstr ""
1387
 
@@ -1403,82 +1429,82 @@ msgstr ""
1403
  msgid "Automattic"
1404
  msgstr ""
1405
 
1406
- #: includes/admin/class-wp-job-manager-admin.php:49
1407
  #. translators: jQuery date format, see
1408
  #. http:api.jqueryui.com/datepicker/#utility-formatDate
1409
  msgctxt "Date format for jQuery datepicker."
1410
  msgid "yy-mm-dd"
1411
  msgstr ""
1412
 
1413
- #: includes/admin/class-wp-job-manager-setup.php:173
1414
  msgctxt "Default page title (wizard)"
1415
  msgid "Post a Job"
1416
  msgstr ""
1417
 
1418
- #: includes/admin/class-wp-job-manager-setup.php:183
1419
  msgctxt "Default page title (wizard)"
1420
  msgid "Job Dashboard"
1421
  msgstr ""
1422
 
1423
- #: includes/admin/class-wp-job-manager-setup.php:193
1424
  msgctxt "Default page title (wizard)"
1425
  msgid "Jobs"
1426
  msgstr ""
1427
 
1428
- #: includes/admin/class-wp-job-manager-writepanels.php:88
1429
  #. translators: date format placeholder, see https:secure.php.net/date
1430
  msgctxt "Date format placeholder."
1431
  msgid "yyyy-mm-dd"
1432
  msgstr ""
1433
 
1434
- #: includes/class-wp-job-manager-post-types.php:74
1435
  msgctxt "Job category slug - resave permalinks after changing this"
1436
  msgid "job-category"
1437
  msgstr ""
1438
 
1439
- #: includes/class-wp-job-manager-post-types.php:123
1440
  msgctxt "Job type slug - resave permalinks after changing this"
1441
  msgid "job-type"
1442
  msgstr ""
1443
 
1444
- #: includes/class-wp-job-manager-post-types.php:172
1445
  msgctxt "Post type archive slug - resave permalinks after changing this"
1446
  msgid "jobs"
1447
  msgstr ""
1448
 
1449
- #: includes/class-wp-job-manager-post-types.php:178
1450
  msgctxt "Job permalink - resave permalinks after changing this"
1451
  msgid "job"
1452
  msgstr ""
1453
 
1454
- #: includes/class-wp-job-manager-post-types.php:232
1455
- #: wp-job-manager-functions.php:222
1456
  msgctxt "post status"
1457
  msgid "Expired"
1458
  msgstr ""
1459
 
1460
- #: includes/class-wp-job-manager-post-types.php:241
1461
- #: wp-job-manager-functions.php:223
1462
  msgctxt "post status"
1463
  msgid "Preview"
1464
  msgstr ""
1465
 
1466
- #: wp-job-manager-functions.php:221
1467
  msgctxt "post status"
1468
  msgid "Draft"
1469
  msgstr ""
1470
 
1471
- #: wp-job-manager-functions.php:224
1472
  msgctxt "post status"
1473
  msgid "Pending approval"
1474
  msgstr ""
1475
 
1476
- #: wp-job-manager-functions.php:225
1477
  msgctxt "post status"
1478
  msgid "Pending payment"
1479
  msgstr ""
1480
 
1481
- #: wp-job-manager-functions.php:226
1482
  msgctxt "post status"
1483
  msgid "Active"
1484
  msgstr ""
2
  # This file is distributed under the GPL2+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WP Job Manager 1.26.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-job-manager\n"
7
+ "POT-Creation-Date: 2017-05-18 17:27:44+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
  "X-Generator: grunt-wp-i18n 0.5.4\n"
15
 
16
+ #: includes/admin/class-wp-job-manager-addons.php:82
17
+ #: includes/admin/class-wp-job-manager-admin.php:82
18
  msgid "WP Job Manager Add-ons"
19
  msgstr ""
20
 
21
+ #: includes/admin/class-wp-job-manager-addons.php:84
22
  msgid "Do you need multiple add-ons?"
23
  msgstr ""
24
 
25
+ #: includes/admin/class-wp-job-manager-addons.php:84
26
  msgid "Check out the core add-on bundle &rarr;"
27
  msgstr ""
28
 
29
+ #: includes/admin/class-wp-job-manager-admin.php:79
30
  msgid "Settings"
31
  msgstr ""
32
 
33
+ #: includes/admin/class-wp-job-manager-admin.php:82
34
  msgid "Add-ons"
35
  msgstr ""
36
 
37
+ #: includes/admin/class-wp-job-manager-cpt.php:74
38
+ #: includes/admin/class-wp-job-manager-cpt.php:75
39
  msgid "Approve %s"
40
  msgstr ""
41
 
42
+ #: includes/admin/class-wp-job-manager-cpt.php:77
43
+ #: includes/admin/class-wp-job-manager-cpt.php:78
44
  msgid "Expire %s"
45
  msgstr ""
46
 
47
+ #: includes/admin/class-wp-job-manager-cpt.php:166
48
+ #: includes/admin/class-wp-job-manager-cpt.php:168
49
  msgid "%s approved"
50
  msgstr ""
51
 
52
+ #: includes/admin/class-wp-job-manager-cpt.php:186
53
+ #: includes/admin/class-wp-job-manager-cpt.php:188
54
  msgid "%s expired"
55
  msgstr ""
56
 
57
+ #: includes/admin/class-wp-job-manager-cpt.php:220
58
  msgid "Select category"
59
  msgstr ""
60
 
61
+ #: includes/admin/class-wp-job-manager-cpt.php:236
62
+ #: includes/admin/class-wp-job-manager-cpt.php:280
63
  msgid "Position"
64
  msgstr ""
65
 
66
+ #: includes/admin/class-wp-job-manager-cpt.php:251
67
  msgid "%s updated. <a href=\"%s\">View</a>"
68
  msgstr ""
69
 
70
+ #: includes/admin/class-wp-job-manager-cpt.php:252
71
  msgid "Custom field updated."
72
  msgstr ""
73
 
74
+ #: includes/admin/class-wp-job-manager-cpt.php:253
75
  msgid "Custom field deleted."
76
  msgstr ""
77
 
78
+ #: includes/admin/class-wp-job-manager-cpt.php:254
79
  msgid "%s updated."
80
  msgstr ""
81
 
82
+ #: includes/admin/class-wp-job-manager-cpt.php:255
83
  msgid "%s restored to revision from %s"
84
  msgstr ""
85
 
86
+ #: includes/admin/class-wp-job-manager-cpt.php:256
87
  msgid "%s published. <a href=\"%s\">View</a>"
88
  msgstr ""
89
 
90
+ #: includes/admin/class-wp-job-manager-cpt.php:257
91
  msgid "%s saved."
92
  msgstr ""
93
 
94
+ #: includes/admin/class-wp-job-manager-cpt.php:258
95
  msgid "%s submitted. <a target=\"_blank\" href=\"%s\">Preview</a>"
96
  msgstr ""
97
 
98
+ #: includes/admin/class-wp-job-manager-cpt.php:259
99
  msgid ""
100
  "%s scheduled for: <strong>%1$s</strong>. <a target=\"_blank\" "
101
  "href=\"%2$s\">Preview</a>"
102
  msgstr ""
103
 
104
+ #: includes/admin/class-wp-job-manager-cpt.php:260
105
  msgid "M j, Y @ G:i"
106
  msgstr ""
107
 
108
+ #: includes/admin/class-wp-job-manager-cpt.php:261
109
  msgid "%s draft updated. <a target=\"_blank\" href=\"%s\">Preview</a>"
110
  msgstr ""
111
 
112
+ #: includes/admin/class-wp-job-manager-cpt.php:281
113
  msgid "Type"
114
  msgstr ""
115
 
116
+ #: includes/admin/class-wp-job-manager-cpt.php:282
117
+ #: includes/admin/class-wp-job-manager-writepanels.php:55
118
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:171
119
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:38
120
  #: templates/job-filters.php:17 templates/job-filters.php:18
121
  msgid "Location"
122
  msgstr ""
123
 
124
+ #: includes/admin/class-wp-job-manager-cpt.php:283
125
  msgid "Status"
126
  msgstr ""
127
 
128
+ #: includes/admin/class-wp-job-manager-cpt.php:284
129
  msgid "Posted"
130
  msgstr ""
131
 
132
+ #: includes/admin/class-wp-job-manager-cpt.php:285
133
  msgid "Expires"
134
  msgstr ""
135
 
136
+ #: includes/admin/class-wp-job-manager-cpt.php:286
137
+ #: includes/admin/class-wp-job-manager-settings.php:103
138
  msgid "Categories"
139
  msgstr ""
140
 
141
+ #: includes/admin/class-wp-job-manager-cpt.php:287
142
  msgid "Featured?"
143
  msgstr ""
144
 
145
+ #: includes/admin/class-wp-job-manager-cpt.php:288
146
+ #: includes/class-wp-job-manager-shortcodes.php:218
147
  msgid "Filled?"
148
  msgstr ""
149
 
150
+ #: includes/admin/class-wp-job-manager-cpt.php:289
151
  msgid "Actions"
152
  msgstr ""
153
 
154
+ #: includes/admin/class-wp-job-manager-cpt.php:349
155
  msgid "ID: %d"
156
  msgstr ""
157
 
158
+ #: includes/admin/class-wp-job-manager-cpt.php:378
159
+ #: includes/admin/class-wp-job-manager-cpt.php:383
160
  msgid "M j, Y"
161
  msgstr ""
162
 
163
+ #: includes/admin/class-wp-job-manager-cpt.php:379
164
  msgid "by a guest"
165
  msgstr ""
166
 
167
+ #: includes/admin/class-wp-job-manager-cpt.php:379
168
  msgid "by %s"
169
  msgstr ""
170
 
171
+ #: includes/admin/class-wp-job-manager-cpt.php:397
172
  msgid "Approve"
173
  msgstr ""
174
 
175
+ #: includes/admin/class-wp-job-manager-cpt.php:405
176
+ #: includes/admin/class-wp-job-manager-writepanels.php:248
177
+ #: includes/admin/class-wp-job-manager-writepanels.php:251
178
+ #: includes/admin/class-wp-job-manager-writepanels.php:254
179
  msgid "View"
180
  msgstr ""
181
 
182
+ #: includes/admin/class-wp-job-manager-cpt.php:412
183
+ #: includes/class-wp-job-manager-post-types.php:217
184
  #: templates/job-dashboard.php:33 templates/job-dashboard.php:51
185
  msgid "Edit"
186
  msgstr ""
187
 
188
+ #: includes/admin/class-wp-job-manager-cpt.php:419
189
  #: templates/job-dashboard.php:56
190
  msgid "Delete"
191
  msgstr ""
192
 
193
+ #: includes/admin/class-wp-job-manager-settings.php:63
194
+ #: includes/class-wp-job-manager-post-types.php:213
195
+ #: includes/class-wp-job-manager-post-types.php:280
 
196
  msgid "Job Listings"
197
  msgstr ""
198
 
199
+ #: includes/admin/class-wp-job-manager-settings.php:69
200
  msgid "Listings Per Page"
201
  msgstr ""
202
 
203
+ #: includes/admin/class-wp-job-manager-settings.php:70
204
  msgid "How many listings should be shown per page by default?"
205
  msgstr ""
206
 
207
+ #: includes/admin/class-wp-job-manager-settings.php:76
208
  msgid "Filled Positions"
209
  msgstr ""
210
 
211
+ #: includes/admin/class-wp-job-manager-settings.php:77
212
  msgid "Hide filled positions"
213
  msgstr ""
214
 
215
+ #: includes/admin/class-wp-job-manager-settings.php:78
216
  msgid "If enabled, filled positions will be hidden from archives."
217
  msgstr ""
218
 
219
+ #: includes/admin/class-wp-job-manager-settings.php:85
220
+ msgid "Hide Expired Listings"
221
+ msgstr ""
222
+
223
+ #: includes/admin/class-wp-job-manager-settings.php:86
224
+ msgid "Hide expired listings in job archive/search"
225
+ msgstr ""
226
+
227
+ #: includes/admin/class-wp-job-manager-settings.php:87
228
+ msgid "If enabled, expired job listing is not searchable."
229
  msgstr ""
230
 
231
+ #: includes/admin/class-wp-job-manager-settings.php:94
232
+ msgid "Hide Expired Listings Content"
233
  msgstr ""
234
 
235
+ #: includes/admin/class-wp-job-manager-settings.php:95
236
+ msgid "Hide expired listing content in single job listing (singular)"
237
+ msgstr ""
238
+
239
+ #: includes/admin/class-wp-job-manager-settings.php:96
240
  msgid ""
241
  "If enabled, the content within expired listings will be hidden. Otherwise, "
242
  "expired listings will be displayed as normal (without the application area)."
243
  msgstr ""
244
 
245
+ #: includes/admin/class-wp-job-manager-settings.php:104
246
  msgid "Enable categories for listings"
247
  msgstr ""
248
 
249
+ #: includes/admin/class-wp-job-manager-settings.php:105
250
  msgid ""
251
  "Choose whether to enable categories. Categories must be setup by an admin "
252
  "to allow users to choose them during submission."
253
  msgstr ""
254
 
255
+ #: includes/admin/class-wp-job-manager-settings.php:112
256
  msgid "Multi-select Categories"
257
  msgstr ""
258
 
259
+ #: includes/admin/class-wp-job-manager-settings.php:113
260
  msgid "Enable category multiselect by default"
261
  msgstr ""
262
 
263
+ #: includes/admin/class-wp-job-manager-settings.php:114
264
  msgid ""
265
  "If enabled, the category select box will default to a multiselect on the "
266
  "[jobs] shortcode."
267
  msgstr ""
268
 
269
+ #: includes/admin/class-wp-job-manager-settings.php:121
270
  msgid "Category Filter Type"
271
  msgstr ""
272
 
273
+ #: includes/admin/class-wp-job-manager-settings.php:122
274
  msgid ""
275
  "Determines the logic used to display jobs when selecting multiple "
276
  "categories."
277
  msgstr ""
278
 
279
+ #: includes/admin/class-wp-job-manager-settings.php:125
280
  msgid "Jobs will be shown if within ANY selected category"
281
  msgstr ""
282
 
283
+ #: includes/admin/class-wp-job-manager-settings.php:126
284
  msgid "Jobs will be shown if within ALL selected categories"
285
  msgstr ""
286
 
287
+ #: includes/admin/class-wp-job-manager-settings.php:132
288
  msgid "Date Format"
289
  msgstr ""
290
 
291
+ #: includes/admin/class-wp-job-manager-settings.php:133
292
  msgid ""
293
  "Choose how you want the published date for jobs to be displayed on the "
294
  "front-end."
295
  msgstr ""
296
 
297
+ #: includes/admin/class-wp-job-manager-settings.php:136
298
  msgid "Relative to the current date (e.g., 1 day, 1 week, 1 month ago)"
299
  msgstr ""
300
 
301
+ #: includes/admin/class-wp-job-manager-settings.php:137
302
  msgid "Default date format as defined in Setttings"
303
  msgstr ""
304
 
305
+ #: includes/admin/class-wp-job-manager-settings.php:143
306
  msgid "Types"
307
  msgstr ""
308
 
309
+ #: includes/admin/class-wp-job-manager-settings.php:144
310
  msgid "Enable types for listings"
311
  msgstr ""
312
 
313
+ #: includes/admin/class-wp-job-manager-settings.php:145
314
  msgid ""
315
  "Choose whether to enable types. Types must be setup by an admin to allow "
316
  "users to choose them during submission."
317
  msgstr ""
318
 
319
+ #: includes/admin/class-wp-job-manager-settings.php:152
320
  msgid "Multi-select Listing Types"
321
  msgstr ""
322
 
323
+ #: includes/admin/class-wp-job-manager-settings.php:153
324
  msgid "Enable multiple types for listings"
325
  msgstr ""
326
 
327
+ #: includes/admin/class-wp-job-manager-settings.php:154
328
  msgid ""
329
  "If enabled each job can have more than one type. The metabox on the post "
330
  "editor and the select box on the frontend job submission form are changed "
331
  "by this."
332
  msgstr ""
333
 
334
+ #: includes/admin/class-wp-job-manager-settings.php:161
335
+ msgid "Google Maps API Key"
336
+ msgstr ""
337
+
338
+ #: includes/admin/class-wp-job-manager-settings.php:162
339
+ msgid ""
340
+ "Google requires an API key to retrieve location information for job "
341
+ "listings. Acquire an API key from the <a href=\"%s\">Google Maps API "
342
+ "developer site</a>."
343
+ msgstr ""
344
+
345
+ #: includes/admin/class-wp-job-manager-settings.php:168
346
  msgid "Job Submission"
347
  msgstr ""
348
 
349
+ #: includes/admin/class-wp-job-manager-settings.php:173
350
  msgid "Account Required"
351
  msgstr ""
352
 
353
+ #: includes/admin/class-wp-job-manager-settings.php:174
354
  msgid "Submitting listings requires an account"
355
  msgstr ""
356
 
357
+ #: includes/admin/class-wp-job-manager-settings.php:175
358
  msgid ""
359
  "If disabled, non-logged in users will be able to submit listings without "
360
  "creating an account."
361
  msgstr ""
362
 
363
+ #: includes/admin/class-wp-job-manager-settings.php:182
364
  msgid "Account Creation"
365
  msgstr ""
366
 
367
+ #: includes/admin/class-wp-job-manager-settings.php:183
368
  msgid "Allow account creation"
369
  msgstr ""
370
 
371
+ #: includes/admin/class-wp-job-manager-settings.php:184
372
  msgid ""
373
  "If enabled, non-logged in users will be able to create an account by "
374
  "entering their email address on the submission form."
375
  msgstr ""
376
 
377
+ #: includes/admin/class-wp-job-manager-settings.php:191
378
  msgid "Account Username"
379
  msgstr ""
380
 
381
+ #: includes/admin/class-wp-job-manager-settings.php:192
382
  msgid "Automatically Generate Username from Email Address"
383
  msgstr ""
384
 
385
+ #: includes/admin/class-wp-job-manager-settings.php:193
386
  msgid ""
387
  "If enabled, a username will be generated from the first part of the user "
388
  "email address. Otherwise, a username field will be shown."
389
  msgstr ""
390
 
391
+ #: includes/admin/class-wp-job-manager-settings.php:200
392
  msgid "Account Role"
393
  msgstr ""
394
 
395
+ #: includes/admin/class-wp-job-manager-settings.php:201
396
  msgid ""
397
  "If you enable registration on your submission form, choose a role for the "
398
  "new user."
399
  msgstr ""
400
 
401
+ #: includes/admin/class-wp-job-manager-settings.php:208
402
  msgid "Moderate New Listings"
403
  msgstr ""
404
 
405
+ #: includes/admin/class-wp-job-manager-settings.php:209
406
  msgid "New listing submissions require admin approval"
407
  msgstr ""
408
 
409
+ #: includes/admin/class-wp-job-manager-settings.php:210
410
  msgid "If enabled, new submissions will be inactive, pending admin approval."
411
  msgstr ""
412
 
413
+ #: includes/admin/class-wp-job-manager-settings.php:217
414
  msgid "Allow Pending Edits"
415
  msgstr ""
416
 
417
+ #: includes/admin/class-wp-job-manager-settings.php:218
418
  msgid "Submissions awaiting approval can be edited"
419
  msgstr ""
420
 
421
+ #: includes/admin/class-wp-job-manager-settings.php:219
422
  msgid "If enabled, submissions awaiting admin approval can be edited by the user."
423
  msgstr ""
424
 
425
+ #: includes/admin/class-wp-job-manager-settings.php:226
426
  msgid "Listing Duration"
427
  msgstr ""
428
 
429
+ #: includes/admin/class-wp-job-manager-settings.php:227
430
  msgid ""
431
  "How many <strong>days</strong> listings are live before expiring. Can be "
432
  "left blank to never expire."
433
  msgstr ""
434
 
435
+ #: includes/admin/class-wp-job-manager-settings.php:233
436
  msgid "Application Method"
437
  msgstr ""
438
 
439
+ #: includes/admin/class-wp-job-manager-settings.php:234
440
  msgid "Choose the contact method for listings."
441
  msgstr ""
442
 
443
+ #: includes/admin/class-wp-job-manager-settings.php:237
444
  msgid "Email address or website URL"
445
  msgstr ""
446
 
447
+ #: includes/admin/class-wp-job-manager-settings.php:238
448
  msgid "Email addresses only"
449
  msgstr ""
450
 
451
+ #: includes/admin/class-wp-job-manager-settings.php:239
452
  msgid "Website URLs only"
453
  msgstr ""
454
 
455
+ #: includes/admin/class-wp-job-manager-settings.php:245
456
  msgid "Pages"
457
  msgstr ""
458
 
459
+ #: includes/admin/class-wp-job-manager-settings.php:250
460
  msgid "Submit Job Form Page"
461
  msgstr ""
462
 
463
+ #: includes/admin/class-wp-job-manager-settings.php:251
464
  msgid ""
465
  "Select the page where you have placed the [submit_job_form] shortcode. This "
466
  "lets the plugin know where the form is located."
467
  msgstr ""
468
 
469
+ #: includes/admin/class-wp-job-manager-settings.php:257
470
  msgid "Job Dashboard Page"
471
  msgstr ""
472
 
473
+ #: includes/admin/class-wp-job-manager-settings.php:258
474
  msgid ""
475
  "Select the page where you have placed the [job_dashboard] shortcode. This "
476
  "lets the plugin know where the dashboard is located."
477
  msgstr ""
478
 
479
+ #: includes/admin/class-wp-job-manager-settings.php:264
480
  msgid "Job Listings Page"
481
  msgstr ""
482
 
483
+ #: includes/admin/class-wp-job-manager-settings.php:265
484
  msgid ""
485
  "Select the page where you have placed the [jobs] shortcode. This lets the "
486
  "plugin know where the job listings page is located."
487
  msgstr ""
488
 
489
+ #: includes/admin/class-wp-job-manager-settings.php:311
490
  msgid "Settings successfully saved"
491
  msgstr ""
492
 
493
+ #: includes/admin/class-wp-job-manager-settings.php:371
494
  msgid "--no page--"
495
  msgstr ""
496
 
497
+ #: includes/admin/class-wp-job-manager-settings.php:376
498
  msgid "Select a page&hellip;"
499
  msgstr ""
500
 
501
+ #: includes/admin/class-wp-job-manager-settings.php:422
502
  msgid "Save Changes"
503
  msgstr ""
504
 
505
+ #: includes/admin/class-wp-job-manager-setup.php:51
506
  msgid "Setup"
507
  msgstr ""
508
 
509
+ #: includes/admin/class-wp-job-manager-setup.php:148
510
  msgid "WP Job Manager Setup"
511
  msgstr ""
512
 
513
+ #: includes/admin/class-wp-job-manager-setup.php:151
514
  msgid "1. Introduction"
515
  msgstr ""
516
 
517
+ #: includes/admin/class-wp-job-manager-setup.php:152
518
  msgid "2. Page Setup"
519
  msgstr ""
520
 
521
+ #: includes/admin/class-wp-job-manager-setup.php:153
522
  msgid "3. Done"
523
  msgstr ""
524
 
525
+ #: includes/admin/class-wp-job-manager-setup.php:158
526
  msgid "Setup Wizard Introduction"
527
  msgstr ""
528
 
529
+ #: includes/admin/class-wp-job-manager-setup.php:160
530
  msgid "Thanks for installing <em>WP Job Manager</em>!"
531
  msgstr ""
532
 
533
+ #: includes/admin/class-wp-job-manager-setup.php:161
534
  msgid ""
535
  "This setup wizard will help you get started by creating the pages for job "
536
  "submission, job management, and listing your jobs."
537
  msgstr ""
538
 
539
+ #: includes/admin/class-wp-job-manager-setup.php:162
540
  msgid ""
541
  "If you want to skip the wizard and setup the pages and shortcodes yourself "
542
  "manually, the process is still relatively simple. Refer to the "
543
  "%sdocumentation%s for help."
544
  msgstr ""
545
 
546
+ #: includes/admin/class-wp-job-manager-setup.php:165
547
  msgid "Continue to page setup"
548
  msgstr ""
549
 
550
+ #: includes/admin/class-wp-job-manager-setup.php:166
551
  msgid "Skip setup. I will setup the plugin manually"
552
  msgstr ""
553
 
554
+ #: includes/admin/class-wp-job-manager-setup.php:172
555
  msgid "Page Setup"
556
  msgstr ""
557
 
558
+ #: includes/admin/class-wp-job-manager-setup.php:174
559
  msgid ""
560
  "<em>WP Job Manager</em> includes %1$sshortcodes%2$s which can be used "
561
  "within your %3$spages%2$s to output content. These can be created for you "
563
  "documentation%2$s."
564
  msgstr ""
565
 
566
+ #: includes/admin/class-wp-job-manager-setup.php:182
567
  msgid "Page Title"
568
  msgstr ""
569
 
570
+ #: includes/admin/class-wp-job-manager-setup.php:183
571
  msgid "Page Description"
572
  msgstr ""
573
 
574
+ #: includes/admin/class-wp-job-manager-setup.php:184
575
  msgid "Content Shortcode"
576
  msgstr ""
577
 
578
+ #: includes/admin/class-wp-job-manager-setup.php:192
579
  msgid "This page allows employers to post jobs to your website from the front-end."
580
  msgstr ""
581
 
582
+ #: includes/admin/class-wp-job-manager-setup.php:194
583
  msgid ""
584
  "If you do not want to accept submissions from users in this way (for "
585
  "example you just want to post jobs from the admin dashboard) you can skip "
586
  "creating this page."
587
  msgstr ""
588
 
589
+ #: includes/admin/class-wp-job-manager-setup.php:202
590
  msgid ""
591
  "This page allows employers to manage and edit their own jobs from the "
592
  "front-end."
593
  msgstr ""
594
 
595
+ #: includes/admin/class-wp-job-manager-setup.php:204
596
  msgid ""
597
  "If you plan on managing all listings from the admin dashboard you can skip "
598
  "creating this page."
599
  msgstr ""
600
 
601
+ #: includes/admin/class-wp-job-manager-setup.php:211
602
  msgid ""
603
  "This page allows users to browse, search, and filter job listings on the "
604
  "front-end of your site."
605
  msgstr ""
606
 
607
+ #: includes/admin/class-wp-job-manager-setup.php:219
608
  msgid "Skip this step"
609
  msgstr ""
610
 
611
+ #: includes/admin/class-wp-job-manager-setup.php:229
612
  msgid "All Done!"
613
  msgstr ""
614
 
615
+ #: includes/admin/class-wp-job-manager-setup.php:231
616
  msgid ""
617
  "Looks like you're all set to start using the plugin. In case you're "
618
  "wondering where to go next:"
619
  msgstr ""
620
 
621
+ #: includes/admin/class-wp-job-manager-setup.php:234
622
  msgid "Tweak the plugin settings"
623
  msgstr ""
624
 
625
+ #: includes/admin/class-wp-job-manager-setup.php:235
626
  msgid "Add a job via the back-end"
627
  msgstr ""
628
 
629
+ #: includes/admin/class-wp-job-manager-setup.php:238
630
  msgid "Add a job via the front-end"
631
  msgstr ""
632
 
633
+ #: includes/admin/class-wp-job-manager-setup.php:240
634
  msgid "Find out more about the front-end job submission form"
635
  msgstr ""
636
 
637
+ #: includes/admin/class-wp-job-manager-setup.php:244
638
  msgid "View submitted job listings"
639
  msgstr ""
640
 
641
+ #: includes/admin/class-wp-job-manager-setup.php:246
642
  msgid "Add the [jobs] shortcode to a page to list jobs"
643
  msgstr ""
644
 
645
+ #: includes/admin/class-wp-job-manager-setup.php:250
646
  msgid "View the job dashboard"
647
  msgstr ""
648
 
649
+ #: includes/admin/class-wp-job-manager-setup.php:252
650
  msgid "Find out more about the front-end job dashboard"
651
  msgstr ""
652
 
653
+ #: includes/admin/class-wp-job-manager-setup.php:256
654
  msgid ""
655
  "And don't forget, if you need any more help using <em>WP Job Manager</em> "
656
  "you can consult the %1$sdocumentation%2$s or %3$spost on the forums%2$s!"
657
  msgstr ""
658
 
659
+ #: includes/admin/class-wp-job-manager-setup.php:259
660
  msgid "Support the Ongoing Development of this Plugin"
661
  msgstr ""
662
 
663
+ #: includes/admin/class-wp-job-manager-setup.php:260
664
  msgid ""
665
  "There are many ways to support open-source projects such as WP Job Manager, "
666
  "for example code contribution, translation, or even telling your friends "
668
  "it is much appreciated!"
669
  msgstr ""
670
 
671
+ #: includes/admin/class-wp-job-manager-setup.php:262
672
  msgid "Leave a positive review"
673
  msgstr ""
674
 
675
+ #: includes/admin/class-wp-job-manager-setup.php:263
676
  msgid "Contribute a localization"
677
  msgstr ""
678
 
679
+ #: includes/admin/class-wp-job-manager-setup.php:264
680
  msgid "Contribute code or report a bug"
681
  msgstr ""
682
 
683
+ #: includes/admin/class-wp-job-manager-setup.php:265
684
  msgid "Help other users on the forums"
685
  msgstr ""
686
 
687
+ #: includes/admin/class-wp-job-manager-writepanels.php:56
688
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:175
689
  msgid "e.g. \"London\""
690
  msgstr ""
691
 
692
+ #: includes/admin/class-wp-job-manager-writepanels.php:57
693
  msgid "Leave this blank if the location is not important."
694
  msgstr ""
695
 
696
+ #: includes/admin/class-wp-job-manager-writepanels.php:61
697
  msgid "Application Email or URL"
698
  msgstr ""
699
 
700
+ #: includes/admin/class-wp-job-manager-writepanels.php:62
701
  msgid "URL or email which applicants use to apply"
702
  msgstr ""
703
 
704
+ #: includes/admin/class-wp-job-manager-writepanels.php:63
705
  msgid ""
706
  "This field is required for the \"application\" area to appear beneath the "
707
  "listing."
708
  msgstr ""
709
 
710
+ #: includes/admin/class-wp-job-manager-writepanels.php:68
711
  msgid "Company Name"
712
  msgstr ""
713
 
714
+ #: includes/admin/class-wp-job-manager-writepanels.php:73
715
  msgid "Company Website"
716
  msgstr ""
717
 
718
+ #: includes/admin/class-wp-job-manager-writepanels.php:78
719
  msgid "Company Tagline"
720
  msgstr ""
721
 
722
+ #: includes/admin/class-wp-job-manager-writepanels.php:79
723
  msgid "Brief description about the company"
724
  msgstr ""
725
 
726
+ #: includes/admin/class-wp-job-manager-writepanels.php:83
727
  msgid "Company Twitter"
728
  msgstr ""
729
 
730
+ #: includes/admin/class-wp-job-manager-writepanels.php:88
731
  msgid "Company Video"
732
  msgstr ""
733
 
734
+ #: includes/admin/class-wp-job-manager-writepanels.php:89
735
  msgid "URL to the company video"
736
  msgstr ""
737
 
738
+ #: includes/admin/class-wp-job-manager-writepanels.php:94
739
  msgid "Position Filled"
740
  msgstr ""
741
 
742
+ #: includes/admin/class-wp-job-manager-writepanels.php:97
743
  msgid "Filled listings will no longer accept applications."
744
  msgstr ""
745
 
746
+ #: includes/admin/class-wp-job-manager-writepanels.php:102
747
  msgid "Featured Listing"
748
  msgstr ""
749
 
750
+ #: includes/admin/class-wp-job-manager-writepanels.php:104
751
  msgid ""
752
  "Featured listings will be sticky during searches, and can be styled "
753
  "differently."
754
  msgstr ""
755
 
756
+ #: includes/admin/class-wp-job-manager-writepanels.php:108
757
  msgid "Listing Expiry Date"
758
  msgstr ""
759
 
760
+ #: includes/admin/class-wp-job-manager-writepanels.php:118
761
  msgid "Posted by"
762
  msgstr ""
763
 
764
+ #: includes/admin/class-wp-job-manager-writepanels.php:151
765
  msgid "%s Data"
766
  msgstr ""
767
 
768
+ #: includes/admin/class-wp-job-manager-writepanels.php:191
769
  msgid "Most Used"
770
  msgstr ""
771
 
772
+ #: includes/admin/class-wp-job-manager-writepanels.php:248
773
+ #: includes/admin/class-wp-job-manager-writepanels.php:251
774
+ #: includes/admin/class-wp-job-manager-writepanels.php:254
775
  msgid "Use file"
776
  msgstr ""
777
 
778
+ #: includes/admin/class-wp-job-manager-writepanels.php:248
779
+ #: includes/admin/class-wp-job-manager-writepanels.php:251
780
+ #: includes/admin/class-wp-job-manager-writepanels.php:254
781
  msgid "Upload"
782
  msgstr ""
783
 
784
+ #: includes/admin/class-wp-job-manager-writepanels.php:254
785
  msgid "Add file"
786
  msgstr ""
787
 
788
+ #: includes/admin/class-wp-job-manager-writepanels.php:427
789
  msgid "Guest User"
790
  msgstr ""
791
 
792
+ #: includes/admin/class-wp-job-manager-writepanels.php:429
793
  msgid "Change"
794
  msgstr ""
795
 
796
+ #: includes/admin/class-wp-job-manager-writepanels.php:433
797
  msgid "Enter the ID of the user, or leave blank if submitted by a guest."
798
  msgstr ""
799
 
800
+ #: includes/class-wp-job-manager-ajax.php:168
 
 
 
 
801
  msgid "Search completed. Found %d matching record."
802
  msgid_plural "Search completed. Found %d matching records."
803
  msgstr[0] ""
804
  msgstr[1] ""
805
 
806
+ #: includes/class-wp-job-manager-geocode.php:217
807
  msgid "No results found"
808
  msgstr ""
809
 
810
+ #: includes/class-wp-job-manager-geocode.php:221
811
  msgid "Query limit reached"
812
  msgstr ""
813
 
814
+ #: includes/class-wp-job-manager-geocode.php:227
815
+ #: includes/class-wp-job-manager-geocode.php:231
816
+ #: includes/class-wp-job-manager-geocode.php:235
817
  msgid "Geocoding error"
818
  msgstr ""
819
 
820
+ #: includes/class-wp-job-manager-install.php:61
821
  msgid "Employer"
822
  msgstr ""
823
 
824
+ #: includes/class-wp-job-manager-post-types.php:93
825
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:188
826
  msgid "Job category"
827
  msgstr ""
828
 
829
+ #: includes/class-wp-job-manager-post-types.php:94
830
  msgid "Job categories"
831
  msgstr ""
832
 
833
+ #: includes/class-wp-job-manager-post-types.php:118
834
+ #: includes/class-wp-job-manager-post-types.php:166
835
+ #: includes/class-wp-job-manager-post-types.php:222
836
  msgid "Search %s"
837
  msgstr ""
838
 
839
+ #: includes/class-wp-job-manager-post-types.php:119
840
+ #: includes/class-wp-job-manager-post-types.php:167
841
+ #: includes/class-wp-job-manager-post-types.php:214
842
  msgid "All %s"
843
  msgstr ""
844
 
845
+ #: includes/class-wp-job-manager-post-types.php:120
846
+ #: includes/class-wp-job-manager-post-types.php:168
847
+ #: includes/class-wp-job-manager-post-types.php:225
848
  msgid "Parent %s"
849
  msgstr ""
850
 
851
+ #: includes/class-wp-job-manager-post-types.php:121
852
+ #: includes/class-wp-job-manager-post-types.php:169
853
  msgid "Parent %s:"
854
  msgstr ""
855
 
856
+ #: includes/class-wp-job-manager-post-types.php:122
857
+ #: includes/class-wp-job-manager-post-types.php:170
858
+ #: includes/class-wp-job-manager-post-types.php:218
859
  msgid "Edit %s"
860
  msgstr ""
861
 
862
+ #: includes/class-wp-job-manager-post-types.php:123
863
+ #: includes/class-wp-job-manager-post-types.php:171
864
  msgid "Update %s"
865
  msgstr ""
866
 
867
+ #: includes/class-wp-job-manager-post-types.php:124
868
+ #: includes/class-wp-job-manager-post-types.php:172
869
  msgid "Add New %s"
870
  msgstr ""
871
 
872
+ #: includes/class-wp-job-manager-post-types.php:125
873
+ #: includes/class-wp-job-manager-post-types.php:173
874
  msgid "New %s Name"
875
  msgstr ""
876
 
877
+ #: includes/class-wp-job-manager-post-types.php:142
878
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:179
879
  msgid "Job type"
880
  msgstr ""
881
 
882
+ #: includes/class-wp-job-manager-post-types.php:143
883
  msgid "Job types"
884
  msgstr ""
885
 
886
+ #: includes/class-wp-job-manager-post-types.php:192
887
  msgid "Job"
888
  msgstr ""
889
 
890
+ #: includes/class-wp-job-manager-post-types.php:193
891
  msgid "Jobs"
892
  msgstr ""
893
 
894
+ #: includes/class-wp-job-manager-post-types.php:215
895
  msgid "Add New"
896
  msgstr ""
897
 
898
+ #: includes/class-wp-job-manager-post-types.php:216
899
  msgid "Add %s"
900
  msgstr ""
901
 
902
+ #: includes/class-wp-job-manager-post-types.php:219
903
  msgid "New %s"
904
  msgstr ""
905
 
906
+ #: includes/class-wp-job-manager-post-types.php:220
907
+ #: includes/class-wp-job-manager-post-types.php:221
908
  msgid "View %s"
909
  msgstr ""
910
 
911
+ #: includes/class-wp-job-manager-post-types.php:223
912
  msgid "No %s found"
913
  msgstr ""
914
 
915
+ #: includes/class-wp-job-manager-post-types.php:224
916
  msgid "No %s found in trash"
917
  msgstr ""
918
 
919
+ #: includes/class-wp-job-manager-post-types.php:226
920
  msgid "Company Logo"
921
  msgstr ""
922
 
923
+ #: includes/class-wp-job-manager-post-types.php:227
924
  msgid "Set company logo"
925
  msgstr ""
926
 
927
+ #: includes/class-wp-job-manager-post-types.php:228
928
  msgid "Remove company logo"
929
  msgstr ""
930
 
931
+ #: includes/class-wp-job-manager-post-types.php:229
932
  msgid "Use as company logo"
933
  msgstr ""
934
 
935
+ #: includes/class-wp-job-manager-post-types.php:231
936
  msgid "This is where you can create and manage %s."
937
  msgstr ""
938
 
939
+ #: includes/class-wp-job-manager-post-types.php:262
940
  msgid "Expired <span class=\"count\">(%s)</span>"
941
  msgid_plural "Expired <span class=\"count\">(%s)</span>"
942
  msgstr[0] ""
943
  msgstr[1] ""
944
 
945
+ #: includes/class-wp-job-manager-post-types.php:270
946
  msgid "Preview <span class=\"count\">(%s)</span>"
947
  msgid_plural "Preview <span class=\"count\">(%s)</span>"
948
  msgstr[0] ""
949
  msgstr[1] ""
950
 
951
+ #: includes/class-wp-job-manager-shortcodes.php:96
952
  msgid "Invalid ID"
953
  msgstr ""
954
 
955
+ #: includes/class-wp-job-manager-shortcodes.php:103
956
  msgid "This position has already been filled"
957
  msgstr ""
958
 
959
+ #: includes/class-wp-job-manager-shortcodes.php:109
960
  msgid "%s has been filled"
961
  msgstr ""
962
 
963
+ #: includes/class-wp-job-manager-shortcodes.php:114
964
  msgid "This position is not filled"
965
  msgstr ""
966
 
967
+ #: includes/class-wp-job-manager-shortcodes.php:121
968
  msgid "%s has been marked as not filled"
969
  msgstr ""
970
 
971
+ #: includes/class-wp-job-manager-shortcodes.php:128
972
  msgid "%s has been deleted"
973
  msgstr ""
974
 
975
+ #: includes/class-wp-job-manager-shortcodes.php:133
976
+ #: includes/class-wp-job-manager-shortcodes.php:146
977
  msgid "Missing submission page."
978
  msgstr ""
979
 
980
+ #: includes/class-wp-job-manager-shortcodes.php:217
981
+ #: includes/widgets/class-wp-job-manager-widget-featured-jobs.php:28
982
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:28
983
  msgid "Title"
984
  msgstr ""
985
 
986
+ #: includes/class-wp-job-manager-shortcodes.php:219
987
  msgid "Date Posted"
988
  msgstr ""
989
 
990
+ #: includes/class-wp-job-manager-shortcodes.php:220
991
  msgid "Listing Expires"
992
  msgstr ""
993
 
994
+ #: includes/class-wp-job-manager-shortcodes.php:314
995
+ #: includes/class-wp-job-manager-shortcodes.php:348
996
  msgid "Load more listings"
997
  msgstr ""
998
 
999
+ #: includes/forms/class-wp-job-manager-form-edit-job.php:67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  msgid "Invalid listing"
1001
  msgstr ""
1002
 
1003
+ #: includes/forms/class-wp-job-manager-form-edit-job.php:106
1004
  msgid "Save changes"
1005
  msgstr ""
1006
 
1007
+ #: includes/forms/class-wp-job-manager-form-edit-job.php:135
1008
+ #: includes/forms/class-wp-job-manager-form-edit-job.php:138
1009
  msgid "Your changes have been saved."
1010
  msgstr ""
1011
 
1012
+ #: includes/forms/class-wp-job-manager-form-edit-job.php:135
1013
  msgid "View &rarr;"
1014
  msgstr ""
1015
 
1016
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:63
1017
  msgid "Submit Details"
1018
  msgstr ""
1019
 
1020
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:69
1021
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:432
1022
  #: templates/job-preview.php:5
1023
  msgid "Preview"
1024
  msgstr ""
1025
 
1026
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:75
1027
  msgid "Done"
1028
  msgstr ""
1029
 
1030
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:143
1031
  msgid "Application email"
1032
  msgstr ""
1033
 
1034
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:144
1035
  #: templates/account-signin.php:49
1036
  msgid "you@yourdomain.com"
1037
  msgstr ""
1038
 
1039
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:147
1040
  msgid "Application URL"
1041
  msgstr ""
1042
 
1043
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:148
1044
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:223
1045
  msgid "http://"
1046
  msgstr ""
1047
 
1048
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:151
1049
  msgid "Application email/URL"
1050
  msgstr ""
1051
 
1052
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:152
1053
  msgid "Enter an email address or website URL"
1054
  msgstr ""
1055
 
1056
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:164
1057
  msgid "Job Title"
1058
  msgstr ""
1059
 
1060
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:172
1061
  msgid "Leave this blank if the location is not important"
1062
  msgstr ""
1063
 
1064
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:182
1065
+ msgid "Choose job type&hellip;"
1066
+ msgstr ""
1067
+
1068
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:197
1069
  msgid "Description"
1070
  msgstr ""
1071
 
1072
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:213
1073
  msgid "Company name"
1074
  msgstr ""
1075
 
1076
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:216
1077
  msgid "Enter the name of the company"
1078
  msgstr ""
1079
 
1080
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:220
1081
  #: templates/content-single-job_listing-company.php:19
1082
  msgid "Website"
1083
  msgstr ""
1084
 
1085
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:227
1086
  msgid "Tagline"
1087
  msgstr ""
1088
 
1089
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:230
1090
  msgid "Briefly describe your company"
1091
  msgstr ""
1092
 
1093
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:235
1094
  msgid "Video"
1095
  msgstr ""
1096
 
1097
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:238
1098
  msgid "A link to a video about your company"
1099
  msgstr ""
1100
 
1101
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:242
1102
  msgid "Twitter username"
1103
  msgstr ""
1104
 
1105
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:245
1106
  msgid "@yourcompany"
1107
  msgstr ""
1108
 
1109
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:249
1110
  msgid "Logo"
1111
  msgstr ""
1112
 
1113
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:285
1114
  msgid "%s is a required field"
1115
  msgstr ""
1116
 
1117
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:295
1118
  msgid "%s is invalid"
1119
  msgstr ""
1120
 
1121
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:311
1122
+ #: wp-job-manager-functions.php:859
1123
  msgid "\"%s\" (filetype %s) needs to be one of the following file types: %s"
1124
  msgstr ""
1125
 
1126
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:326
1127
  msgid "Please enter a valid application email address"
1128
  msgstr ""
1129
 
1130
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:335
1131
  msgid "Please enter a valid application URL"
1132
  msgstr ""
1133
 
1134
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:345
1135
  msgid "Please enter a valid application email address or URL"
1136
  msgstr ""
1137
 
1138
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:463
1139
  msgid "Please enter a username."
1140
  msgstr ""
1141
 
1142
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:466
1143
  msgid "Please enter your email address."
1144
  msgstr ""
1145
 
1146
+ #: includes/forms/class-wp-job-manager-form-submit-job.php:484
1147
  msgid "You must be signed in to post a new listing."
1148
  msgstr ""
1149
 
1150
+ #: includes/widgets/class-wp-job-manager-widget-featured-jobs.php:21
1151
+ msgid "Display a list of featured listings on your site."
1152
+ msgstr ""
1153
+
1154
+ #: includes/widgets/class-wp-job-manager-widget-featured-jobs.php:23
1155
+ #: includes/widgets/class-wp-job-manager-widget-featured-jobs.php:27
1156
+ msgid "Featured %s"
1157
+ msgstr ""
1158
+
1159
+ #: includes/widgets/class-wp-job-manager-widget-featured-jobs.php:36
1160
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:46
1161
+ msgid "Number of listings to show"
1162
+ msgstr ""
1163
+
1164
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:21
1165
+ msgid ""
1166
+ "Display a list of recent listings on your site, optionally matching a "
1167
+ "keyword and location."
1168
+ msgstr ""
1169
+
1170
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:23
1171
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:27
1172
+ msgid "Recent %s"
1173
+ msgstr ""
1174
+
1175
+ #: includes/widgets/class-wp-job-manager-widget-recent-jobs.php:33
1176
+ msgid "Keyword"
1177
+ msgstr ""
1178
+
1179
  #: templates/account-signin.php:4
1180
  msgid "Your account"
1181
  msgstr ""
1216
  msgstr ""
1217
 
1218
  #: templates/account-signin.php:40 templates/account-signin.php:47
1219
+ #: templates/job-submit.php:32 templates/job-submit.php:49
1220
  msgid "(optional)"
1221
  msgstr ""
1222
 
1249
  msgstr ""
1250
 
1251
  #: templates/form-fields/multiselect-field.php:3
1252
+ #: wp-job-manager-functions.php:647
1253
  msgid "No results match"
1254
  msgstr ""
1255
 
1256
  #: templates/form-fields/multiselect-field.php:3
1257
+ #: wp-job-manager-functions.php:648
1258
  msgid "Select Some Options"
1259
  msgstr ""
1260
 
1269
  "class=\"job_application_email\" href=\"mailto:%1$s%2$s\">%1$s</a>"
1270
  msgstr ""
1271
 
 
 
 
 
1272
  #: templates/job-application-url.php:1
1273
  msgid "To apply for this job please visit the following URL:"
1274
  msgstr ""
1331
  msgid "Edit listing"
1332
  msgstr ""
1333
 
1334
+ #: templates/job-submit.php:13
1335
+ msgid "You are editing an existing job. %s"
1336
+ msgstr ""
1337
+
1338
+ #: templates/job-submit.php:13
1339
+ msgid "Create A New Job"
1340
+ msgstr ""
1341
+
1342
+ #: templates/job-submit.php:43
1343
  msgid "Company Details"
1344
  msgstr ""
1345
 
1351
  msgid "%s submitted successfully. Your listing will be visible once approved."
1352
  msgstr ""
1353
 
1354
+ #: wp-job-manager-functions.php:373
1355
  msgid "Reset"
1356
  msgstr ""
1357
 
1358
+ #: wp-job-manager-functions.php:377
1359
  msgid "RSS"
1360
  msgstr ""
1361
 
1362
+ #: wp-job-manager-functions.php:468
1363
  msgid "Invalid email address."
1364
  msgstr ""
1365
 
1366
+ #: wp-job-manager-functions.php:476
1367
  msgid "Your email address isn&#8217;t correct."
1368
  msgstr ""
1369
 
1370
+ #: wp-job-manager-functions.php:480
1371
  msgid "This email is already registered, please choose another one."
1372
  msgstr ""
1373
 
1374
+ #: wp-job-manager-functions.php:646
1375
  msgid "Choose a category&hellip;"
1376
  msgstr ""
1377
 
1378
+ #: wp-job-manager-functions.php:861
1379
  msgid "Uploaded files need to be one of the following file types: %s"
1380
  msgstr ""
1381
 
1382
+ #: wp-job-manager-template.php:146
1383
  msgid "Inactive"
1384
  msgstr ""
1385
 
1386
+ #: wp-job-manager-template.php:237
1387
  msgid "Application via \"%s\" listing on %s"
1388
  msgstr ""
1389
 
1390
+ #: wp-job-manager-template.php:298
1391
  msgid "Posted on "
1392
  msgstr ""
1393
 
1394
+ #: wp-job-manager-template.php:300 wp-job-manager-template.php:320
1395
  msgid "Posted %s ago"
1396
  msgstr ""
1397
 
1398
+ #: wp-job-manager-template.php:343
1399
  msgid "Anywhere"
1400
  msgstr ""
1401
 
1402
+ #: wp-job-manager.php:153
1403
  msgid "Load previous listings"
1404
  msgstr ""
1405
 
1406
+ #: wp-job-manager.php:204
1407
  msgid "Invalid file type. Accepted types:"
1408
  msgstr ""
1409
 
1410
+ #: wp-job-manager.php:215
1411
  msgid "Are you sure you want to delete this listing?"
1412
  msgstr ""
1413
 
1429
  msgid "Automattic"
1430
  msgstr ""
1431
 
1432
+ #: includes/admin/class-wp-job-manager-admin.php:68
1433
  #. translators: jQuery date format, see
1434
  #. http:api.jqueryui.com/datepicker/#utility-formatDate
1435
  msgctxt "Date format for jQuery datepicker."
1436
  msgid "yy-mm-dd"
1437
  msgstr ""
1438
 
1439
+ #: includes/admin/class-wp-job-manager-setup.php:190
1440
  msgctxt "Default page title (wizard)"
1441
  msgid "Post a Job"
1442
  msgstr ""
1443
 
1444
+ #: includes/admin/class-wp-job-manager-setup.php:200
1445
  msgctxt "Default page title (wizard)"
1446
  msgid "Job Dashboard"
1447
  msgstr ""
1448
 
1449
+ #: includes/admin/class-wp-job-manager-setup.php:210
1450
  msgctxt "Default page title (wizard)"
1451
  msgid "Jobs"
1452
  msgstr ""
1453
 
1454
+ #: includes/admin/class-wp-job-manager-writepanels.php:112
1455
  #. translators: date format placeholder, see https:secure.php.net/date
1456
  msgctxt "Date format placeholder."
1457
  msgid "yyyy-mm-dd"
1458
  msgstr ""
1459
 
1460
+ #: includes/class-wp-job-manager-post-types.php:98
1461
  msgctxt "Job category slug - resave permalinks after changing this"
1462
  msgid "job-category"
1463
  msgstr ""
1464
 
1465
+ #: includes/class-wp-job-manager-post-types.php:147
1466
  msgctxt "Job type slug - resave permalinks after changing this"
1467
  msgid "job-type"
1468
  msgstr ""
1469
 
1470
+ #: includes/class-wp-job-manager-post-types.php:196
1471
  msgctxt "Post type archive slug - resave permalinks after changing this"
1472
  msgid "jobs"
1473
  msgstr ""
1474
 
1475
+ #: includes/class-wp-job-manager-post-types.php:202
1476
  msgctxt "Job permalink - resave permalinks after changing this"
1477
  msgid "job"
1478
  msgstr ""
1479
 
1480
+ #: includes/class-wp-job-manager-post-types.php:256
1481
+ #: wp-job-manager-functions.php:268
1482
  msgctxt "post status"
1483
  msgid "Expired"
1484
  msgstr ""
1485
 
1486
+ #: includes/class-wp-job-manager-post-types.php:265
1487
+ #: wp-job-manager-functions.php:269
1488
  msgctxt "post status"
1489
  msgid "Preview"
1490
  msgstr ""
1491
 
1492
+ #: wp-job-manager-functions.php:267
1493
  msgctxt "post status"
1494
  msgid "Draft"
1495
  msgstr ""
1496
 
1497
+ #: wp-job-manager-functions.php:270
1498
  msgctxt "post status"
1499
  msgid "Pending approval"
1500
  msgstr ""
1501
 
1502
+ #: wp-job-manager-functions.php:271
1503
  msgctxt "post status"
1504
  msgid "Pending payment"
1505
  msgstr ""
1506
 
1507
+ #: wp-job-manager-functions.php:272
1508
  msgctxt "post status"
1509
  msgid "Active"
1510
  msgstr ""
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === WP Job Manager ===
2
- Contributors: mikejolley, automattic, adamkheckler, annezazu, artemitos, bikedorkjon, cena, chaselivingston, csonnek, davor.altman, drawmyface, erania-pinnera, jacobshere, jeherve, jenhooks, jgs, kraftbj, lamdayap, lschuyler, macmanx, nancythanki, orangesareorange, rachelsquirrel, ryancowles, richardmtl, scarstocea
3
  Tags: job manager, job listing, job board, job management, job lists, job list, job, jobs, company, hiring, employment, employer, employees, candidate, freelance, internship, job listings, positions, board, application, hiring, listing, manager, recruiting, recruitment, talent
4
  Requires at least: 4.1
5
  Tested up to: 4.7
6
- Stable tag: 1.25.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -141,6 +141,23 @@ You can view (and contribute) translations via the [translate.wordpress.org](htt
141
 
142
  == Changelog ==
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  = 1.25.3 =
145
  * Enhancement: Allow job types to be optional, just like categories. https://github.com/automattic/wp-job-manager/pull/789 Props Donncha.
146
  * Enhancement: Add get_job_listing_types filter. https://github.com/automattic/wp-job-manager/pull/824 Props Adam Heckler.
1
  === WP Job Manager ===
2
+ Contributors: mikejolley, automattic, adamkheckler, annezazu, cena, chaselivingston, csonnek, davor.altman, drawmyface, erania-pinnera, jacobshere, jakeom, jeherve, jenhooks, jgs, jonryan, kraftbj, lamdayap, lschuyler, macmanx, nancythanki, orangesareorange, rachelsquirrel, ryancowles, richardmtl, scarstocea
3
  Tags: job manager, job listing, job board, job management, job lists, job list, job, jobs, company, hiring, employment, employer, employees, candidate, freelance, internship, job listings, positions, board, application, hiring, listing, manager, recruiting, recruitment, talent
4
  Requires at least: 4.1
5
  Tested up to: 4.7
6
+ Stable tag: 1.26.0
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
141
 
142
  == Changelog ==
143
 
144
+ = 1.26.0 =
145
+ * Enhancement: Warn the user if they're editing an existing job. (@donnchawp; https://github.com/Automattic/WP-Job-Manager/pull/847)
146
+ * Enhancement: WP Admin Job Listing page's table is now responsive. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/906)
147
+ * Enhancement: New setting for hiding expired listings from `[jobs]` filter. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/903)
148
+ * Enhancement: Use WP Query's built in search function to improve searching in `[jobs]`. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/960)
149
+ * Fix: Job Listing filter only searches meta fields with relevant content. Add custom fields with `job_listing_searchable_meta_keys` filter. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/910)
150
+ * Fix: Improved support for WPML and Polylang. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/963)
151
+ * Fix: Expired field no longer forces admins to choose a date in the future. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/903)
152
+ * Fix: Listings with expiration date in past will immediately expire; moving to Active status will extend if necessary. (@turtlepod, @jom; https://github.com/Automattic/WP-Job-Manager/pull/903, https://github.com/Automattic/WP-Job-Manager/pull/975)
153
+ * Fix: Google Maps API key setting added to fix geolocation retrieval on new sites. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/912)
154
+ * Fix: Issue when duplicating a job listing with a field for multiple file uploads. (@turtlepod; https://github.com/Automattic/WP-Job-Manager/pull/911)
155
+ * Fix: Hide page results when adding links in the `[submit_job_form]` shortcode. (@jom; https://github.com/Automattic/WP-Job-Manager/pull/922)
156
+ * Fix: Job feed now loads when a site has no posts. (@dbtlr; https://github.com/Automattic/WP-Job-Manager/pull/870)
157
+ * Fix: No error is thrown when deleting a user. (@tripflex; https://github.com/Automattic/WP-Job-Manager/pull/875)
158
+ * Dev: Plugins and themes can now retrieve JSON of Job Listings results without HTML. (@spencerfinnell; https://github.com/Automattic/WP-Job-Manager/pull/888)
159
+ * Dev: Updated inline documentation.
160
+
161
  = 1.25.3 =
162
  * Enhancement: Allow job types to be optional, just like categories. https://github.com/automattic/wp-job-manager/pull/789 Props Donncha.
163
  * Enhancement: Add get_job_listing_types filter. https://github.com/automattic/wp-job-manager/pull/824 Props Adam Heckler.
templates/form-fields/radio-field.php CHANGED
@@ -14,6 +14,7 @@
14
  * )
15
  * )
16
  */
 
17
  $field['default'] = empty( $field['default'] ) ? current( array_keys( $field['options'] ) ) : $field['default'];
18
  $default = ! empty( $field['value'] ) ? $field['value'] : $field['default'];
19
 
@@ -22,4 +23,4 @@ foreach ( $field['options'] as $option_key => $value ) : ?>
22
  <label><input type="radio" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" value="<?php echo esc_attr( $option_key ); ?>" <?php checked( $default, $option_key ); ?> /> <?php echo esc_html( $value ); ?></label><br/>
23
 
24
  <?php endforeach; ?>
25
- <?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?>
14
  * )
15
  * )
16
  */
17
+
18
  $field['default'] = empty( $field['default'] ) ? current( array_keys( $field['options'] ) ) : $field['default'];
19
  $default = ! empty( $field['value'] ) ? $field['value'] : $field['default'];
20
 
23
  <label><input type="radio" name="<?php echo esc_attr( isset( $field['name'] ) ? $field['name'] : $key ); ?>" value="<?php echo esc_attr( $option_key ); ?>" <?php checked( $default, $option_key ); ?> /> <?php echo esc_html( $value ); ?></label><br/>
24
 
25
  <?php endforeach; ?>
26
+ <?php if ( ! empty( $field['description'] ) ) : ?><small class="description"><?php echo $field['description']; ?></small><?php endif; ?>
templates/job-application-email.php CHANGED
@@ -1,14 +1 @@
1
  <p><?php printf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ); ?></p>
2
-
3
- <p>
4
- <?php _e( 'Apply using webmail: ', 'wp-job-manager' ); ?>
5
-
6
- <a href="https://mail.google.com/mail/?view=cm&fs=1&to=<?php echo $apply->email; ?>&su=<?php echo urlencode( $apply->subject ); ?>" target="_blank" class="job_application_email">Gmail</a> /
7
-
8
- <a href="http://webmail.aol.com/Mail/ComposeMessage.aspx?to=<?php echo $apply->email; ?>&subject=<?php echo urlencode( $apply->subject ); ?>" target="_blank" class="job_application_email">AOL</a> /
9
-
10
- <a href="http://compose.mail.yahoo.com/?to=<?php echo $apply->email; ?>&subject=<?php echo urlencode( $apply->subject ); ?>" target="_blank" class="job_application_email">Yahoo</a> /
11
-
12
- <a href="http://mail.live.com/mail/EditMessageLight.aspx?n=&to=<?php echo $apply->email; ?>&subject=<?php echo urlencode( $apply->subject ); ?>" target="_blank" class="job_application_email">Outlook</a>
13
-
14
- </p>
1
  <p><?php printf( __( 'To apply for this job <strong>email your details to</strong> <a class="job_application_email" href="mailto:%1$s%2$s">%1$s</a>', 'wp-job-manager' ), $apply->email, '?subject=' . rawurlencode( $apply->subject ) ); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/job-preview.php CHANGED
@@ -1,16 +1,16 @@
1
  <form method="post" id="job_preview" action="<?php echo esc_url( $form->get_action() ); ?>">
2
- <div class="job_listing_preview_title">
3
- <input type="submit" name="continue" id="job_preview_submit_button" class="button job-manager-button-submit-listing" value="<?php echo apply_filters( 'submit_job_step_preview_submit_text', __( 'Submit Listing', 'wp-job-manager' ) ); ?>" />
4
- <input type="submit" name="edit_job" class="button job-manager-button-edit-listing" value="<?php _e( 'Edit listing', 'wp-job-manager' ); ?>" />
5
- <h2><?php _e( 'Preview', 'wp-job-manager' ); ?></h2>
6
- </div>
7
- <div class="job_listing_preview single_job_listing">
8
- <h1><?php the_title(); ?></h1>
9
 
10
- <?php get_job_manager_template_part( 'content-single', 'job_listing' ); ?>
11
 
12
- <input type="hidden" name="job_id" value="<?php echo esc_attr( $form->get_job_id() ); ?>" />
13
- <input type="hidden" name="step" value="<?php echo esc_attr( $form->get_step() ); ?>" />
14
- <input type="hidden" name="job_manager_form" value="<?php echo $form->get_form_name(); ?>" />
15
- </div>
16
  </form>
1
  <form method="post" id="job_preview" action="<?php echo esc_url( $form->get_action() ); ?>">
2
+ <div class="job_listing_preview_title">
3
+ <input type="submit" name="continue" id="job_preview_submit_button" class="button job-manager-button-submit-listing" value="<?php echo apply_filters( 'submit_job_step_preview_submit_text', __( 'Submit Listing', 'wp-job-manager' ) ); ?>" />
4
+ <input type="submit" name="edit_job" class="button job-manager-button-edit-listing" value="<?php _e( 'Edit listing', 'wp-job-manager' ); ?>" />
5
+ <h2><?php _e( 'Preview', 'wp-job-manager' ); ?></h2>
6
+ </div>
7
+ <div class="job_listing_preview single_job_listing">
8
+ <h1><?php the_title(); ?></h1>
9
 
10
+ <?php get_job_manager_template_part( 'content-single', 'job_listing' ); ?>
11
 
12
+ <input type="hidden" name="job_id" value="<?php echo esc_attr( $form->get_job_id() ); ?>" />
13
+ <input type="hidden" name="step" value="<?php echo esc_attr( $form->get_step() ); ?>" />
14
+ <input type="hidden" name="job_manager_form" value="<?php echo $form->get_form_name(); ?>" />
15
+ </div>
16
  </form>
templates/job-submit.php CHANGED
@@ -8,6 +8,12 @@ global $job_manager;
8
  ?>
9
  <form action="<?php echo esc_url( $action ); ?>" method="post" id="submit-job-form" class="job-manager-form" enctype="multipart/form-data">
10
 
 
 
 
 
 
 
11
  <?php do_action( 'submit_job_form_start' ); ?>
12
 
13
  <?php if ( apply_filters( 'submit_job_form_show_signin', true ) ) : ?>
8
  ?>
9
  <form action="<?php echo esc_url( $action ); ?>" method="post" id="submit-job-form" class="job-manager-form" enctype="multipart/form-data">
10
 
11
+ <?php
12
+ if ( isset( $resume_edit ) && $resume_edit ) {
13
+ printf( '<p><strong>' . __( "You are editing an existing job. %s" ) . '</strong></p>', '<a href="?new=1&key=' . $resume_edit . '">' . __( 'Create A New Job' ) . '</a>' );
14
+ }
15
+ ?>
16
+
17
  <?php do_action( 'submit_job_form_start' ); ?>
18
 
19
  <?php if ( apply_filters( 'submit_job_form_show_signin', true ) ) : ?>
uninstall.php CHANGED
@@ -29,7 +29,8 @@ $options = array(
29
  'job_manager_jobs_page_id',
30
  'job_manager_installed_terms',
31
  'job_manager_submit_page_slug',
32
- 'job_manager_job_dashboard_page_slug'
 
33
  );
34
 
35
  foreach ( $options as $option ) {
29
  'job_manager_jobs_page_id',
30
  'job_manager_installed_terms',
31
  'job_manager_submit_page_slug',
32
+ 'job_manager_job_dashboard_page_slug',
33
+ 'job_manager_google_maps_api_key',
34
  );
35
 
36
  foreach ( $options as $option ) {
wp-job-manager-functions.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
2
  if ( ! function_exists( 'get_job_listings' ) ) :
3
  /**
4
- * Queries job listings with certain criteria and returns them
5
  *
6
- * @access public
7
- * @return void
 
8
  */
9
  function get_job_listings( $args = array() ) {
10
  global $wpdb, $job_manager_keyword;
@@ -23,7 +24,16 @@ function get_job_listings( $args = array() ) {
23
  'fields' => 'all'
24
  ) );
25
 
26
- if ( false == get_option( 'job_manager_hide_expired_content', 1 ) ) {
 
 
 
 
 
 
 
 
 
27
  $post_status = array( 'publish', 'expired' );
28
  } else {
29
  $post_status = 'publish';
@@ -45,11 +55,6 @@ function get_job_listings( $args = array() ) {
45
  'fields' => $args['fields']
46
  );
47
 
48
- // WPML workaround
49
- if ( ( strstr( $_SERVER['REQUEST_URI'], '/jm-ajax/' ) || ! empty( $_GET['jm-ajax'] ) ) && isset( $_POST['lang'] ) ) {
50
- do_action( 'wpml_switch_language', sanitize_text_field( $_POST['lang'] ) );
51
- }
52
-
53
  if ( $args['posts_per_page'] < 0 ) {
54
  $query_args['no_found_rows'] = true;
55
  }
@@ -113,8 +118,8 @@ function get_job_listings( $args = array() ) {
113
  $job_manager_keyword = sanitize_text_field( $args['search_keywords'] );
114
 
115
  if ( ! empty( $job_manager_keyword ) && strlen( $job_manager_keyword ) >= apply_filters( 'job_manager_get_listings_keyword_length_threshold', 2 ) ) {
116
- $query_args['_keyword'] = $job_manager_keyword; // Does nothing but needed for unique hash
117
- add_filter( 'posts_clauses', 'get_job_listings_keyword_search' );
118
  }
119
 
120
  $query_args = apply_filters( 'job_manager_get_listings', $query_args, $args );
@@ -127,16 +132,14 @@ function get_job_listings( $args = array() ) {
127
  unset( $query_args['tax_query'] );
128
  }
129
 
130
- // Polylang LANG arg
131
- if ( function_exists( 'pll_current_language' ) ) {
132
- $query_args['lang'] = pll_current_language();
133
- }
134
 
135
  // Filter args
136
  $query_args = apply_filters( 'get_job_listings_query_args', $query_args, $args );
137
 
138
  // Generate hash
139
- $to_hash = json_encode( $query_args ) . apply_filters( 'wpml_current_language', '' );
140
  $query_args_hash = 'jm_' . md5( $to_hash ) . WP_Job_Manager_Cache_Helper::get_transient_version( 'get_job_listings' );
141
 
142
  do_action( 'before_get_job_listings', $query_args, $args );
@@ -161,7 +164,7 @@ function get_job_listings( $args = array() ) {
161
 
162
  do_action( 'after_get_job_listings', $query_args, $args );
163
 
164
- remove_filter( 'posts_clauses', 'get_job_listings_keyword_search' );
165
 
166
  return $result;
167
  }
@@ -169,28 +172,71 @@ endif;
169
 
170
  if ( ! function_exists( 'get_job_listings_keyword_search' ) ) :
171
  /**
172
- * Join and where query for keywords
173
  *
174
- * @param array $args
175
- * @return array
 
 
 
176
  */
177
- function get_job_listings_keyword_search( $args ) {
178
  global $wpdb, $job_manager_keyword;
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  $conditions = array();
181
- $conditions[] = "{$wpdb->posts}.post_title LIKE '%" . esc_sql( $job_manager_keyword ) . "%'";
182
- $conditions[] = "{$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value LIKE '%" . esc_sql( $job_manager_keyword ) . "%' )";
 
 
 
 
 
 
 
 
 
 
 
 
183
  $conditions[] = "{$wpdb->posts}.ID IN ( SELECT object_id FROM {$wpdb->term_relationships} AS tr LEFT JOIN {$wpdb->term_taxonomy} AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id LEFT JOIN {$wpdb->terms} AS t ON tt.term_id = t.term_id WHERE t.name LIKE '%" . esc_sql( $job_manager_keyword ) . "%' )";
184
 
185
- if ( ctype_alnum( $job_manager_keyword ) ) {
186
- $conditions[] = "{$wpdb->posts}.post_content RLIKE '[[:<:]]" . esc_sql( $job_manager_keyword ) . "[[:>:]]'";
187
- } else {
188
- $conditions[] = "{$wpdb->posts}.post_content LIKE '%" . esc_sql( $job_manager_keyword ) . "%'";
 
 
 
 
 
 
 
189
  }
190
 
191
- $args['where'] .= " AND ( " . implode( ' OR ', $conditions ) . " ) ";
192
 
193
- return $args;
 
 
 
 
 
 
 
194
  }
195
  endif;
196
 
@@ -211,9 +257,9 @@ endif;
211
 
212
  if ( ! function_exists( 'get_job_listing_post_statuses' ) ) :
213
  /**
214
- * Get post statuses used for jobs
215
  *
216
- * @access public
217
  * @return array
218
  */
219
  function get_job_listing_post_statuses() {
@@ -232,7 +278,7 @@ if ( ! function_exists( 'get_featured_job_ids' ) ) :
232
  /**
233
  * Gets the ids of featured jobs.
234
  *
235
- * @access public
236
  * @return array
237
  */
238
  function get_featured_job_ids() {
@@ -249,9 +295,10 @@ endif;
249
 
250
  if ( ! function_exists( 'get_job_listing_types' ) ) :
251
  /**
252
- * Get job listing types
253
  *
254
- * @access public
 
255
  * @return array
256
  */
257
  function get_job_listing_types( $fields = 'all' ) {
@@ -277,9 +324,9 @@ endif;
277
 
278
  if ( ! function_exists( 'get_job_listing_categories' ) ) :
279
  /**
280
- * Get job categories
281
  *
282
- * @access public
283
  * @return array
284
  */
285
  function get_job_listing_categories() {
@@ -298,6 +345,10 @@ endif;
298
  if ( ! function_exists( 'job_manager_get_filtered_links' ) ) :
299
  /**
300
  * Shows links after filtering jobs
 
 
 
 
301
  */
302
  function job_manager_get_filtered_links( $args = array() ) {
303
  $job_categories = array();
@@ -351,6 +402,8 @@ if ( ! function_exists( 'get_job_listing_rss_link' ) ) :
351
  /**
352
  * Get the Job Listing RSS link
353
  *
 
 
354
  * @return string
355
  */
356
  function get_job_listing_rss_link( $args = array() ) {
@@ -361,9 +414,10 @@ endif;
361
 
362
  if ( ! function_exists( 'wp_job_manager_notify_new_user' ) ) :
363
  /**
364
- * Handle account creation.
365
  *
366
- * @param int $user_id
 
367
  * @param string $password
368
  */
369
  function wp_job_manager_notify_new_user( $user_id, $password ) {
@@ -379,11 +433,12 @@ endif;
379
 
380
  if ( ! function_exists( 'job_manager_create_account' ) ) :
381
  /**
382
- * Handle account creation.
383
  *
384
- * @param array $args containing username, email, role
385
- * @param string $deprecated role string
386
- * @return WP_error | bool was an account created?
 
387
  */
388
  function wp_job_manager_create_account( $args, $deprecated = '' ) {
389
  global $current_user;
@@ -450,27 +505,28 @@ function wp_job_manager_create_account( $args, $deprecated = '' ) {
450
  'user_pass' => $password,
451
  'user_email' => $email,
452
  'role' => $role
453
- );
454
 
455
- $user_id = wp_insert_user( apply_filters( 'job_manager_create_account_data', $new_user ) );
456
 
457
- if ( is_wp_error( $user_id ) ) {
458
- return $user_id;
459
- }
460
 
461
- // Notify
462
- wp_job_manager_notify_new_user( $user_id, $password, $new_user );
463
- // Login
464
- wp_set_auth_cookie( $user_id, true, is_ssl() );
465
- $current_user = get_user_by( 'id', $user_id );
466
 
467
- return true;
468
  }
469
  endif;
470
 
471
  /**
472
- * True if an the user can post a job. If accounts are required, and reg is enabled, users can post (they signup at the same time).
473
  *
 
474
  * @return bool
475
  */
476
  function job_manager_user_can_post_job() {
@@ -486,8 +542,10 @@ function job_manager_user_can_post_job() {
486
  }
487
 
488
  /**
489
- * True if an the user can edit a job.
490
  *
 
 
491
  * @return bool
492
  */
493
  function job_manager_user_can_edit_job( $job_id ) {
@@ -507,8 +565,9 @@ function job_manager_user_can_edit_job( $job_id ) {
507
  }
508
 
509
  /**
510
- * True if only one type allowed per job
511
  *
 
512
  * @return bool
513
  */
514
  function job_manager_multi_job_type() {
@@ -516,8 +575,9 @@ function job_manager_multi_job_type() {
516
  }
517
 
518
  /**
519
- * True if registration is enabled.
520
  *
 
521
  * @return bool
522
  */
523
  function job_manager_enable_registration() {
@@ -525,8 +585,9 @@ function job_manager_enable_registration() {
525
  }
526
 
527
  /**
528
- * True if usernames are generated from email addresses.
529
  *
 
530
  * @return bool
531
  */
532
  function job_manager_generate_username_from_email() {
@@ -534,8 +595,9 @@ function job_manager_generate_username_from_email() {
534
  }
535
 
536
  /**
537
- * True if an account is required to post a job.
538
  *
 
539
  * @return bool
540
  */
541
  function job_manager_user_requires_account() {
@@ -543,8 +605,9 @@ function job_manager_user_requires_account() {
543
  }
544
 
545
  /**
546
- * True if users are allowed to edit submissions that are pending approval.
547
  *
 
548
  * @return bool
549
  */
550
  function job_manager_user_can_edit_pending_submissions() {
@@ -552,8 +615,14 @@ function job_manager_user_can_edit_pending_submissions() {
552
  }
553
 
554
  /**
 
 
555
  * Based on wp_dropdown_categories, with the exception of supporting multiple selected categories.
 
 
556
  * @see wp_dropdown_categories
 
 
557
  */
558
  function job_manager_dropdown_categories( $args = '' ) {
559
  $defaults = array(
@@ -585,12 +654,8 @@ function job_manager_dropdown_categories( $args = '' ) {
585
  $r['pad_counts'] = true;
586
  }
587
 
588
- // WPML & Polylang caching per language
589
- if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
590
- $r['lang'] = apply_filters( 'wpml_current_language', NULL );
591
- } elseif ( function_exists( 'pll_current_language' ) ) {
592
- $r['lang'] = pll_current_language();
593
- }
594
 
595
  extract( $r );
596
 
@@ -644,21 +709,32 @@ function job_manager_dropdown_categories( $args = '' ) {
644
  }
645
 
646
  /**
647
- * Get the page ID of a page if set, with PolyLang compat.
 
 
648
  * @param string $page e.g. job_dashboard, submit_job_form, jobs
649
  * @return int
650
  */
651
  function job_manager_get_page_id( $page ) {
652
  $page_id = get_option( 'job_manager_' . $page . '_page_id', false );
653
  if ( $page_id ) {
654
- return apply_filters( 'wpml_object_id', absint( function_exists( 'pll_get_post' ) ? pll_get_post( $page_id ) : $page_id ), 'page', TRUE );
 
 
 
 
 
 
 
655
  } else {
656
  return 0;
657
  }
658
  }
659
 
660
  /**
661
- * Get the permalink of a page if set
 
 
662
  * @param string $page e.g. job_dashboard, submit_job_form, jobs
663
  * @return string|bool
664
  */
@@ -671,7 +747,9 @@ function job_manager_get_permalink( $page ) {
671
  }
672
 
673
  /**
674
- * Filters the upload dir when $job_manager_upload is true
 
 
675
  * @param array $pathdata
676
  * @return array
677
  */
@@ -698,7 +776,9 @@ function job_manager_upload_dir( $pathdata ) {
698
  add_filter( 'upload_dir', 'job_manager_upload_dir' );
699
 
700
  /**
701
- * Prepare files for upload by standardizing them into an array. This adds support for multiple file upload fields.
 
 
702
  * @param array $file_data
703
  * @return array
704
  */
@@ -728,9 +808,11 @@ function job_manager_prepare_uploaded_files( $file_data ) {
728
  }
729
 
730
  /**
731
- * Upload a file using WordPress file API.
732
- * @param array $file_data Array of $_FILE data to upload.
733
- * @param array $args Optional arguments
 
 
734
  * @return stdClass|WP_Error Object containing file information, or error
735
  */
736
  function job_manager_upload_file( $file, $args = array() ) {
@@ -799,7 +881,9 @@ function job_manager_upload_file( $file, $args = array() ) {
799
  }
800
 
801
  /**
802
- * Allowed Mime types specifically for WPJM.
 
 
803
  * @param string $field Field used.
804
  * @return array Array of allowed mime types
805
  */
@@ -838,7 +922,9 @@ function job_manager_get_allowed_mime_types( $field = '' ){
838
  }
839
 
840
  /**
841
- * Calculate and return the job expiry date
 
 
842
  * @param int $job_id
843
  * @return string
844
  */
@@ -859,7 +945,9 @@ function calculate_job_expiry( $job_id ) {
859
  }
860
 
861
  /**
862
- * Duplicate a listing.
 
 
863
  * @param int $post_id
864
  * @return int 0 on fail or the post ID.
865
  */
@@ -910,7 +998,7 @@ function job_manager_duplicate_listing( $post_id ) {
910
  if ( in_array( $meta_key, apply_filters( 'job_manager_duplicate_listing_ignore_keys', array( '_filled', '_featured', '_job_expires', '_job_duration', '_package_id', '_user_package_id' ) ) ) ) {
911
  continue;
912
  }
913
- update_post_meta( $new_post_id, $meta_key, $meta_value );
914
  }
915
  }
916
 
@@ -919,3 +1007,4 @@ function job_manager_duplicate_listing( $post_id ) {
919
 
920
  return $new_post_id;
921
  }
 
1
  <?php
2
  if ( ! function_exists( 'get_job_listings' ) ) :
3
  /**
4
+ * Queries job listings with certain criteria and returns them.
5
  *
6
+ * @since 1.0.5
7
+ * @param string|array|object $args Arguments used to retrieve job listings.
8
+ * @return array
9
  */
10
  function get_job_listings( $args = array() ) {
11
  global $wpdb, $job_manager_keyword;
24
  'fields' => 'all'
25
  ) );
26
 
27
+ /**
28
+ * Perform actions that need to be done prior to the start of the job listings query.
29
+ *
30
+ * @since 1.26.0
31
+ *
32
+ * @param array $args Arguments used to retrieve job listings.
33
+ */
34
+ do_action( 'get_job_listings_init', $args );
35
+
36
+ if ( false == get_option( 'job_manager_hide_expired', get_option( 'job_manager_hide_expired_content', 1 ) ) ) {
37
  $post_status = array( 'publish', 'expired' );
38
  } else {
39
  $post_status = 'publish';
55
  'fields' => $args['fields']
56
  );
57
 
 
 
 
 
 
58
  if ( $args['posts_per_page'] < 0 ) {
59
  $query_args['no_found_rows'] = true;
60
  }
118
  $job_manager_keyword = sanitize_text_field( $args['search_keywords'] );
119
 
120
  if ( ! empty( $job_manager_keyword ) && strlen( $job_manager_keyword ) >= apply_filters( 'job_manager_get_listings_keyword_length_threshold', 2 ) ) {
121
+ $query_args['s'] = $job_manager_keyword;
122
+ add_filter( 'posts_search', 'get_job_listings_keyword_search' );
123
  }
124
 
125
  $query_args = apply_filters( 'job_manager_get_listings', $query_args, $args );
132
  unset( $query_args['tax_query'] );
133
  }
134
 
135
+ /** This filter is documented in wp-job-manager.php */
136
+ $query_args['lang'] = apply_filters( 'wpjm_lang', null );
 
 
137
 
138
  // Filter args
139
  $query_args = apply_filters( 'get_job_listings_query_args', $query_args, $args );
140
 
141
  // Generate hash
142
+ $to_hash = json_encode( $query_args );
143
  $query_args_hash = 'jm_' . md5( $to_hash ) . WP_Job_Manager_Cache_Helper::get_transient_version( 'get_job_listings' );
144
 
145
  do_action( 'before_get_job_listings', $query_args, $args );
164
 
165
  do_action( 'after_get_job_listings', $query_args, $args );
166
 
167
+ remove_filter( 'posts_search', 'get_job_listings_keyword_search' );
168
 
169
  return $result;
170
  }
172
 
173
  if ( ! function_exists( 'get_job_listings_keyword_search' ) ) :
174
  /**
175
+ * Adds join and where query for keywords.
176
  *
177
+ * @since 1.21.0
178
+ * @since 1.26.0 Moved from the `posts_clauses` filter to the `posts_search` to use WP Query's keyword
179
+ * search for `post_title` and `post_content`.
180
+ * @param string $search
181
+ * @return string
182
  */
183
+ function get_job_listings_keyword_search( $search ) {
184
  global $wpdb, $job_manager_keyword;
185
 
186
+ // Searchable Meta Keys: set to empty to search all meta keys
187
+ $searchable_meta_keys = array(
188
+ '_job_location',
189
+ '_company_name',
190
+ '_application',
191
+ '_company_name',
192
+ '_company_tagline',
193
+ '_company_website',
194
+ '_company_twitter',
195
+ );
196
+
197
+ $searchable_meta_keys = apply_filters( 'job_listing_searchable_meta_keys', $searchable_meta_keys );
198
+
199
+ // Set Search DB Conditions
200
  $conditions = array();
201
+
202
+ // Search Post Meta
203
+ if( apply_filters( 'job_listing_search_post_meta', true ) ) {
204
+
205
+ // Only selected meta keys
206
+ if( $searchable_meta_keys ) {
207
+ $conditions[] = "{$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key IN ( '" . implode( "','", array_map( 'esc_sql', $searchable_meta_keys ) ) . "' ) AND meta_value LIKE '%" . esc_sql( $job_manager_keyword ) . "%' )";
208
+ } else {
209
+ // No meta keys defined, search all post meta value
210
+ $conditions[] = "{$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value LIKE '%" . esc_sql( $job_manager_keyword ) . "%' )";
211
+ }
212
+ }
213
+
214
+ // Search taxonomy
215
  $conditions[] = "{$wpdb->posts}.ID IN ( SELECT object_id FROM {$wpdb->term_relationships} AS tr LEFT JOIN {$wpdb->term_taxonomy} AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id LEFT JOIN {$wpdb->terms} AS t ON tt.term_id = t.term_id WHERE t.name LIKE '%" . esc_sql( $job_manager_keyword ) . "%' )";
216
 
217
+ /**
218
+ * Filters the conditions to use when querying job listings. Resulting array is joined with OR statements.
219
+ *
220
+ * @since 1.26.0
221
+ *
222
+ * @param array $conditions Conditions to join by OR when querying job listings.
223
+ * @param string $job_manager_keyword Search query.
224
+ */
225
+ $conditions = apply_filters( 'job_listing_search_conditions', $conditions, $job_manager_keyword );
226
+ if ( empty( $conditions ) ) {
227
+ return $search;
228
  }
229
 
230
+ $conditions_str = implode( ' OR ', $conditions );
231
 
232
+ if ( ! empty( $search ) ) {
233
+ $search = preg_replace( '/^ AND /', '', $search );
234
+ $search = " AND ( {$search} OR ( {$conditions_str} ) )";
235
+ } else {
236
+ $search = " AND ( {$conditions_str} )";
237
+ }
238
+
239
+ return $search;
240
  }
241
  endif;
242
 
257
 
258
  if ( ! function_exists( 'get_job_listing_post_statuses' ) ) :
259
  /**
260
+ * Gets post statuses used for jobs.
261
  *
262
+ * @since 1.12.0
263
  * @return array
264
  */
265
  function get_job_listing_post_statuses() {
278
  /**
279
  * Gets the ids of featured jobs.
280
  *
281
+ * @since 1.0.4
282
  * @return array
283
  */
284
  function get_featured_job_ids() {
295
 
296
  if ( ! function_exists( 'get_job_listing_types' ) ) :
297
  /**
298
+ * Gets job listing types.
299
  *
300
+ * @since 1.0.0
301
+ * @param string|array $fields
302
  * @return array
303
  */
304
  function get_job_listing_types( $fields = 'all' ) {
324
 
325
  if ( ! function_exists( 'get_job_listing_categories' ) ) :
326
  /**
327
+ * Gets job categories.
328
  *
329
+ * @since 1.0.0
330
  * @return array
331
  */
332
  function get_job_listing_categories() {
345
  if ( ! function_exists( 'job_manager_get_filtered_links' ) ) :
346
  /**
347
  * Shows links after filtering jobs
348
+ *
349
+ * @since 1.0.6
350
+ * @param array $args
351
+ * @return string
352
  */
353
  function job_manager_get_filtered_links( $args = array() ) {
354
  $job_categories = array();
402
  /**
403
  * Get the Job Listing RSS link
404
  *
405
+ * @since 1.0.0
406
+ * @param array $args
407
  * @return string
408
  */
409
  function get_job_listing_rss_link( $args = array() ) {
414
 
415
  if ( ! function_exists( 'wp_job_manager_notify_new_user' ) ) :
416
  /**
417
+ * Handles notification of new users.
418
  *
419
+ * @since 1.23.10
420
+ * @param int $user_id
421
  * @param string $password
422
  */
423
  function wp_job_manager_notify_new_user( $user_id, $password ) {
433
 
434
  if ( ! function_exists( 'job_manager_create_account' ) ) :
435
  /**
436
+ * Handles account creation.
437
  *
438
+ * @since 1.0.0
439
+ * @param string|array|object $args containing username, email, role
440
+ * @param string $deprecated role string
441
+ * @return WP_Error|bool was an account created?
442
  */
443
  function wp_job_manager_create_account( $args, $deprecated = '' ) {
444
  global $current_user;
505
  'user_pass' => $password,
506
  'user_email' => $email,
507
  'role' => $role
508
+ );
509
 
510
+ $user_id = wp_insert_user( apply_filters( 'job_manager_create_account_data', $new_user ) );
511
 
512
+ if ( is_wp_error( $user_id ) ) {
513
+ return $user_id;
514
+ }
515
 
516
+ // Notify
517
+ wp_job_manager_notify_new_user( $user_id, $password, $new_user );
518
+ // Login
519
+ wp_set_auth_cookie( $user_id, true, is_ssl() );
520
+ $current_user = get_user_by( 'id', $user_id );
521
 
522
+ return true;
523
  }
524
  endif;
525
 
526
  /**
527
+ * Checks if an the user can post a job. If accounts are required, and reg is enabled, users can post (they signup at the same time).
528
  *
529
+ * @since 1.5.1
530
  * @return bool
531
  */
532
  function job_manager_user_can_post_job() {
542
  }
543
 
544
  /**
545
+ * Checks if the user can edit a job.
546
  *
547
+ * @since 1.5.1
548
+ * @param int|WP_Post $job_id
549
  * @return bool
550
  */
551
  function job_manager_user_can_edit_job( $job_id ) {
565
  }
566
 
567
  /**
568
+ * Checks if only one type allowed per job.
569
  *
570
+ * @since 1.25.2
571
  * @return bool
572
  */
573
  function job_manager_multi_job_type() {
575
  }
576
 
577
  /**
578
+ * Checks if registration is enabled.
579
  *
580
+ * @since 1.5.1
581
  * @return bool
582
  */
583
  function job_manager_enable_registration() {
585
  }
586
 
587
  /**
588
+ * Checks if usernames are generated from email addresses.
589
  *
590
+ * @since 1.20.0
591
  * @return bool
592
  */
593
  function job_manager_generate_username_from_email() {
595
  }
596
 
597
  /**
598
+ * Checks if an account is required to post a job.
599
  *
600
+ * @since 1.5.1
601
  * @return bool
602
  */
603
  function job_manager_user_requires_account() {
605
  }
606
 
607
  /**
608
+ * Checks if users are allowed to edit submissions that are pending approval.
609
  *
610
+ * @since 1.16.1
611
  * @return bool
612
  */
613
  function job_manager_user_can_edit_pending_submissions() {
615
  }
616
 
617
  /**
618
+ * Displays category select dropdown.
619
+ *
620
  * Based on wp_dropdown_categories, with the exception of supporting multiple selected categories.
621
+ *
622
+ * @since 1.14.0
623
  * @see wp_dropdown_categories
624
+ * @param string|array|object $args
625
+ * @return string
626
  */
627
  function job_manager_dropdown_categories( $args = '' ) {
628
  $defaults = array(
654
  $r['pad_counts'] = true;
655
  }
656
 
657
+ /** This filter is documented in wp-job-manager.php */
658
+ $r['lang'] = apply_filters( 'wpjm_lang', null );
 
 
 
 
659
 
660
  extract( $r );
661
 
709
  }
710
 
711
  /**
712
+ * Gets the page ID of a page if set.
713
+ *
714
+ * @since 1.23.12
715
  * @param string $page e.g. job_dashboard, submit_job_form, jobs
716
  * @return int
717
  */
718
  function job_manager_get_page_id( $page ) {
719
  $page_id = get_option( 'job_manager_' . $page . '_page_id', false );
720
  if ( $page_id ) {
721
+ /**
722
+ * Filters the page ID for a WPJM page.
723
+ *
724
+ * @since 1.26.0
725
+ *
726
+ * @param int $page_id
727
+ */
728
+ return apply_filters( 'wpjm_page_id', $page_id );
729
  } else {
730
  return 0;
731
  }
732
  }
733
 
734
  /**
735
+ * Gets the permalink of a page if set.
736
+ *
737
+ * @since 1.16.0
738
  * @param string $page e.g. job_dashboard, submit_job_form, jobs
739
  * @return string|bool
740
  */
747
  }
748
 
749
  /**
750
+ * Filters the upload dir when $job_manager_upload is true.
751
+ *
752
+ * @since 1.21.0
753
  * @param array $pathdata
754
  * @return array
755
  */
776
  add_filter( 'upload_dir', 'job_manager_upload_dir' );
777
 
778
  /**
779
+ * Prepares files for upload by standardizing them into an array. This adds support for multiple file upload fields.
780
+ *
781
+ * @since 1.21.0
782
  * @param array $file_data
783
  * @return array
784
  */
808
  }
809
 
810
  /**
811
+ * Uploads a file using WordPress file API.
812
+ *
813
+ * @since 1.21.0
814
+ * @param array|WP_Error $file Array of $_FILE data to upload.
815
+ * @param string|array|object $args Optional arguments
816
  * @return stdClass|WP_Error Object containing file information, or error
817
  */
818
  function job_manager_upload_file( $file, $args = array() ) {
881
  }
882
 
883
  /**
884
+ * Returns mime types specifically for WPJM.
885
+ *
886
+ * @since 1.25.1
887
  * @param string $field Field used.
888
  * @return array Array of allowed mime types
889
  */
922
  }
923
 
924
  /**
925
+ * Calculates and returns the job expiry date.
926
+ *
927
+ * @since 1.22.0
928
  * @param int $job_id
929
  * @return string
930
  */
945
  }
946
 
947
  /**
948
+ * Duplicates a listing.
949
+ *
950
+ * @since 1.25.0
951
  * @param int $post_id
952
  * @return int 0 on fail or the post ID.
953
  */
998
  if ( in_array( $meta_key, apply_filters( 'job_manager_duplicate_listing_ignore_keys', array( '_filled', '_featured', '_job_expires', '_job_duration', '_package_id', '_user_package_id' ) ) ) ) {
999
  continue;
1000
  }
1001
+ update_post_meta( $new_post_id, $meta_key, maybe_unserialize( $meta_value ) );
1002
  }
1003
  }
1004
 
1007
 
1008
  return $new_post_id;
1009
  }
1010
+
wp-job-manager-template.php CHANGED
@@ -11,13 +11,13 @@
11
  */
12
 
13
  /**
14
- * Get and include template files.
15
  *
16
- * @param mixed $template_name
17
- * @param array $args (default: array())
 
18
  * @param string $template_path (default: '')
19
  * @param string $default_path (default: '')
20
- * @return void
21
  */
22
  function get_job_manager_template( $template_name, $args = array(), $template_path = 'job_manager', $default_path = '' ) {
23
  if ( $args && is_array( $args ) ) {
@@ -27,7 +27,7 @@ function get_job_manager_template( $template_name, $args = array(), $template_pa
27
  }
28
 
29
  /**
30
- * Locate a template and return the path for inclusion.
31
  *
32
  * This is the load order:
33
  *
@@ -35,8 +35,9 @@ function get_job_manager_template( $template_name, $args = array(), $template_pa
35
  * yourtheme / $template_name
36
  * $default_path / $template_name
37
  *
38
- * @param string $template_name
39
- * @param string $template_path (default: 'job_manager')
 
40
  * @param string|bool $default_path (default: '') False to not load a default
41
  * @return string
42
  */
@@ -62,11 +63,12 @@ function locate_job_manager_template( $template_name, $template_path = 'job_mana
62
  }
63
 
64
  /**
65
- * Get template part (for templates in loops).
66
  *
67
- * @param string $slug
68
- * @param string $name (default: '')
69
- * @param string $template_path (default: 'job_manager')
 
70
  * @param string|bool $default_path (default: '') False to not load a default
71
  */
72
  function get_job_manager_template_part( $slug, $name = '', $template_path = 'job_manager', $default_path = '' ) {
@@ -87,7 +89,9 @@ function get_job_manager_template_part( $slug, $name = '', $template_path = 'job
87
  }
88
 
89
  /**
90
- * Add custom body classes
 
 
91
  * @param array $classes
92
  * @return array
93
  */
@@ -101,8 +105,12 @@ function job_manager_body_class( $classes ) {
101
  add_filter( 'body_class', 'job_manager_body_class' );
102
 
103
  /**
104
- * Get jobs pagination for [jobs] shortcode
105
- * @return [type] [description]
 
 
 
 
106
  */
107
  function get_job_listing_pagination( $max_num_pages, $current_page = 1 ) {
108
  ob_start();
@@ -111,17 +119,20 @@ function get_job_listing_pagination( $max_num_pages, $current_page = 1 ) {
111
  }
112
 
113
  /**
114
- * Outputs the jobs status
115
  *
116
- * @return void
 
117
  */
118
  function the_job_status( $post = null ) {
119
  echo get_the_job_status( $post );
120
  }
121
 
122
  /**
123
- * Gets the jobs status
124
  *
 
 
125
  * @return string
126
  */
127
  function get_the_job_status( $post = null ) {
@@ -139,9 +150,10 @@ function get_the_job_status( $post = null ) {
139
  }
140
 
141
  /**
142
- * Return whether or not the position has been marked as filled
143
  *
144
- * @param object $post
 
145
  * @return boolean
146
  */
147
  function is_position_filled( $post = null ) {
@@ -150,9 +162,10 @@ function is_position_filled( $post = null ) {
150
  }
151
 
152
  /**
153
- * Return whether or not the position has been featured
154
  *
155
- * @param object $post
 
156
  * @return boolean
157
  */
158
  function is_position_featured( $post = null ) {
@@ -161,9 +174,10 @@ function is_position_featured( $post = null ) {
161
  }
162
 
163
  /**
164
- * Return whether or not applications are allowed
165
  *
166
- * @param object $post
 
167
  * @return boolean
168
  */
169
  function candidates_can_apply( $post = null ) {
@@ -172,9 +186,10 @@ function candidates_can_apply( $post = null ) {
172
  }
173
 
174
  /**
175
- * the_job_permalink function.
176
  *
177
- * @access public
 
178
  * @return void
179
  */
180
  function the_job_permalink( $post = null ) {
@@ -182,10 +197,10 @@ function the_job_permalink( $post = null ) {
182
  }
183
 
184
  /**
185
- * get_the_job_permalink function.
186
  *
187
- * @access public
188
- * @param mixed $post (default: null)
189
  * @return string
190
  */
191
  function get_the_job_permalink( $post = null ) {
@@ -196,11 +211,11 @@ function get_the_job_permalink( $post = null ) {
196
  }
197
 
198
  /**
199
- * get_the_job_application_method function.
200
  *
201
- * @access public
202
- * @param mixed $post (default: null)
203
- * @return object
204
  */
205
  function get_the_job_application_method( $post = null ) {
206
  $post = get_post( $post );
@@ -230,10 +245,11 @@ function get_the_job_application_method( $post = null ) {
230
  return apply_filters( 'the_job_application_method', $method, $post );
231
  }
232
  /**
233
- * the_job_type function.
234
  *
235
- * @access public
236
- * @return void
 
237
  */
238
  function the_job_type( $post = null ) {
239
  if ( ! get_option( 'job_manager_enable_types' ) ) {
@@ -245,11 +261,11 @@ function the_job_type( $post = null ) {
245
  }
246
 
247
  /**
248
- * get_the_job_type function.
249
  *
250
- * @access public
251
- * @param mixed $post (default: null)
252
- * @return void
253
  */
254
  function get_the_job_type( $post = null ) {
255
  $post = get_post( $post );
@@ -270,9 +286,10 @@ function get_the_job_type( $post = null ) {
270
 
271
 
272
  /**
273
- * the_job_publish_date function.
274
- * @param mixed $post (default: null)
275
- * @return [type]
 
276
  */
277
  function the_job_publish_date( $post = null ) {
278
  $date_format = get_option( 'job_manager_date_format' );
@@ -288,9 +305,11 @@ function the_job_publish_date( $post = null ) {
288
 
289
 
290
  /**
291
- * get_the_job_publish_date function.
292
- * @param mixed $post (default: null)
293
- * @return [type]
 
 
294
  */
295
  function get_the_job_publish_date( $post = null ) {
296
  $date_format = get_option( 'job_manager_date_format' );
@@ -304,9 +323,11 @@ function get_the_job_publish_date( $post = null ) {
304
 
305
 
306
  /**
307
- * the_job_location function.
308
- * @param boolean $map_link whether or not to link to google maps
309
- * @return [type]
 
 
310
  */
311
  function the_job_location( $map_link = true, $post = null ) {
312
  $location = get_the_job_location( $post );
@@ -324,11 +345,11 @@ function the_job_location( $map_link = true, $post = null ) {
324
  }
325
 
326
  /**
327
- * get_the_job_location function.
328
  *
329
- * @access public
330
- * @param mixed $post (default: null)
331
- * @return void
332
  */
333
  function get_the_job_location( $post = null ) {
334
  $post = get_post( $post );
@@ -340,12 +361,12 @@ function get_the_job_location( $post = null ) {
340
  }
341
 
342
  /**
343
- * the_company_logo function.
344
  *
345
- * @access public
346
- * @param string $size (default: 'full')
347
- * @param mixed $default (default: null)
348
- * @return void
349
  */
350
  function the_company_logo( $size = 'thumbnail', $default = null, $post = null ) {
351
  $logo = get_the_company_logo( $post, $size );
@@ -367,10 +388,11 @@ function the_company_logo( $size = 'thumbnail', $default = null, $post = null )
367
  }
368
 
369
  /**
370
- * get_the_company_logo function.
371
  *
372
- * @access public
373
- * @param mixed $post (default: null)
 
374
  * @return string Image SRC
375
  */
376
  function get_the_company_logo( $post = null, $size = 'thumbnail' ) {
@@ -388,8 +410,9 @@ function get_the_company_logo( $post = null, $size = 'thumbnail' ) {
388
  }
389
 
390
  /**
391
- * Resize and get url of the image
392
  *
 
393
  * @param string $logo
394
  * @param string $size
395
  * @return string
@@ -448,7 +471,10 @@ function job_manager_get_resized_image( $logo, $size ) {
448
  }
449
 
450
  /**
451
- * Output the company video
 
 
 
452
  */
453
  function the_company_video( $post = null ) {
454
  $video_embed = false;
@@ -474,10 +500,11 @@ function the_company_video( $post = null ) {
474
  }
475
 
476
  /**
477
- * Get the company video URL
478
  *
479
- * @param mixed $post (default: null)
480
- * @return string
 
481
  */
482
  function get_the_company_video( $post = null ) {
483
  $post = get_post( $post );
@@ -488,11 +515,15 @@ function get_the_company_video( $post = null ) {
488
  }
489
 
490
  /**
491
- * Display or retrieve the current company name with optional content.
492
  *
493
- * @access public
494
- * @param mixed $id (default: null)
495
- * @return void
 
 
 
 
496
  */
497
  function the_company_name( $before = '', $after = '', $echo = true, $post = null ) {
498
  $company_name = get_the_company_name( $post );
@@ -510,9 +541,9 @@ function the_company_name( $before = '', $after = '', $echo = true, $post = null
510
  }
511
 
512
  /**
513
- * get_the_company_name function.
514
  *
515
- * @access public
516
  * @param int $post (default: null)
517
  * @return string
518
  */
@@ -526,11 +557,11 @@ function get_the_company_name( $post = null ) {
526
  }
527
 
528
  /**
529
- * get_the_company_website function.
530
  *
531
- * @access public
532
  * @param int $post (default: null)
533
- * @return void
534
  */
535
  function get_the_company_website( $post = null ) {
536
  $post = get_post( $post );
@@ -548,11 +579,14 @@ function get_the_company_website( $post = null ) {
548
  }
549
 
550
  /**
551
- * Display or retrieve the current company tagline with optional content.
552
  *
553
- * @access public
554
- * @param mixed $id (default: null)
555
- * @return void
 
 
 
556
  */
557
  function the_company_tagline( $before = '', $after = '', $echo = true, $post = null ) {
558
  $company_tagline = get_the_company_tagline( $post );
@@ -570,11 +604,11 @@ function the_company_tagline( $before = '', $after = '', $echo = true, $post = n
570
  }
571
 
572
  /**
573
- * get_the_company_tagline function.
574
  *
575
- * @access public
576
- * @param int $post (default: 0)
577
- * @return void
578
  */
579
  function get_the_company_tagline( $post = null ) {
580
  $post = get_post( $post );
@@ -586,11 +620,14 @@ function get_the_company_tagline( $post = null ) {
586
  }
587
 
588
  /**
589
- * Display or retrieve the current company twitter link with optional content.
590
  *
591
- * @access public
592
- * @param mixed $id (default: null)
593
- * @return void
 
 
 
594
  */
595
  function the_company_twitter( $before = '', $after = '', $echo = true, $post = null ) {
596
  $company_twitter = get_the_company_twitter( $post );
@@ -608,11 +645,11 @@ function the_company_twitter( $before = '', $after = '', $echo = true, $post = n
608
  }
609
 
610
  /**
611
- * get_the_company_twitter function.
612
  *
613
- * @access public
614
- * @param int $post (default: 0)
615
- * @return void
616
  */
617
  function get_the_company_twitter( $post = null ) {
618
  $post = get_post( $post );
@@ -631,12 +668,11 @@ function get_the_company_twitter( $post = null ) {
631
  }
632
 
633
  /**
634
- * job_listing_class function.
635
  *
636
- * @access public
637
- * @param string $class (default: '')
638
- * @param mixed $post_id (default: null)
639
- * @return void
640
  */
641
  function job_listing_class( $class = '', $post_id = null ) {
642
  // Separates classes with a single space, collates classes for post DIV
@@ -644,9 +680,11 @@ function job_listing_class( $class = '', $post_id = null ) {
644
  }
645
 
646
  /**
647
- * get_job_listing_class function.
648
  *
649
- * @access public
 
 
650
  * @return array
651
  */
652
  function get_job_listing_class( $class = '', $post_id = null ) {
@@ -690,7 +728,9 @@ function get_job_listing_class( $class = '', $post_id = null ) {
690
  }
691
 
692
  /**
693
- * Displays job meta data on the single job page
 
 
694
  */
695
  function job_listing_meta_display() {
696
  get_job_manager_template( 'content-single-job_listing-meta.php', array() );
@@ -698,7 +738,9 @@ function job_listing_meta_display() {
698
  add_action( 'single_job_listing_start', 'job_listing_meta_display', 20 );
699
 
700
  /**
701
- * Displays job company data on the single job page
 
 
702
  */
703
  function job_listing_company_display() {
704
  get_job_manager_template( 'content-single-job_listing-company.php', array() );
11
  */
12
 
13
  /**
14
+ * Gets and includes template files.
15
  *
16
+ * @since 1.0.0
17
+ * @param mixed $template_name
18
+ * @param array $args (default: array())
19
  * @param string $template_path (default: '')
20
  * @param string $default_path (default: '')
 
21
  */
22
  function get_job_manager_template( $template_name, $args = array(), $template_path = 'job_manager', $default_path = '' ) {
23
  if ( $args && is_array( $args ) ) {
27
  }
28
 
29
  /**
30
+ * Locates a template and return the path for inclusion.
31
  *
32
  * This is the load order:
33
  *
35
  * yourtheme / $template_name
36
  * $default_path / $template_name
37
  *
38
+ * @since 1.0.0
39
+ * @param string $template_name
40
+ * @param string $template_path (default: 'job_manager')
41
  * @param string|bool $default_path (default: '') False to not load a default
42
  * @return string
43
  */
63
  }
64
 
65
  /**
66
+ * Gets template part (for templates in loops).
67
  *
68
+ * @since 1.0.0
69
+ * @param string $slug
70
+ * @param string $name (default: '')
71
+ * @param string $template_path (default: 'job_manager')
72
  * @param string|bool $default_path (default: '') False to not load a default
73
  */
74
  function get_job_manager_template_part( $slug, $name = '', $template_path = 'job_manager', $default_path = '' ) {
89
  }
90
 
91
  /**
92
+ * Adds custom body classes.
93
+ *
94
+ * @since 1.16.0
95
  * @param array $classes
96
  * @return array
97
  */
105
  add_filter( 'body_class', 'job_manager_body_class' );
106
 
107
  /**
108
+ * Get jobs pagination for [jobs] shortcode.
109
+ *
110
+ * @since 1.13.0
111
+ * @param int $max_num_pages
112
+ * @param int $current_page
113
+ * @return string
114
  */
115
  function get_job_listing_pagination( $max_num_pages, $current_page = 1 ) {
116
  ob_start();
119
  }
120
 
121
  /**
122
+ * Displays the jobs status.
123
  *
124
+ * @since 1.0.0
125
+ * @param int|WP_Post $post
126
  */
127
  function the_job_status( $post = null ) {
128
  echo get_the_job_status( $post );
129
  }
130
 
131
  /**
132
+ * Gets the jobs status.
133
  *
134
+ * @since 1.
135
+ * @param int|WP_Post $post
136
  * @return string
137
  */
138
  function get_the_job_status( $post = null ) {
150
  }
151
 
152
  /**
153
+ * Checks whether or not the position has been marked as filled.
154
  *
155
+ * @since 1.0.0
156
+ * @param WP_Post|int $post
157
  * @return boolean
158
  */
159
  function is_position_filled( $post = null ) {
162
  }
163
 
164
  /**
165
+ * Checks whether or not the position has been featured.
166
  *
167
+ * @since 1.2.0
168
+ * @param WP_Post|int $post
169
  * @return boolean
170
  */
171
  function is_position_featured( $post = null ) {
174
  }
175
 
176
  /**
177
+ * Checks whether or not applications are allowed.
178
  *
179
+ * @since 1.21.0
180
+ * @param WP_Post|int $post
181
  * @return boolean
182
  */
183
  function candidates_can_apply( $post = null ) {
186
  }
187
 
188
  /**
189
+ * Displays the permalink for the job listing post.
190
  *
191
+ * @since 1.0.0
192
+ * @param int|WP_Post $post (default: null)
193
  * @return void
194
  */
195
  function the_job_permalink( $post = null ) {
197
  }
198
 
199
  /**
200
+ * Gets the permalink for a job listing.
201
  *
202
+ * @since 1.0.0
203
+ * @param int|WP_Post $post (default: null)
204
  * @return string
205
  */
206
  function get_the_job_permalink( $post = null ) {
211
  }
212
 
213
  /**
214
+ * Gets the application method for the job listing.
215
  *
216
+ * @since 1.0.0
217
+ * @param int|WP_Post $post (default: null)
218
+ * @return stdClass|bool|null
219
  */
220
  function get_the_job_application_method( $post = null ) {
221
  $post = get_post( $post );
245
  return apply_filters( 'the_job_application_method', $method, $post );
246
  }
247
  /**
248
+ * Displays the job type for the listing.
249
  *
250
+ * @since 1.0.0
251
+ * @param int|WP_Post $post
252
+ * @return string
253
  */
254
  function the_job_type( $post = null ) {
255
  if ( ! get_option( 'job_manager_enable_types' ) ) {
261
  }
262
 
263
  /**
264
+ * Gets the job type for the listing.
265
  *
266
+ * @since 1.0.0
267
+ * @param int|WP_Post $post (default: null)
268
+ * @return string|bool|null
269
  */
270
  function get_the_job_type( $post = null ) {
271
  $post = get_post( $post );
286
 
287
 
288
  /**
289
+ * Displays the published date of the job listing.
290
+ *
291
+ * @since 1.25.3
292
+ * @param int|WP_Post $post (default: null)
293
  */
294
  function the_job_publish_date( $post = null ) {
295
  $date_format = get_option( 'job_manager_date_format' );
305
 
306
 
307
  /**
308
+ * Gets the published date of the job listing.
309
+ *
310
+ * @since 1.25.3
311
+ * @param int|WP_Post $post (default: null)
312
+ * @return string|int|false
313
  */
314
  function get_the_job_publish_date( $post = null ) {
315
  $date_format = get_option( 'job_manager_date_format' );
323
 
324
 
325
  /**
326
+ * Displays the location for the job listing.
327
+ *
328
+ * @since 1.0.0
329
+ * @param bool $map_link whether or not to link to Google Maps
330
+ * @param int|WP_Post $post
331
  */
332
  function the_job_location( $map_link = true, $post = null ) {
333
  $location = get_the_job_location( $post );
345
  }
346
 
347
  /**
348
+ * Gets the location for the job listing.
349
  *
350
+ * @since 1.0.0
351
+ * @param int|WP_Post $post (default: null)
352
+ * @return string|null
353
  */
354
  function get_the_job_location( $post = null ) {
355
  $post = get_post( $post );
361
  }
362
 
363
  /**
364
+ * Displays the company logo.
365
  *
366
+ * @since 1.0.0
367
+ * @param string $size (default: 'full')
368
+ * @param mixed $default (default: null)
369
+ * @param int|WP_Post $post (default: null)
370
  */
371
  function the_company_logo( $size = 'thumbnail', $default = null, $post = null ) {
372
  $logo = get_the_company_logo( $post, $size );
388
  }
389
 
390
  /**
391
+ * Gets the company logo.
392
  *
393
+ * @since 1.0.0
394
+ * @param int|WP_Post $post (default: null)
395
+ * @param string $size
396
  * @return string Image SRC
397
  */
398
  function get_the_company_logo( $post = null, $size = 'thumbnail' ) {
410
  }
411
 
412
  /**
413
+ * Resizes and returns the url of an image.
414
  *
415
+ * @since 1.5.1
416
  * @param string $logo
417
  * @param string $size
418
  * @return string
471
  }
472
 
473
  /**
474
+ * Displays the company video.
475
+ *
476
+ * @since 1.14.0
477
+ * @param int|WP_Post $post
478
  */
479
  function the_company_video( $post = null ) {
480
  $video_embed = false;
500
  }
501
 
502
  /**
503
+ * Gets the company video URL.
504
  *
505
+ * @since 1.14.0
506
+ * @param int|WP_Post $post (default: null)
507
+ * @return string|null
508
  */
509
  function get_the_company_video( $post = null ) {
510
  $post = get_post( $post );
515
  }
516
 
517
  /**
518
+ * Displays or retrieves the current company name with optional content.
519
  *
520
+ * @since 1.0.0
521
+ * @since 1.0.1 Add the `$post` argument.
522
+ * @param string $before (default: '')
523
+ * @param string $after (default: '')
524
+ * @param bool $echo (default: true)
525
+ * @param int|WP_Post|null $post (default: null)
526
+ * @return string|void
527
  */
528
  function the_company_name( $before = '', $after = '', $echo = true, $post = null ) {
529
  $company_name = get_the_company_name( $post );
541
  }
542
 
543
  /**
544
+ * Gets the company name.
545
  *
546
+ * @since 1.0.0
547
  * @param int $post (default: null)
548
  * @return string
549
  */
557
  }
558
 
559
  /**
560
+ * Gets the company website.
561
  *
562
+ * @since 1.0.0
563
  * @param int $post (default: null)
564
+ * @return null|string
565
  */
566
  function get_the_company_website( $post = null ) {
567
  $post = get_post( $post );
579
  }
580
 
581
  /**
582
+ * Displays or retrieves the current company tagline with optional content.
583
  *
584
+ * @since 1.0.0
585
+ * @param string $before (default: '')
586
+ * @param string $after (default: '')
587
+ * @param bool $echo (default: true)
588
+ * @param int|WP_Post|null $post (default: null)
589
+ * @return string|void
590
  */
591
  function the_company_tagline( $before = '', $after = '', $echo = true, $post = null ) {
592
  $company_tagline = get_the_company_tagline( $post );
604
  }
605
 
606
  /**
607
+ * Gets the company tagline.
608
  *
609
+ * @since 1.0.0
610
+ * @param int|WP_Post|null $post (default: null)
611
+ * @return string|null
612
  */
613
  function get_the_company_tagline( $post = null ) {
614
  $post = get_post( $post );
620
  }
621
 
622
  /**
623
+ * Displays or retrieves the current company Twitter link with optional content.
624
  *
625
+ * @since 1.0.0
626
+ * @param string $before (default: '')
627
+ * @param string $after (default: '')
628
+ * @param bool $echo (default: true)
629
+ * @param int|WP_Post|null $post (default: null)
630
+ * @return string|void
631
  */
632
  function the_company_twitter( $before = '', $after = '', $echo = true, $post = null ) {
633
  $company_twitter = get_the_company_twitter( $post );
645
  }
646
 
647
  /**
648
+ * Gets the company Twitter link.
649
  *
650
+ * @since 1.0.0
651
+ * @param int|WP_Post|null $post (default: null)
652
+ * @return string|null
653
  */
654
  function get_the_company_twitter( $post = null ) {
655
  $post = get_post( $post );
668
  }
669
 
670
  /**
671
+ * Outputs the job listing class.
672
  *
673
+ * @since 1.0.0
674
+ * @param string $class (default: '')
675
+ * @param int|WP_Post $post_id (default: null)
 
676
  */
677
  function job_listing_class( $class = '', $post_id = null ) {
678
  // Separates classes with a single space, collates classes for post DIV
680
  }
681
 
682
  /**
683
+ * Gets the job listing class.
684
  *
685
+ * @since 1.0.0
686
+ * @param string $class
687
+ * @param int|WP_Post $post_id (default: null)
688
  * @return array
689
  */
690
  function get_job_listing_class( $class = '', $post_id = null ) {
728
  }
729
 
730
  /**
731
+ * Displays job meta data on the single job page.
732
+ *
733
+ * @since 1.14.0
734
  */
735
  function job_listing_meta_display() {
736
  get_job_manager_template( 'content-single-job_listing-meta.php', array() );
738
  add_action( 'single_job_listing_start', 'job_listing_meta_display', 20 );
739
 
740
  /**
741
+ * Displays job company data on the single job page.
742
+ *
743
+ * @since 1.14.0
744
  */
745
  function job_listing_company_display() {
746
  get_job_manager_template( 'content-single-job_listing-company.php', array() );
wp-job-manager.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: WP Job Manager
4
  * Plugin URI: https://wpjobmanager.com/
5
  * Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
6
- * Version: 1.25.3
7
  * Author: Automattic
8
  * Author URI: https://wpjobmanager.com/
9
  * Requires at least: 4.1
10
- * Tested up to: 4.7.4
11
  * Text Domain: wp-job-manager
12
  * Domain Path: /languages/
13
  * License: GPL2+
@@ -17,16 +17,43 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  }
18
 
19
  /**
20
- * WP_Job_Manager class.
 
 
 
21
  */
22
  class WP_Job_Manager {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  /**
25
- * Constructor - get the plugin hooked in and ready
26
  */
27
  public function __construct() {
28
  // Define constants
29
- define( 'JOB_MANAGER_VERSION', '1.25.3' );
30
  define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
31
  define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
32
 
@@ -44,9 +71,12 @@ class WP_Job_Manager {
44
  include( 'includes/admin/class-wp-job-manager-admin.php' );
45
  }
46
 
 
 
 
47
  // Init classes
48
- $this->forms = new WP_Job_Manager_Forms();
49
- $this->post_types = new WP_Job_Manager_Post_Types();
50
 
51
  // Activation - works with symlinks
52
  register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array( $this, 'activate' ) );
@@ -65,7 +95,7 @@ class WP_Job_Manager {
65
  }
66
 
67
  /**
68
- * Called on plugin activation
69
  */
70
  public function activate() {
71
  WP_Job_Manager_Ajax::add_endpoint();
@@ -75,7 +105,7 @@ class WP_Job_Manager {
75
  }
76
 
77
  /**
78
- * Handle Updates
79
  */
80
  public function updater() {
81
  if ( version_compare( JOB_MANAGER_VERSION, get_option( 'wp_job_manager_version' ), '>' ) ) {
@@ -85,15 +115,15 @@ class WP_Job_Manager {
85
  }
86
 
87
  /**
88
- * Localisation
89
  */
90
  public function load_plugin_textdomain() {
91
- load_textdomain( 'wp-job-manager', WP_LANG_DIR . "/wp-job-manager/wp-job-manager-" . apply_filters( 'plugin_locale', get_locale(), 'wp-job-manager' ) . ".mo" );
92
  load_plugin_textdomain( 'wp-job-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
93
  }
94
 
95
  /**
96
- * Load functions
97
  */
98
  public function include_template_functions() {
99
  include( 'wp-job-manager-functions.php' );
@@ -101,16 +131,20 @@ class WP_Job_Manager {
101
  }
102
 
103
  /**
104
- * Widgets init
105
  */
106
  public function widgets_init() {
107
- include_once( 'includes/class-wp-job-manager-widgets.php' );
 
 
108
  }
109
 
110
  /**
111
- * Register and enqueue scripts and css
112
  */
113
  public function frontend_scripts() {
 
 
114
  $ajax_url = WP_Job_Manager_Ajax::get_endpoint();
115
  $ajax_filter_deps = array( 'jquery', 'jquery-deserialize' );
116
  $ajax_data = array(
@@ -119,20 +153,26 @@ class WP_Job_Manager {
119
  'i18n_load_prev_listings' => __( 'Load previous listings', 'wp-job-manager' ),
120
  );
121
 
122
- // WPML workaround
123
- if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
124
- $ajax_data['lang'] = apply_filters( 'wpml_current_language', NULL );
125
- }
 
 
 
 
126
 
127
  if ( apply_filters( 'job_manager_chosen_enabled', true ) ) {
128
  wp_register_script( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/js/jquery-chosen/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
129
  wp_register_script( 'wp-job-manager-term-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/term-multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
130
  wp_register_script( 'wp-job-manager-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
131
- wp_enqueue_style( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/css/chosen.css' );
132
  $ajax_filter_deps[] = 'chosen';
133
 
134
  wp_localize_script( 'chosen', 'job_manager_chosen_multiselect_args',
135
- apply_filters( 'job_manager_chosen_multiselect_args', array( 'search_contains' => true ) )
 
 
136
  );
137
  }
138
 
@@ -142,18 +182,26 @@ class WP_Job_Manager {
142
  wp_register_script( 'wp-job-manager-ajax-file-upload', JOB_MANAGER_PLUGIN_URL . '/assets/js/ajax-file-upload.min.js', array( 'jquery', 'jquery-fileupload' ), JOB_MANAGER_VERSION, true );
143
 
144
  ob_start();
145
- get_job_manager_template( 'form-fields/uploaded-file-html.php', array( 'name' => '', 'value' => '', 'extension' => 'jpg' ) );
 
 
 
 
146
  $js_field_html_img = ob_get_clean();
147
 
148
  ob_start();
149
- get_job_manager_template( 'form-fields/uploaded-file-html.php', array( 'name' => '', 'value' => '', 'extension' => 'zip' ) );
 
 
 
 
150
  $js_field_html = ob_get_clean();
151
 
152
  wp_localize_script( 'wp-job-manager-ajax-file-upload', 'job_manager_ajax_file_upload', array(
153
  'ajax_url' => $ajax_url,
154
- 'js_field_html_img' => esc_js( str_replace( "\n", "", $js_field_html_img ) ),
155
- 'js_field_html' => esc_js( str_replace( "\n", "", $js_field_html ) ),
156
- 'i18n_invalid_file_type' => __( 'Invalid file type. Accepted types:', 'wp-job-manager' )
157
  ) );
158
  }
159
 
@@ -164,17 +212,38 @@ class WP_Job_Manager {
164
  wp_register_script( 'wp-job-manager-job-submission', JOB_MANAGER_PLUGIN_URL . '/assets/js/job-submission.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
165
  wp_localize_script( 'wp-job-manager-ajax-filters', 'job_manager_ajax_filters', $ajax_data );
166
  wp_localize_script( 'wp-job-manager-job-dashboard', 'job_manager_job_dashboard', array(
167
- 'i18n_confirm_delete' => __( 'Are you sure you want to delete this listing?', 'wp-job-manager' )
168
  ) );
169
 
170
- wp_enqueue_style( 'wp-job-manager-frontend', JOB_MANAGER_PLUGIN_URL . '/assets/css/frontend.css' );
 
 
 
171
  }
172
  }
173
 
174
- function job_manager_add_post_types( $types, $id ) {
 
 
 
 
 
 
175
  $types[] = 'job_listing';
176
  return $types;
177
  }
178
- add_filter( 'post_types_to_delete_with_user', 'job_manager_add_post_types', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
- $GLOBALS['job_manager'] = new WP_Job_Manager();
3
  * Plugin Name: WP Job Manager
4
  * Plugin URI: https://wpjobmanager.com/
5
  * Description: Manage job listings from the WordPress admin panel, and allow users to post jobs directly to your site.
6
+ * Version: 1.26.0
7
  * Author: Automattic
8
  * Author URI: https://wpjobmanager.com/
9
  * Requires at least: 4.1
10
+ * Tested up to: 4.7
11
  * Text Domain: wp-job-manager
12
  * Domain Path: /languages/
13
  * License: GPL2+
17
  }
18
 
19
  /**
20
+ * Handles core plugin hooks and action setup.
21
+ *
22
+ * @package wp-job-manager
23
+ * @since 1.0.0
24
  */
25
  class WP_Job_Manager {
26
+ /**
27
+ * The single instance of the class.
28
+ *
29
+ * @var self
30
+ * @since 1.26
31
+ */
32
+ private static $_instance = null;
33
+
34
+ /**
35
+ * Main WP Job Manager Instance.
36
+ *
37
+ * Ensures only one instance of WP Job Manager is loaded or can be loaded.
38
+ *
39
+ * @since 1.26
40
+ * @static
41
+ * @see WPJM()
42
+ * @return self Main instance.
43
+ */
44
+ public static function instance() {
45
+ if ( is_null( self::$_instance ) ) {
46
+ self::$_instance = new self();
47
+ }
48
+ return self::$_instance;
49
+ }
50
 
51
  /**
52
+ * Constructor.
53
  */
54
  public function __construct() {
55
  // Define constants
56
+ define( 'JOB_MANAGER_VERSION', '1.26.0' );
57
  define( 'JOB_MANAGER_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
58
  define( 'JOB_MANAGER_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
59
 
71
  include( 'includes/admin/class-wp-job-manager-admin.php' );
72
  }
73
 
74
+ // Load 3rd party customizations
75
+ require_once( 'includes/3rd-party/3rd-party.php' );
76
+
77
  // Init classes
78
+ $this->forms = WP_Job_Manager_Forms::instance();
79
+ $this->post_types = WP_Job_Manager_Post_Types::instance();
80
 
81
  // Activation - works with symlinks
82
  register_activation_hook( basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ), array( $this, 'activate' ) );
95
  }
96
 
97
  /**
98
+ * Performs plugin activation steps.
99
  */
100
  public function activate() {
101
  WP_Job_Manager_Ajax::add_endpoint();
105
  }
106
 
107
  /**
108
+ * Handles tasks after plugin is updated.
109
  */
110
  public function updater() {
111
  if ( version_compare( JOB_MANAGER_VERSION, get_option( 'wp_job_manager_version' ), '>' ) ) {
115
  }
116
 
117
  /**
118
+ * Loads textdomain for plugin.
119
  */
120
  public function load_plugin_textdomain() {
121
+ load_textdomain( 'wp-job-manager', WP_LANG_DIR . '/wp-job-manager/wp-job-manager-' . apply_filters( 'plugin_locale', get_locale(), 'wp-job-manager' ) . '.mo' );
122
  load_plugin_textdomain( 'wp-job-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
123
  }
124
 
125
  /**
126
+ * Loads plugin's core helper functions.
127
  */
128
  public function include_template_functions() {
129
  include( 'wp-job-manager-functions.php' );
131
  }
132
 
133
  /**
134
+ * Loads plugin's widgets.
135
  */
136
  public function widgets_init() {
137
+ include_once( 'includes/class-wp-job-manager-widget.php' );
138
+ include_once( 'includes/widgets/class-wp-job-manager-widget-recent-jobs.php' );
139
+ include_once( 'includes/widgets/class-wp-job-manager-widget-featured-jobs.php' );
140
  }
141
 
142
  /**
143
+ * Registers and enqueues scripts and CSS.
144
  */
145
  public function frontend_scripts() {
146
+ global $post;
147
+
148
  $ajax_url = WP_Job_Manager_Ajax::get_endpoint();
149
  $ajax_filter_deps = array( 'jquery', 'jquery-deserialize' );
150
  $ajax_data = array(
153
  'i18n_load_prev_listings' => __( 'Load previous listings', 'wp-job-manager' ),
154
  );
155
 
156
+ /**
157
+ * Retrieves the current language for use when caching requests.
158
+ *
159
+ * @since 1.26.0
160
+ *
161
+ * @param string|null $lang
162
+ */
163
+ $ajax_data['lang'] = apply_filters( 'wpjm_lang', null );
164
 
165
  if ( apply_filters( 'job_manager_chosen_enabled', true ) ) {
166
  wp_register_script( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/js/jquery-chosen/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
167
  wp_register_script( 'wp-job-manager-term-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/term-multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
168
  wp_register_script( 'wp-job-manager-multiselect', JOB_MANAGER_PLUGIN_URL . '/assets/js/multiselect.min.js', array( 'jquery', 'chosen' ), JOB_MANAGER_VERSION, true );
169
+ wp_enqueue_style( 'chosen', JOB_MANAGER_PLUGIN_URL . '/assets/css/chosen.css', array(), '1.1.0' );
170
  $ajax_filter_deps[] = 'chosen';
171
 
172
  wp_localize_script( 'chosen', 'job_manager_chosen_multiselect_args',
173
+ apply_filters( 'job_manager_chosen_multiselect_args', array(
174
+ 'search_contains' => true,
175
+ ) )
176
  );
177
  }
178
 
182
  wp_register_script( 'wp-job-manager-ajax-file-upload', JOB_MANAGER_PLUGIN_URL . '/assets/js/ajax-file-upload.min.js', array( 'jquery', 'jquery-fileupload' ), JOB_MANAGER_VERSION, true );
183
 
184
  ob_start();
185
+ get_job_manager_template( 'form-fields/uploaded-file-html.php', array(
186
+ 'name' => '',
187
+ 'value' => '',
188
+ 'extension' => 'jpg',
189
+ ) );
190
  $js_field_html_img = ob_get_clean();
191
 
192
  ob_start();
193
+ get_job_manager_template( 'form-fields/uploaded-file-html.php', array(
194
+ 'name' => '',
195
+ 'value' => '',
196
+ 'extension' => 'zip',
197
+ ) );
198
  $js_field_html = ob_get_clean();
199
 
200
  wp_localize_script( 'wp-job-manager-ajax-file-upload', 'job_manager_ajax_file_upload', array(
201
  'ajax_url' => $ajax_url,
202
+ 'js_field_html_img' => esc_js( str_replace( "\n", '', $js_field_html_img ) ),
203
+ 'js_field_html' => esc_js( str_replace( "\n", '', $js_field_html ) ),
204
+ 'i18n_invalid_file_type' => __( 'Invalid file type. Accepted types:', 'wp-job-manager' ),
205
  ) );
206
  }
207
 
212
  wp_register_script( 'wp-job-manager-job-submission', JOB_MANAGER_PLUGIN_URL . '/assets/js/job-submission.min.js', array( 'jquery' ), JOB_MANAGER_VERSION, true );
213
  wp_localize_script( 'wp-job-manager-ajax-filters', 'job_manager_ajax_filters', $ajax_data );
214
  wp_localize_script( 'wp-job-manager-job-dashboard', 'job_manager_job_dashboard', array(
215
+ 'i18n_confirm_delete' => __( 'Are you sure you want to delete this listing?', 'wp-job-manager' ),
216
  ) );
217
 
218
+ wp_enqueue_style( 'wp-job-manager-frontend', JOB_MANAGER_PLUGIN_URL . '/assets/css/frontend.css', array(), JOB_MANAGER_VERSION );
219
+ if ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'submit_job_form' ) ) {
220
+ wp_enqueue_style( 'wp-job-manager-job-submission', JOB_MANAGER_PLUGIN_URL . '/assets/css/job-submission.css', array(), JOB_MANAGER_VERSION );
221
+ }
222
  }
223
  }
224
 
225
+ /**
226
+ * Add post type for Job Manager.
227
+ *
228
+ * @param array $types
229
+ * @return array
230
+ */
231
+ function job_manager_add_post_types( $types ) {
232
  $types[] = 'job_listing';
233
  return $types;
234
  }
235
+ add_filter( 'post_types_to_delete_with_user', 'job_manager_add_post_types', 10 );
236
+
237
+ /**
238
+ * Main instance of WP Job Manager.
239
+ *
240
+ * Returns the main instance of WP Job Manager to prevent the need to use globals.
241
+ *
242
+ * @since 1.26
243
+ * @return WP_Job_Manager
244
+ */
245
+ function WPJM() {
246
+ return WP_Job_Manager::instance();
247
+ }
248
 
249
+ $GLOBALS['job_manager'] = WPJM();