Add text options for age and birthday

This commit is contained in:
Brian Miyaji
2016-06-10 11:57:06 +10:00
parent 803716d68e
commit eccd77bcb1
3 changed files with 17 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
Description: Add birthdays to players and staff. Description: Add birthdays to players and staff.
Author: ThemeBoy Author: ThemeBoy
Author URI: http://themeboy.com/ Author URI: http://themeboy.com/
Version: 1.9.19 Version: 2.0.8
*/ */
// Exit if accessed directly // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Birthdays' ) ) :
* Main SportsPress Birthdays Class * Main SportsPress Birthdays Class
* *
* @class SportsPress_Birthdays * @class SportsPress_Birthdays
* @version 1.9.19 * @version 2.0.8
*/ */
class SportsPress_Birthdays { class SportsPress_Birthdays {
@@ -29,6 +29,7 @@ class SportsPress_Birthdays {
$this->define_constants(); $this->define_constants();
add_filter( 'gettext', array( $this, 'gettext' ), 20, 3 ); add_filter( 'gettext', array( $this, 'gettext' ), 20, 3 );
add_filter( 'sportspress_text', array( $this, 'add_text_options' ) );
add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) ); add_filter( 'sportspress_player_options', array( $this, 'add_player_options' ) );
add_filter( 'sportspress_staff_options', array( $this, 'add_staff_options' ) ); add_filter( 'sportspress_staff_options', array( $this, 'add_staff_options' ) );
add_filter( 'sportspress_player_details', array( $this, 'add_player_details' ), 20, 2 ); add_filter( 'sportspress_player_details', array( $this, 'add_player_details' ), 20, 2 );
@@ -42,7 +43,7 @@ class SportsPress_Birthdays {
*/ */
private function define_constants() { private function define_constants() {
if ( !defined( 'SP_BIRTHDAYS_VERSION' ) ) if ( !defined( 'SP_BIRTHDAYS_VERSION' ) )
define( 'SP_BIRTHDAYS_VERSION', '1.9.19' ); define( 'SP_BIRTHDAYS_VERSION', '2.0.8' );
if ( !defined( 'SP_BIRTHDAYS_URL' ) ) if ( !defined( 'SP_BIRTHDAYS_URL' ) )
define( 'SP_BIRTHDAYS_URL', plugin_dir_url( __FILE__ ) ); define( 'SP_BIRTHDAYS_URL', plugin_dir_url( __FILE__ ) );
@@ -80,6 +81,16 @@ class SportsPress_Birthdays {
return $translated_text; return $translated_text;
} }
/**
* Add text options
*/
public function add_text_options( $options = array() ) {
return array_merge( $options, array(
__( 'Age', 'sportspress' ),
__( 'Birthday', 'sportspress' ),
) );
}
/** /**
* Add options to player settings page. * Add options to player settings page.
* *

View File

@@ -241,6 +241,7 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
= 2.0.8 = = 2.0.8 =
* Feature - Add shortcode parameter to filter event calendars by player. * Feature - Add shortcode parameter to filter event calendars by player.
* Feature - Add text options to change age and birthday labels.
= 2.0.7 = = 2.0.7 =
* Feature - Add option to show or hide logos or photos in event blocks. * Feature - Add option to show or hide logos or photos in event blocks.

View File

@@ -1,7 +1,9 @@
<wpml-config> <wpml-config>
<admin-texts> <admin-texts>
<key name="sportspress_text"> <key name="sportspress_text">
<key name="Age"/>
<key name="Article"/> <key name="Article"/>
<key name="Birthday"/>
<key name="Box Score"/> <key name="Box Score"/>
<key name="Competition"/> <key name="Competition"/>
<key name="Current Team"/> <key name="Current Team"/>