Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active December 2, 2019 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/da6525f1fb0f188dff9d7643d8943427 to your computer and use it in GitHub Desktop.
Save tripflex/da6525f1fb0f188dff9d7643d8943427 to your computer and use it in GitHub Desktop.
Set max slug characters for custom permalink handling when using WP Job Manager Visibility
<?php
add_filter( 'job_manager_visibility_job_permalink_max_slug_chars', 'smyles_set_max_permalink_characters', 10, 4 );
add_filter( 'job_manager_visibility_admin_job_permalink_max_slug_chars', 'smyles_set_max_permalink_characters', 10, 4 );
add_filter( 'job_manager_visibility_resume_permalink_max_slug_chars', 'smyles_set_max_permalink_characters', 10, 4 );
add_filter( 'job_manager_visibility_admin_resume_permalink_max_slug_chars', 'smyles_set_max_permalink_characters', 10, 4 );
function smyles_set_max_permalink_characters( $max, $meta_key, $field_value, $structure ){
return 100;
}
@tripflex
Copy link
Author

tripflex commented Dec 2, 2019

Max slug characters is based on each "variable" in your permalink structure. This isn't for the entire permalink, but max slug characters for each dynamic slug value of the permalink. For example, if you have {job_title}-{job_location} it will limit the max characters for each value (not the entire permalink)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment