Single => Singular

This commit is contained in:
Brian Miyaji
2017-01-08 18:12:27 +11:00
parent 2dabeef64d
commit b61d2e1cc8
6 changed files with 13 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
}
// Post Meta
$single = get_post_meta( $post->ID, 'sp_single', true );
$singular = get_post_meta( $post->ID, 'sp_singular', true );
$section = get_post_meta( $post->ID, 'sp_section', true );
if ( '' === $section ) {
$section = -1;
@@ -54,9 +54,9 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
<input name="sp_default_key" type="hidden" id="sp_default_key" value="<?php echo $post->post_name; ?>">
<input name="sp_key" type="text" id="sp_key" value="<?php echo $post->post_name; ?>"<?php if ( $readonly ) { ?> readonly="readonly"<?php } ?>>
</p>
<p><strong><?php _e( 'Single', 'sportspress' ); ?></strong></p>
<p><strong><?php _e( 'Singular', 'sportspress' ); ?></strong></p>
<p>
<input name="sp_single" type="text" id="sp_single" placeholder="<?php echo $post->post_title; ?>" value="<?php echo $single; ?>">
<input name="sp_singular" type="text" id="sp_singular" placeholder="<?php echo $post->post_title; ?>" value="<?php echo $singular; ?>">
</p>
<p><strong><?php _e( 'Category', 'sportspress' ); ?></strong></p>
<p class="sp-section-selector">
@@ -140,7 +140,7 @@ class SP_Meta_Box_Performance_Details extends SP_Meta_Box_Config {
*/
public static function save( $post_id, $post ) {
self::delete_duplicate( $_POST );
update_post_meta( $post_id, 'sp_single', sp_array_value( $_POST, 'sp_single', '' ) );
update_post_meta( $post_id, 'sp_singular', sp_array_value( $_POST, 'sp_singular', '' ) );
update_post_meta( $post_id, 'sp_section', (int) sp_array_value( $_POST, 'sp_section', -1 ) );
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'number' ) );
update_post_meta( $post_id, 'sp_precision', sp_array_value( $_POST, 'sp_precision', 0 ) );

View File

@@ -364,7 +364,7 @@ class SP_Event extends SP_Custom_Post{
$icon = '';
if ( has_post_thumbnail( $post->ID ) ) {
$icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_single_name( $post->ID ) ) );
$icon = get_the_post_thumbnail( $post->ID, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $post->ID ) ) );
}
$performance_icons[ $post->post_name ] = apply_filters( 'sportspress_event_performance_icons', $icon, $post->ID, 1 );
}

View File

@@ -163,10 +163,10 @@ function sp_get_performance( $post = 0 ) {
return $event->performance();
}
function sp_get_single_name( $post = 0 ) {
$single = get_post_meta( $post, 'sp_single', true );
if ( '' !== $single ) {
return $single;
function sp_get_singular_name( $post = 0 ) {
$singular = get_post_meta( $post, 'sp_singular', true );
if ( '' !== $singular ) {
return $singular;
} else {
return get_the_title( $post );
}