Changeset 9721 for trunk/src/bp-activity/bp-activity-template.php
- Timestamp:
- 04/08/2015 06:03:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r9698 r9721 1754 1754 global $activities_template; 1755 1755 1756 $ args= wp_parse_args( $args, array(1756 $r = wp_parse_args( $args, array( 1757 1757 'no_timestamp' => false, 1758 1758 ) ); 1759 1759 1760 $action = $activities_template->activity->action;1761 1762 1760 /** 1763 1761 * Filters the activity action before the action is inserted as meta. … … 1767 1765 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function. 1768 1766 */ 1769 $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity, $args ) ); 1770 1767 $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( 1768 $activities_template->activity->action, 1769 &$activities_template->activity, 1770 $r 1771 ) ); 1772 1773 // Prepend the activity action meta (link, time since, etc...) 1771 1774 if ( ! empty( $action ) && empty( $r['no_timestamp'] ) ) { 1772 1775 $action = bp_insert_activity_meta( $action ); … … 1780 1783 * @param array $value Array containing the current action, the current activity, and the $args array passed into the function. 1781 1784 */ 1782 return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity, $args ) ); 1785 return apply_filters_ref_array( 'bp_get_activity_action', array( 1786 $action, 1787 &$activities_template->activity, 1788 $r 1789 ) ); 1783 1790 } 1784 1791 … … 1902 1909 * @return string The activity content with the metadata string attached. 1903 1910 */ 1904 function bp_insert_activity_meta( $content ) {1911 function bp_insert_activity_meta( $content = '' ) { 1905 1912 global $activities_template; 1906 1913 1907 1914 // Strip any legacy time since placeholders from BP 1.0-1.1 1908 $content = str_replace( '<span class="time-since">%s</span>', '', $content ); 1915 $new_content = str_replace( '<span class="time-since">%s</span>', '', $content ); 1916 1917 // Get the time since this activity was recorded 1918 $date_recorded = bp_core_time_since( $activities_template->activity->date_recorded ); 1909 1919 1910 1920 /** … … 1915 1925 * @param array $value Array containing the time since markup and the current activity component. 1916 1926 */ 1917 $time_since = apply_filters_ref_array( 'bp_activity_time_since', array( '<span class="time-since">' . bp_core_time_since( $activities_template->activity->date_recorded ) . '</span>', &$activities_template->activity ) ); 1927 $time_since = apply_filters_ref_array( 'bp_activity_time_since', array( 1928 '<span class="time-since">' . $date_recorded . '</span>', 1929 &$activities_template->activity 1930 ) ); 1918 1931 1919 1932 // Insert the permalink 1920 if ( !bp_is_single_activity() ) { 1933 if ( ! bp_is_single_activity() ) { 1934 1935 // Setup variables for activity meta 1936 $activity_permalink = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ); 1937 $activity_meta = sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', 1938 $new_content, 1939 $activity_permalink, 1940 esc_attr__( 'View Discussion', 'buddypress' ), 1941 $time_since 1942 ); 1921 1943 1922 1944 /** … … 1927 1949 * @param array $value Array containing the html markup for the activity permalink, after being parsed by sprintf and current activity component. 1928 1950 */ 1929 $content = apply_filters_ref_array( 'bp_activity_permalink', array( sprintf( '%1$s <a href="%2$s" class="view activity-time-since" title="%3$s">%4$s</a>', $content, bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ), esc_attr__( 'View Discussion', 'buddypress' ), $time_since ), &$activities_template->activity ) ); 1951 $new_content = apply_filters_ref_array( 'bp_activity_permalink', array( 1952 $activity_meta, 1953 &$activities_template->activity 1954 ) ); 1930 1955 } else { 1931 $ content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH );1956 $new_content .= str_pad( $time_since, strlen( $time_since ) + 2, ' ', STR_PAD_BOTH ); 1932 1957 } 1933 1958 … … 1939 1964 * @param string $content Activity content with the activity metadata added. 1940 1965 */ 1941 return apply_filters( 'bp_insert_activity_meta', $ content );1966 return apply_filters( 'bp_insert_activity_meta', $new_content, $content ); 1942 1967 } 1943 1968
Note: See TracChangeset
for help on using the changeset viewer.