Changeset 10673
- Timestamp:
- 02/15/2021 04:03:50 AM (4 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r10349 r10673 286 286 // Add plugin- and theme-specific filters and actions. 287 287 add_action( 'wporg_compat_view_sidebar', array( $this, 'do_view_sidebar' ) ); 288 add_action( 'wporg_compat_view_sidebar', array( $this, 'do_subscription_link' ), 11 ); 288 289 add_action( 'wporg_compat_before_single_view', array( $this, 'do_view_header' ) ); 289 add_action( 'wporg_compat_before_single_view', array( $this, 'do_subscription_link' ), 11 );290 290 291 291 // Add output filters and actions. … … 751 751 $subscribe = esc_html__( 'Subscribe to this plugin', 'wporg-forums' ); 752 752 $unsubscribe = esc_html__( 'Unsubscribe from this plugin', 'wporg-forums' ); 753 $js_confirm = esc_html__( 'Are you sure you wish to subscribe by email to all future topics created in this plugin forum?', 'wporg-forums' ); 753 754 } else { 754 755 $subscribe = esc_html__( 'Subscribe to this theme', 'wporg-forums' ); 755 756 $unsubscribe = esc_html__( 'Unsubscribe from this theme', 'wporg-forums' ); 757 $js_confirm = esc_html__( 'Are you sure you wish to subscribe by email to all future topics created in this theme forum?', 'wporg-forums' ); 756 758 } 757 759 $term_subscription = Term_Subscription\Plugin::get_subscription_link( array( … … 760 762 'subscribe' => $subscribe, 761 763 'unsubscribe' => $unsubscribe, 764 'js_confirm' => $js_confirm, 762 765 ) ); 763 766 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
r9476 r10673 584 584 'term_id' => 0, 585 585 'taxonomy' => 'topic-tag', 586 'class' => 'button', 586 587 'subscribe' => esc_html__( 'Subscribe to this topic tag', 'wporg-forums' ), 587 588 'unsubscribe' => esc_html__( 'Unsubscribe from this topic tag', 'wporg-forums' ), 589 'js_confirm' => esc_html__( 'Are you sure you wish to subscribe by email to all future topics created in this tag?', 'wporg-forums' ), 588 590 ), 'get_term_subscription_link' ); 589 591 if ( empty( $r['user_id'] ) || empty( $r['term_id'] ) || empty( $r['taxonomy'] ) ) { … … 596 598 597 599 $url = self::get_subscription_url( $r['user_id'], $r['term_id'], $r['taxonomy'] ); 598 $text = $r['subscribe'];599 600 if ( self::is_user_subscribed_to_term( $r['user_id'], $r['term_id'] ) ) { 600 $text = $r['unsubscribe']; 601 } 602 return sprintf( "<div class='wporg-bbp-term-subscription'><a href='%s'>%s</a></div>", 601 $text = $r['unsubscribe']; 602 $js_confirm = ''; 603 } else { 604 $text = $r['subscribe']; 605 $js_confirm = 'javascript:return confirm(' . json_encode( $r['js_confirm'] ) . ');'; 606 } 607 608 return sprintf( 609 "<div class='wporg-bbp-term-subscription'><a href='%s' class='%s' onclick='%s'>%s</a></div>", 603 610 $url, 604 esc_html( $text ) ); 611 esc_attr( $r['class'] ), 612 esc_attr( $js_confirm ), 613 esc_html( $text ) 614 ); 605 615 } 606 616
Note: See TracChangeset
for help on using the changeset viewer.