Changeset 14760
- Timestamp:
- 03/26/2026 05:47:24 AM (7 days ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 2 edited
-
support-forums/inc/class-support-compat.php (modified) (1 diff)
-
wporg-bbp-term-subscription/inc/class-plugin.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php
r13772 r14760 357 357 public function load_compat_subscriptions() { 358 358 if ( class_exists( 'WordPressdotorg\Forums\Term_Subscription\Plugin' ) ) { 359 // Labels use callbacks to defer translation loading until bbp_init. 359 360 Plugin::get_instance()->plugin_subscriptions = new Term_Subscription\Plugin( array( 360 361 'taxonomy' => 'topic-plugin', 361 362 'directory' => Plugin::get_instance()->plugins, 362 'labels' => array( 363 'subscribed_header' => __( 'Subscribed Plugins', 'wporg-forums' ), 364 'subscribed_user_notice' => __( 'You are not currently subscribed to any plugins.', 'wporg-forums' ), 365 'subscribed_anon_notice' => __( 'This user is not currently subscribed to any plugins.', 'wporg-forums' ), 366 /* translators: %s: Plugin Name. */ 367 'receipt' => __( 'You are receiving this email because you are subscribed to the %s plugin.', 'wporg-forums' ), 368 ), 363 'labels' => function() { 364 return array( 365 'subscribed_header' => __( 'Subscribed Plugins', 'wporg-forums' ), 366 'subscribed_user_notice' => __( 'You are not currently subscribed to any plugins.', 'wporg-forums' ), 367 'subscribed_anon_notice' => __( 'This user is not currently subscribed to any plugins.', 'wporg-forums' ), 368 /* translators: %s: Plugin Name. */ 369 'receipt' => __( 'You are receiving this email because you are subscribed to the %s plugin.', 'wporg-forums' ), 370 ); 371 }, 369 372 ) ); 370 373 Plugin::get_instance()->theme_subscriptions = new Term_Subscription\Plugin( array( 371 374 'taxonomy' => 'topic-theme', 372 375 'directory' => Plugin::get_instance()->themes, 373 'labels' => array( 374 'subscribed_header' => __( 'Subscribed Themes', 'wporg-forums' ), 375 'subscribed_user_notice' => __( 'You are not currently subscribed to any themes.', 'wporg-forums' ), 376 'subscribed_anon_notice' => __( 'This user is not currently subscribed to any themes.', 'wporg-forums' ), 377 /* translators: %s: Theme Name. */ 378 'receipt' => __( 'You are receiving this email because you are subscribed to the %s theme.', 'wporg-forums' ), 379 ), 376 'labels' => function() { 377 return array( 378 'subscribed_header' => __( 'Subscribed Themes', 'wporg-forums' ), 379 'subscribed_user_notice' => __( 'You are not currently subscribed to any themes.', 'wporg-forums' ), 380 'subscribed_anon_notice' => __( 'This user is not currently subscribed to any themes.', 'wporg-forums' ), 381 /* translators: %s: Theme Name. */ 382 'receipt' => __( 'You are receiving this email because you are subscribed to the %s theme.', 'wporg-forums' ), 383 ); 384 }, 380 385 ) ); 381 386 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
r14198 r14760 9 9 */ 10 10 11 public $taxonomy = false;12 public $labels = array();13 public $directory = false;11 public $taxonomy = false; 12 public $labels_cb = false; 13 public $directory = false; 14 14 15 15 protected $term = false; … … 37 37 'taxonomy' => 'topic-tag', 38 38 'directory' => false, 39 'labels' => array( 40 'subscribed_header' => __( 'Subscribed Topic Tags', 'wporg-forums' ), 41 'subscribed_user_notice' => __( 'You are not currently subscribed to any topic tags.', 'wporg-forums' ), 42 'subscribed_anon_notice' => __( 'This user is not currently subscribed to any topic tags.', 'wporg-forums' ), 43 'receipt' => __( "You are receiving this email because you are subscribed to the %s tag.", 'wporg-forums'), 44 ), 39 'labels' => false, 45 40 ) ); 46 41 47 $this->taxonomy = $r['taxonomy'];48 $this->labels = $r['labels'];49 $this->directory = $r['directory'];42 $this->taxonomy = $r['taxonomy']; 43 $this->labels_cb = $r['labels']; 44 $this->directory = $r['directory']; 50 45 51 46 // If no taxonomy was provided, there's nothing we can do. … … 55 50 56 51 add_action( 'bbp_init', array( $this, 'bbp_init' ) ); 52 } 53 54 /** 55 * Get the default translated labels. 56 * 57 * @return array 58 */ 59 public function get_default_labels() { 60 return array( 61 'subscribed_header' => __( 'Subscribed Topic Tags', 'wporg-forums' ), 62 'subscribed_user_notice' => __( 'You are not currently subscribed to any topic tags.', 'wporg-forums' ), 63 'subscribed_anon_notice' => __( 'This user is not currently subscribed to any topic tags.', 'wporg-forums' ), 64 'receipt' => __( "You are receiving this email because you are subscribed to the %s tag.", 'wporg-forums' ), 65 ); 66 } 67 68 /** 69 * Get labels, merging any custom labels with the defaults. 70 * 71 * @return array 72 */ 73 public function get_labels() { 74 $labels = $this->labels_cb ? call_user_func( $this->labels_cb ) : array(); 75 76 return wp_parse_args( $labels, $this->get_default_labels() ); 57 77 } 58 78 … … 370 390 $topic_url, 371 391 sprintf( 372 $this-> labels['receipt'],392 $this->get_labels()['receipt'], 373 393 $this->get_current_term()->name 374 394 ) … … 510 530 $reply_url, 511 531 sprintf( 512 $this-> labels['receipt'],532 $this->get_labels()['receipt'], 513 533 $this->get_current_term()->name 514 534 ) … … 620 640 621 641 <div class="bbp-user-subscriptions"> 622 <h2 class="entry-title"><?php echo esc_html( $this-> labels['subscribed_header'] ); ?></h2>642 <h2 class="entry-title"><?php echo esc_html( $this->get_labels()['subscribed_header'] ); ?></h2> 623 643 <div class="bbp-user-section"> 624 644 <?php … … 634 654 } else { 635 655 if ( bbp_get_user_id() == get_current_user_id() ) { 636 echo '<p>' . esc_html( $this-> labels['subscribed_user_notice'] ) . '</p>';656 echo '<p>' . esc_html( $this->get_labels()['subscribed_user_notice'] ) . '</p>'; 637 657 } else { 638 echo '<p>' . esc_html( $this-> labels['subscribed_anon_notice'] ) . '</p>';658 echo '<p>' . esc_html( $this->get_labels()['subscribed_anon_notice'] ) . '</p>'; 639 659 } 640 660 }
Note: See TracChangeset
for help on using the changeset viewer.