Fix bug to sanitize variable type post slugs

This commit is contained in:
ThemeBoy
2013-12-01 17:43:39 +11:00
parent 8afe065696
commit cce1586c75

View File

@@ -45,7 +45,7 @@ add_filter('the_content', 'sportspress_the_content');
function sp_sanitize_title( $title ) {
if ( isset( $_POST ) && in_array( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_stat', 'sp_metric' ) ) ):
if ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_stat', 'sp_metric' ) ) ):
// Get post title
$title = $_POST['post_title'];