Fix up presets

This commit is contained in:
Brian Miyaji
2014-01-04 22:29:59 +11:00
parent 997226195d
commit 23ccb653a6
24 changed files with 469 additions and 486 deletions

View File

@@ -61,24 +61,7 @@ function sp_sanitize_title( $title ) {
if ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && in_array( $_POST['post_type'], array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_statistic' ) ) ):
// Get post title
$title = $_POST['post_title'];
// String to lowercase
$title = strtolower( $title );
// Replace all numbers with words
$title = sp_numbers_to_words( $title );
// Remove all other non-alphabet characters
$title = preg_replace( "/[^a-z]/", '', $title );
// Convert post ID to words if title is empty
if ( $title == '' ):
$title = sp_numbers_to_words( $_POST['ID'] );
endif;
$title = sp_get_eos_safe_slug( $_POST['post_title'], $_POST['ID'] );
elseif ( isset( $_POST ) && array_key_exists( 'post_type', $_POST ) && $_POST['post_type'] == 'sp_event' ):