Changeset 8547 for trunk/src/bp-xprofile/bp-xprofile-classes.php
- Timestamp:
- 06/25/2014 01:36:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-classes.php
r8535 r8547 1696 1696 */ 1697 1697 public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {} 1698 1699 /** 1700 * Format Date values for display. 1701 * 1702 * @since BuddyPress (2.1.0) 1703 * 1704 * @param string $field_value The date value, as saved in the database. 1705 * Typically, this is a MySQL-formatted date string (Y-m-d H:i:s). 1706 * @return string Date formatted by bp_format_time(). 1707 */ 1708 public static function display_filter( $field_value ) { 1709 // If Unix timestamp 1710 if ( is_numeric( $field_value ) ) { 1711 $field_value = bp_format_time( $field_value, true, false ); 1712 1713 // If MySQL timestamp 1714 } else { 1715 $field_value = bp_format_time( strtotime( $field_value ), true, false ); 1716 } 1717 1718 return $field_value; 1719 } 1698 1720 } 1699 1721 … … 2852 2874 } 2853 2875 2876 /** 2877 * Allow field types to modify the appearance of their values. 2878 * 2879 * By default, this is a pass-through method that does nothing. Only 2880 * override in your own field type if you need to provide custom 2881 * filtering for output values. 2882 * 2883 * @since BuddyPress (2.1.0) 2884 * 2885 * @param mixed $field_value Field value. 2886 * @return mixed 2887 */ 2888 public static function display_filter( $field_value ) { 2889 return $field_value; 2890 } 2854 2891 2855 2892 /**
Note: See TracChangeset
for help on using the changeset viewer.