Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP Job Manager - Resume Manager - Translated Resume Posts Show 404 Error #2869

Open
2 of 3 tasks
nicolasviallet opened this issue Jan 17, 2025 · 0 comments
Open
2 of 3 tasks

Comments

@nicolasviallet
Copy link

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.
  • This bug happens with a default WordPress theme active.
  • 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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant