Changeset 8408
- Timestamp:
- 05/10/2014 01:37:05 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
src/bp-blogs/bp-blogs-template.php (modified) (1 diff)
-
src/bp-languages/buddypress.pot (modified) (13 diffs)
-
tests/phpunit/testcases/blogs/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-template.php
r8407 r8408 672 672 /** 673 673 * Output the latest post from the current blog in the loop. 674 */ 675 function bp_blog_latest_post() { 676 echo bp_get_blog_latest_post(); 674 * 675 * @param array $args See {@link bp_get_blog_latest_post()}. 676 */ 677 function bp_blog_latest_post( $args = array() ) { 678 echo bp_get_blog_latest_post( $args ); 677 679 } 678 680 /** 679 681 * Return the latest post from the current blog in the loop. 680 682 * 683 * @param array $args { 684 * Array of optional arguments. 685 * @type bool $latest_format If true, formatted "Latest post: 686 * [link to post]". If false, formatted "[link to post]". 687 * Default: true. 688 * } 681 689 * @return string $retval String of the form 'Latest Post: [link to post]'. 682 690 */ 683 function bp_get_blog_latest_post( ) {691 function bp_get_blog_latest_post( $args = array() ) { 684 692 global $blogs_template; 685 693 694 $r = wp_parse_args( $args, array( 695 'latest_format' => true, 696 ) ); 697 686 698 $retval = bp_get_blog_latest_post_title(); 687 699 688 if ( ! empty( $retval ) ) 689 $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); 700 if ( ! empty( $retval ) ) { 701 if ( ! empty( $r['latest_format'] ) ) { 702 $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); 703 } else { 704 $retval = '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>'; 705 } 706 } 690 707 691 708 return apply_filters( 'bp_get_blog_latest_post', $retval ); -
trunk/src/bp-languages/buddypress.pot
r8404 r8408 5 5 "Project-Id-Version: BuddyPress 2.1-alpha\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/buddypress\n" 7 "POT-Creation-Date: 2014-05-10 0 0:44:57+00:00\n"7 "POT-Creation-Date: 2014-05-10 01:35:41+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" … … 784 784 msgstr "" 785 785 786 #: bp-activity/bp-activity-screens.php:271 bp-blogs/bp-blogs-template.php: 997786 #: bp-activity/bp-activity-screens.php:271 bp-blogs/bp-blogs-template.php:1035 787 787 #: bp-friends/bp-friends-screens.php:86 bp-groups/bp-groups-screens.php:937 788 788 #: bp-messages/bp-messages-screens.php:169 … … 792 792 msgstr "" 793 793 794 #: bp-activity/bp-activity-screens.php:272 bp-blogs/bp-blogs-template.php:10 01794 #: bp-activity/bp-activity-screens.php:272 bp-blogs/bp-blogs-template.php:1039 795 795 #: bp-friends/bp-friends-screens.php:87 bp-groups/bp-groups-screens.php:938 796 796 #: bp-messages/bp-messages-screens.php:170 … … 960 960 961 961 #: bp-blogs/bp-blogs-loader.php:208 bp-blogs/bp-blogs-screens.php:204 962 #: bp-blogs/bp-blogs-template.php:11 14 bp-blogs/bp-blogs-template.php:1182963 #: bp-blogs/bp-blogs-template.php:1 183bp-core/bp-core-filters.php:466962 #: bp-blogs/bp-blogs-template.php:1152 bp-blogs/bp-blogs-template.php:1220 963 #: bp-blogs/bp-blogs-template.php:1221 bp-core/bp-core-filters.php:466 964 964 #: bp-themes/bp-default/blogs/create.php:21 965 965 #: bp-themes/bp-default/blogs/index.php:21 … … 977 977 msgstr "" 978 978 979 #: bp-blogs/bp-blogs-template.php:6 48bp-core/bp-core-classes.php:816979 #: bp-blogs/bp-blogs-template.php:661 bp-core/bp-core-classes.php:816 980 980 #: bp-groups/bp-groups-template.php:3394 bp-groups/bp-groups-widgets.php:85 981 981 #: bp-groups/bp-groups-widgets.php:197 bp-members/bp-members-template.php:811 … … 988 988 msgstr "" 989 989 990 #: bp-blogs/bp-blogs-template.php:668 990 #: bp-blogs/bp-blogs-template.php:666 bp-members/bp-members-template.php:816 991 msgid "Never active" 992 msgstr "" 993 994 #: bp-blogs/bp-blogs-template.php:702 991 995 msgid "Latest Post: %s" 992 996 msgstr "" 993 997 994 #: bp-blogs/bp-blogs-template.php:9 15998 #: bp-blogs/bp-blogs-template.php:953 995 999 msgid "There was a problem, please correct the form below and try again." 996 1000 msgstr "" 997 1001 998 #: bp-blogs/bp-blogs-template.php:9 181002 #: bp-blogs/bp-blogs-template.php:956 999 1003 msgid "" 1000 1004 "By filling out the form below, you can <strong>add a site to your " … … 1003 1007 msgstr "" 1004 1008 1005 #: bp-blogs/bp-blogs-template.php:9 201009 #: bp-blogs/bp-blogs-template.php:958 1006 1010 msgid "" 1007 1011 "If you’re not going to use a great domain, leave it for a new user. " … … 1009 1013 msgstr "" 1010 1014 1011 #: bp-blogs/bp-blogs-template.php:9 291015 #: bp-blogs/bp-blogs-template.php:967 1012 1016 msgid "Create Site" 1013 1017 msgstr "" 1014 1018 1015 #: bp-blogs/bp-blogs-template.php:9 511019 #: bp-blogs/bp-blogs-template.php:989 1016 1020 msgid "Site Name:" 1017 1021 msgstr "" 1018 1022 1019 #: bp-blogs/bp-blogs-template.php:9 531023 #: bp-blogs/bp-blogs-template.php:991 1020 1024 msgid "Site Domain:" 1021 1025 msgstr "" 1022 1026 1023 #: bp-blogs/bp-blogs-template.php: 9671027 #: bp-blogs/bp-blogs-template.php:1005 1024 1028 msgid "Your address will be " 1025 1029 msgstr "" 1026 1030 1027 #: bp-blogs/bp-blogs-template.php: 9701031 #: bp-blogs/bp-blogs-template.php:1008 1028 1032 msgid "blogname" 1029 1033 msgstr "" 1030 1034 1031 #: bp-blogs/bp-blogs-template.php: 9721035 #: bp-blogs/bp-blogs-template.php:1010 1032 1036 msgid "domain." 1033 1037 msgstr "" 1034 1038 1035 #: bp-blogs/bp-blogs-template.php: 9751039 #: bp-blogs/bp-blogs-template.php:1013 1036 1040 msgid "" 1037 1041 "Must be at least 4 characters, letters and numbers only. It cannot be " … … 1039 1043 msgstr "" 1040 1044 1041 #: bp-blogs/bp-blogs-template.php: 9811045 #: bp-blogs/bp-blogs-template.php:1019 1042 1046 msgid "Site Title:" 1043 1047 msgstr "" 1044 1048 1045 #: bp-blogs/bp-blogs-template.php: 9921049 #: bp-blogs/bp-blogs-template.php:1030 1046 1050 msgid "Privacy:" 1047 1051 msgstr "" 1048 1052 1049 #: bp-blogs/bp-blogs-template.php: 9931053 #: bp-blogs/bp-blogs-template.php:1031 1050 1054 #: bp-templates/bp-legacy/buddypress/members/register.php:145 1051 1055 #: bp-themes/bp-default/registration/register.php:229 … … 1055 1059 msgstr "" 1056 1060 1057 #: bp-blogs/bp-blogs-template.php:11 001061 #: bp-blogs/bp-blogs-template.php:1138 1058 1062 msgid "Congratulations! You have successfully registered a new site." 1059 1063 msgstr "" 1060 1064 1061 #: bp-blogs/bp-blogs-template.php:11 021065 #: bp-blogs/bp-blogs-template.php:1140 1062 1066 msgid "" 1063 1067 "<a href=\"%1$s\">%2$s</a> is your new site. <a href=\"%3$s\">Login</a> as " … … 1065 1069 msgstr "" 1066 1070 1067 #: bp-blogs/bp-blogs-template.php:11 311071 #: bp-blogs/bp-blogs-template.php:1169 1068 1072 msgid "%s's Sites" 1069 1073 msgstr "" 1070 1074 1071 #: bp-blogs/bp-blogs-template.php:11 321075 #: bp-blogs/bp-blogs-template.php:1170 1072 1076 msgid "%s's Recent Posts" 1073 1077 msgstr "" 1074 1078 1075 #: bp-blogs/bp-blogs-template.php:11 331079 #: bp-blogs/bp-blogs-template.php:1171 1076 1080 msgid "%s's Recent Comments" 1077 1081 msgstr "" 1078 1082 1079 #: bp-blogs/bp-blogs-template.php:11 49bp-core/deprecated/1.5.php:4171083 #: bp-blogs/bp-blogs-template.php:1187 bp-core/deprecated/1.5.php:417 1080 1084 #: bp-forums/bp-forums-template.php:2196 bp-groups/bp-groups-template.php:2798 1081 1085 #: bp-members/bp-members-template.php:999 … … 1085 1089 msgstr "" 1086 1090 1087 #: bp-blogs/bp-blogs-template.php:12 32 bp-blogs/bp-blogs-template.php:12331091 #: bp-blogs/bp-blogs-template.php:1270 bp-blogs/bp-blogs-template.php:1271 1088 1092 msgid "Visit Site" 1089 1093 msgstr "" 1090 1094 1091 #: bp-blogs/bp-blogs-template.php:1 2881095 #: bp-blogs/bp-blogs-template.php:1326 1092 1096 msgid "%s site" 1093 1097 msgid_plural "%s sites" … … 4634 4638 msgstr[0] "" 4635 4639 msgstr[1] "" 4636 4637 #: bp-members/bp-members-template.php:8164638 msgid "Never active"4639 msgstr ""4640 4640 4641 4641 #: bp-members/bp-members-template.php:1693 -
trunk/tests/phpunit/testcases/blogs/template.php
r8407 r8408 62 62 $this->assertEquals( __( 'Never active', 'buddypress' ), bp_get_blog_last_active() ); 63 63 } 64 65 /** 66 * @group bp_get_blog_latest_post 67 */ 68 public function test_bp_get_blog_latest_post_default_params() { 69 // Fake the global 70 global $blogs_template; 71 72 $blogs_template = new stdClass; 73 $blogs_template->blog = new stdClass; 74 $blogs_template->blog->latest_post = new stdClass; 75 $blogs_template->blog->latest_post->guid = 'foo'; 76 $blogs_template->blog->latest_post->post_title = 'bar'; 77 78 $this->assertSame( sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="foo">bar</a>' ), bp_get_blog_latest_post() ); 79 80 $blogs_template->blog = null; 81 } 82 83 /** 84 * @group bp_get_blog_latest_post 85 */ 86 public function test_bp_get_blog_latest_post_latest_format_true() { 87 // Fake the global 88 global $blogs_template; 89 90 $blogs_template = new stdClass; 91 $blogs_template->blog = new stdClass; 92 $blogs_template->blog->latest_post = new stdClass; 93 $blogs_template->blog->latest_post->guid = 'foo'; 94 $blogs_template->blog->latest_post->post_title = 'bar'; 95 96 $this->assertSame( sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="foo">bar</a>' ), bp_get_blog_latest_post( array( 'latest_format' => true, ) ) ); 97 98 $blogs_template->blog = null; 99 } 100 101 /** 102 * @group bp_get_blog_latest_post 103 */ 104 public function test_bp_get_blog_latest_post_latest_format_false() { 105 // Fake the global 106 global $blogs_template; 107 108 $blogs_template = new stdClass; 109 $blogs_template->blog = new stdClass; 110 $blogs_template->blog->latest_post = new stdClass; 111 $blogs_template->blog->latest_post->guid = 'foo'; 112 $blogs_template->blog->latest_post->post_title = 'bar'; 113 114 $this->assertSame( '<a href="foo">bar</a>', bp_get_blog_latest_post( array( 'latest_format' => false, ) ) ); 115 116 $blogs_template->blog = null; 117 } 64 118 }
Note: See TracChangeset
for help on using the changeset viewer.