Automattic / Automattic/WP-Job-Manager
WP Job Manager - Resume Manager - Translated Resume Posts Show 404 Error
- Dominant language
- PHP
- Stars
- 899
- Forks
- 369
- Avg merge
- 11h 37m
- Merged PRs (30d)
- 12
Description
**Describe the bug**
When using WPML with the Resume Manager add-on of WP Job Manager, translated Resume posts result in a 404 error. This occurs when attempting to view a translated Resume post.
**To Reproduce**
Steps to reproduce the behavior:
1. Install WPML with at least two languages
2. Add a few resumes
3. Translate the Resumes page and Resume posts
4. Visit the Resumes page on the frontend
5. Switch to the secondary language
6. Click on a Resume post
7. You will get a 404 error
**Debug**
The resume slug is translatable and identical to the singular label, so it will take the label translation from the POT file which is 'CV' in Spanish/French for example.
**Workaround**
- Open the .../wp-content/plugins/wp-job-manager-resumes/includes/class-wp-resume-manager-post-types.php file
- Look for line 224
- Replace:
```
$rewrite = [
'slug' => _x( 'resume', 'Resume permalink - resave permalinks after changing this', 'wp-job-manager-resumes' ),
'with_front' => false,
'feeds' => false,
'pages' => false,
];
```
- With:
```
$rewrite = [
'slug' => 'resume',
'with_front' => false,
'feeds' => false,
'pages' => false,
];
```
- Go to "WPML > Settings", make sure that "Translate custom post and taxonomy base slugs (via WPML String Translation)." is selected.
- Scroll down to the "Post Types Translation" section and translate Resumes slugs there.
**Isolating the problem (mark completed items with an [x]):**
- [ ] I have deactivated other plugins and confirmed this bug occurs when only WP Job Manager plugin is active.
- [X] This bug happens with a default WordPress theme active.
- [X] I can reproduce this bug consistently using the steps above.
**WordPress Environment**
- WordPress Version: 6.7.1
- WP Job Manager Version: 2.4.0 + Resume Manager 2.2.0
- PHP Version: 8.1.
- Other important details:
Contributor guide
Research direction
Start in wp-content/plugins/wp-job-manager-resumes/includes/class-wp-resume-manager-post-types.php around line 224, where the Resume rewrite slug is defined. Reproduce the issue with WPML using the listed steps, then verify the chosen permalink behavior for translated Resume posts. Done means translated Resume links load successfully instead of returning 404, with permalink and WPML slug settings behaving as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100