modify label function names

This commit is contained in:
Takumi
2013-07-30 20:20:49 +10:00
parent e3f2e521cc
commit 156afd5e79
12 changed files with 18 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
function sp_event_cpt_init() { function sp_event_cpt_init() {
$name = __( 'Events', 'sportspress' ); $name = __( 'Events', 'sportspress' );
$singular_name = __( 'Event', 'sportspress' ); $singular_name = __( 'Event', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,
@@ -81,9 +81,7 @@ function sp_event_stats_meta( $post ) {
$data = sp_array_combine( $players, sp_array_value( $stats, $value, array() ) ); $data = sp_array_combine( $players, sp_array_value( $stats, $value, array() ) );
?> ?>
<div> <div>
<p> <p><strong><?php echo $value ? get_the_title( $value ) : sprintf( __( 'Select %s' ), 'Team' ); ?></strong></p>
<strong><?php echo $value ? get_the_title( $value ) : sprintf( __( 'Select %s' ), 'Team' ); ?></strong>
</p>
<?php sp_data_table( $data, $value, array( 'Player', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ), true, false ); ?> <?php sp_data_table( $data, $value, array( 'Player', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ), true, false ); ?>
</div> </div>
<?php <?php

View File

@@ -55,8 +55,8 @@ if ( !function_exists( 'sp_array_combine' ) ) {
} }
} }
if ( !function_exists( 'sp_get_cpt_labels' ) ) { if ( !function_exists( 'sp_cpt_labels' ) ) {
function sp_get_cpt_labels( $name, $singular_name ) { function sp_cpt_labels( $name, $singular_name ) {
$labels = array( $labels = array(
'name' => $name, 'name' => $name,
'singular_name' => $singular_name, 'singular_name' => $singular_name,
@@ -74,8 +74,8 @@ if ( !function_exists( 'sp_get_cpt_labels' ) ) {
} }
} }
if ( !function_exists( 'sp_get_tax_labels' ) ) { if ( !function_exists( 'sp_tax_labels' ) ) {
function sp_get_tax_labels( $name, $singular_name ) { function sp_tax_labels( $name, $singular_name ) {
$labels = array( $labels = array(
'name' => $name, 'name' => $name,
'singular_name' => $singular_name, 'singular_name' => $singular_name,

View File

@@ -3,7 +3,7 @@ function sp_league_tax_init() {
$name = __( 'Leagues', 'sportspress' ); $name = __( 'Leagues', 'sportspress' );
$singular_name = __( 'League', 'sportspress' ); $singular_name = __( 'League', 'sportspress' );
$object_type = array( 'sp_team', 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' ); $object_type = array( 'sp_team', 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' );
$labels = sp_get_tax_labels( $name, $singular_name ); $labels = sp_tax_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_list_cpt_init() { function sp_list_cpt_init() {
$name = __( 'Player Lists', 'sportspress' ); $name = __( 'Player Lists', 'sportspress' );
$singular_name = __( 'Player List', 'sportspress' ); $singular_name = __( 'Player List', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_player_cpt_init() { function sp_player_cpt_init() {
$name = __( 'Players', 'sportspress' ); $name = __( 'Players', 'sportspress' );
$singular_name = __( 'Player', 'sportspress' ); $singular_name = __( 'Player', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,
@@ -41,12 +41,8 @@ function sp_player_stats_meta( $post ) {
$data = sp_array_combine( $teams, sp_array_value( $stats, $league->term_id, array() ) ); $data = sp_array_combine( $teams, sp_array_value( $stats, $league->term_id, array() ) );
?> ?>
<div> <div>
<p> <p><strong><?php echo $league->name; ?></strong></p>
<strong><?php echo $league->name; ?></strong> <?php sp_data_table( $data, $league->term_id, array( 'Team', 'Played', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ) ); ?>
</p>
<?php
sp_data_table( $data, $league->term_id, array( 'Team', 'Played', 'Goals', 'Assists', 'Yellow Cards', 'Red Cards' ) );
?>
</div> </div>
<?php <?php
endforeach; endforeach;

View File

@@ -3,7 +3,7 @@ function sp_position_tax_init() {
$name = __( 'Positions', 'sportspress' ); $name = __( 'Positions', 'sportspress' );
$singular_name = __( 'Position', 'sportspress' ); $singular_name = __( 'Position', 'sportspress' );
$object_type = array( 'sp_player', 'sp_staff' ); $object_type = array( 'sp_player', 'sp_staff' );
$labels = sp_get_tax_labels( $name, $singular_name ); $labels = sp_tax_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -3,7 +3,7 @@ function sp_sponsor_tax_init() {
$name = __( 'Sponsors', 'sportspress' ); $name = __( 'Sponsors', 'sportspress' );
$singular_name = __( 'Sponsor', 'sportspress' ); $singular_name = __( 'Sponsor', 'sportspress' );
$object_type = array( 'sp_team', 'sp_event', 'sp_player', 'sp_tournament', 'sp_venue' ); $object_type = array( 'sp_team', 'sp_event', 'sp_player', 'sp_tournament', 'sp_venue' );
$labels = sp_get_tax_labels( $name, $singular_name ); $labels = sp_tax_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_staff_cpt_init() { function sp_staff_cpt_init() {
$name = __( 'Staff', 'sportspress' ); $name = __( 'Staff', 'sportspress' );
$singular_name = __( 'Staff', 'sportspress' ); $singular_name = __( 'Staff', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_table_cpt_init() { function sp_table_cpt_init() {
$name = __( 'League Tables', 'sportspress' ); $name = __( 'League Tables', 'sportspress' );
$singular_name = __( 'League Table', 'sportspress' ); $singular_name = __( 'League Table', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_team_cpt_init() { function sp_team_cpt_init() {
$name = __( 'Teams', 'sportspress' ); $name = __( 'Teams', 'sportspress' );
$singular_name = __( 'Team', 'sportspress' ); $singular_name = __( 'Team', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_tournament_cpt_init() { function sp_tournament_cpt_init() {
$name = __( 'Tournaments', 'sportspress' ); $name = __( 'Tournaments', 'sportspress' );
$singular_name = __( 'Tournament', 'sportspress' ); $singular_name = __( 'Tournament', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,

View File

@@ -2,7 +2,7 @@
function sp_venue_cpt_init() { function sp_venue_cpt_init() {
$name = __( 'Venues', 'sportspress' ); $name = __( 'Venues', 'sportspress' );
$singular_name = __( 'Venue', 'sportspress' ); $singular_name = __( 'Venue', 'sportspress' );
$labels = sp_get_cpt_labels( $name, $singular_name ); $labels = sp_cpt_labels( $name, $singular_name );
$args = array( $args = array(
'label' => $name, 'label' => $name,
'labels' => $labels, 'labels' => $labels,