From 6213a580e9671f16e00c5fb67cc770dd17d4723b Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 28 Oct 2016 10:20:18 +1100 Subject: [PATCH] Remove filter that affects scheduled event permalinks --- includes/sp-template-hooks.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/includes/sp-template-hooks.php b/includes/sp-template-hooks.php index 5ebadea7..7ad5aeb2 100644 --- a/includes/sp-template-hooks.php +++ b/includes/sp-template-hooks.php @@ -280,20 +280,6 @@ function sportspress_show_future_posts( $where, $that ) { } add_filter( 'posts_where', 'sportspress_show_future_posts', 2, 10 ); -function sportspress_fix_future_posts_permalink( $post_link, $post = null ) { - if ( is_admin() ) return $post_link; - if ( ! $post ) return $post_link; - if ( 'sp_event' !== get_post_type( $post ) ) return $post_link; - if ( 'future' !== $post->post_status ) return $post_link; - - $post_type = get_post_type_object( 'sp_event' ); - $slug = sp_array_value( $post_type->rewrite, 'slug', 'event' ); - $post_link = home_url( user_trailingslashit( '/' . $slug . '/' . $post->post_name ) ); - - return $post_link; -} -add_filter( 'post_type_link', 'sportspress_fix_future_posts_permalink', 10, 2 ); - function sportspress_sanitize_title( $title ) { if ( isset( $_POST ) && array_key_exists( 'taxonomy', $_POST ) ):