Last active
December 2, 2019 19:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)