Forked from vovadocent/Post_type_archieve_edit_permalink.php
Created
August 15, 2024 23:26
-
-
Save dgoze/d49506b0838f40da434ae647ff572e25 to your computer and use it in GitHub Desktop.
Post type archieve edit permalink
This file contains hidden or 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( 'post_type_archive_link', 'fix_post_type_archive_link', 10, 2 ); | |
function fix_post_type_archive_link( $link, $post_type ) { | |
if($post_type == 'scripts'){ | |
$link = str_replace('/%some-slug%', '', $link); | |
} | |
return $link; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment