Changeset 2004174
- Timestamp:
- 12/31/2018 07:50:47 AM (7 years ago)
- Location:
- you-have-a-new-message
- Files:
-
- 2 edited
- 7 copied
-
tags/2.1 (copied) (copied from you-have-a-new-message/trunk)
-
tags/2.1/languages (copied) (copied from you-have-a-new-message/trunk/languages)
-
tags/2.1/languages/you-have-a-new-message-de_DE.mo (copied) (copied from you-have-a-new-message/trunk/languages/you-have-a-new-message-de_DE.mo)
-
tags/2.1/languages/you-have-a-new-message-de_DE.po (copied) (copied from you-have-a-new-message/trunk/languages/you-have-a-new-message-de_DE.po)
-
tags/2.1/languages/you-have-a-new-message.pot (copied) (copied from you-have-a-new-message/trunk/languages/you-have-a-new-message.pot)
-
tags/2.1/readme.txt (copied) (copied from you-have-a-new-message/trunk/readme.txt) (2 diffs)
-
tags/2.1/you-have-a-new-message.php (copied) (copied from you-have-a-new-message/trunk/you-have-a-new-message.php) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/you-have-a-new-message.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
you-have-a-new-message/tags/2.1/readme.txt
r1990104 r2004174 5 5 Requires at least: 3.6 6 6 Tested up to: 5.0 7 Stable tag: 2. 07 Stable tag: 2.1 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 23 23 == Changelog == 24 24 25 = 2.1 = 26 27 * Updated code that was deprecated in PHP 7.2 28 25 29 = 2.0 = 26 30 -
you-have-a-new-message/tags/2.1/you-have-a-new-message.php
r1681403 r2004174 6 6 Author: Markus Echterhoff 7 7 Author URI: https://www.markusechterhoff.com 8 Version: 2. 08 Version: 2.1 9 9 License: GPLv3 or later 10 10 Text Domain: you-have-a-new-message … … 17 17 } 18 18 19 add_action('widgets_init', create_function('', 'register_widget("YouHaveANewBuddyPressMessageWidget");'));20 19 class YouHaveANewBuddyPressMessageWidget extends WP_Widget { 21 20 … … 36 35 public function form( $instance ) { 37 36 $single = ! empty( $instance['single'] ) ? $instance['single'] : esc_html__( 'You have a new message', 'you-have-a-new-message' ); 38 37 39 38 ?> 40 39 <p> 41 <label for="<?php echo esc_attr( $this->get_field_id( 'single' ) ); ?>"><?php esc_attr_e( 'Single Message:', 'you-have-a-new-message' ); ?></label> 40 <label for="<?php echo esc_attr( $this->get_field_id( 'single' ) ); ?>"><?php esc_attr_e( 'Single Message:', 'you-have-a-new-message' ); ?></label> 42 41 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'single' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'single' ) ); ?>" type="text" value="<?php echo esc_attr( $single ); ?>"> 43 42 </p> 44 43 <?php 45 44 46 45 $multiple = ! empty( $instance['multiple'] ) ? $instance['multiple'] : esc_html__( 'You have %s new messages', 'you-have-a-new-message' ); 47 46 48 47 ?> 49 48 <p> 50 <label for="<?php echo esc_attr( $this->get_field_id( 'multiple' ) ); ?>"><?php esc_attr_e( 'Multiple Messages: (%s = message count)', 'you-have-a-new-message' ); ?></label> 49 <label for="<?php echo esc_attr( $this->get_field_id( 'multiple' ) ); ?>"><?php esc_attr_e( 'Multiple Messages: (%s = message count)', 'you-have-a-new-message' ); ?></label> 51 50 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'multiple' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'multiple' ) ); ?>" type="text" value="<?php echo esc_attr( $multiple ); ?>"> 52 </p> 51 </p> 53 52 <?php 54 53 } … … 60 59 return $instance; 61 60 } 61 } 62 63 add_action( 'widgets_init', 'yhanm_register_widget' ); 64 function yhanm_register_widget() { 65 register_widget( 'YouHaveANewBuddyPressMessageWidget' ); 62 66 } 63 67 … … 73 77 74 78 function yhanm_get_notice( $single = '', $multiple = '' ) { 75 79 76 80 if ( !is_user_logged_in() ) { 77 81 return; 78 82 } 79 83 80 84 if ( bp_is_messages_component() && bp_is_current_action( 'inbox' ) ) { 81 85 return; 82 86 } 83 87 84 88 $count = bp_get_total_unread_messages_count(); 85 89 if ( !$count ) { … … 94 98 } 95 99 $out .= '</a>'; 96 97 return $out; 100 101 return $out; 98 102 } 99 103 -
you-have-a-new-message/trunk/readme.txt
r1990104 r2004174 5 5 Requires at least: 3.6 6 6 Tested up to: 5.0 7 Stable tag: 2. 07 Stable tag: 2.1 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 23 23 == Changelog == 24 24 25 = 2.1 = 26 27 * Updated code that was deprecated in PHP 7.2 28 25 29 = 2.0 = 26 30 -
you-have-a-new-message/trunk/you-have-a-new-message.php
r1681403 r2004174 6 6 Author: Markus Echterhoff 7 7 Author URI: https://www.markusechterhoff.com 8 Version: 2. 08 Version: 2.1 9 9 License: GPLv3 or later 10 10 Text Domain: you-have-a-new-message … … 17 17 } 18 18 19 add_action('widgets_init', create_function('', 'register_widget("YouHaveANewBuddyPressMessageWidget");'));20 19 class YouHaveANewBuddyPressMessageWidget extends WP_Widget { 21 20 … … 36 35 public function form( $instance ) { 37 36 $single = ! empty( $instance['single'] ) ? $instance['single'] : esc_html__( 'You have a new message', 'you-have-a-new-message' ); 38 37 39 38 ?> 40 39 <p> 41 <label for="<?php echo esc_attr( $this->get_field_id( 'single' ) ); ?>"><?php esc_attr_e( 'Single Message:', 'you-have-a-new-message' ); ?></label> 40 <label for="<?php echo esc_attr( $this->get_field_id( 'single' ) ); ?>"><?php esc_attr_e( 'Single Message:', 'you-have-a-new-message' ); ?></label> 42 41 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'single' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'single' ) ); ?>" type="text" value="<?php echo esc_attr( $single ); ?>"> 43 42 </p> 44 43 <?php 45 44 46 45 $multiple = ! empty( $instance['multiple'] ) ? $instance['multiple'] : esc_html__( 'You have %s new messages', 'you-have-a-new-message' ); 47 46 48 47 ?> 49 48 <p> 50 <label for="<?php echo esc_attr( $this->get_field_id( 'multiple' ) ); ?>"><?php esc_attr_e( 'Multiple Messages: (%s = message count)', 'you-have-a-new-message' ); ?></label> 49 <label for="<?php echo esc_attr( $this->get_field_id( 'multiple' ) ); ?>"><?php esc_attr_e( 'Multiple Messages: (%s = message count)', 'you-have-a-new-message' ); ?></label> 51 50 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'multiple' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'multiple' ) ); ?>" type="text" value="<?php echo esc_attr( $multiple ); ?>"> 52 </p> 51 </p> 53 52 <?php 54 53 } … … 60 59 return $instance; 61 60 } 61 } 62 63 add_action( 'widgets_init', 'yhanm_register_widget' ); 64 function yhanm_register_widget() { 65 register_widget( 'YouHaveANewBuddyPressMessageWidget' ); 62 66 } 63 67 … … 73 77 74 78 function yhanm_get_notice( $single = '', $multiple = '' ) { 75 79 76 80 if ( !is_user_logged_in() ) { 77 81 return; 78 82 } 79 83 80 84 if ( bp_is_messages_component() && bp_is_current_action( 'inbox' ) ) { 81 85 return; 82 86 } 83 87 84 88 $count = bp_get_total_unread_messages_count(); 85 89 if ( !$count ) { … … 94 98 } 95 99 $out .= '</a>'; 96 97 return $out; 100 101 return $out; 98 102 } 99 103
Note: See TracChangeset
for help on using the changeset viewer.