Making WordPress.org


Ignore:
Timestamp:
02/15/2021 04:03:50 AM (4 years ago)
Author:
dd32
Message:

Support Forums: Move the "Subscribe to this plugin/theme" button to the sidebar instead of before the main topic listing.

This also adds a javascript-based confirm "are you sure?" confirmation upon attempting to subscribe to the plugin/theme.

See #3456.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php

    r10349 r10673  
    286286            // Add plugin- and theme-specific filters and actions.
    287287            add_action( 'wporg_compat_view_sidebar',       array( $this, 'do_view_sidebar' ) );
     288            add_action( 'wporg_compat_view_sidebar',       array( $this, 'do_subscription_link' ), 11 );
    288289            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 );
    290290
    291291            // Add output filters and actions.
     
    751751                $subscribe   = esc_html__( 'Subscribe to this plugin', 'wporg-forums' );
    752752                $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' );
    753754            } else {
    754755                $subscribe   = esc_html__( 'Subscribe to this theme', 'wporg-forums' );
    755756                $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' );
    756758            }
    757759            $term_subscription = Term_Subscription\Plugin::get_subscription_link( array(
     
    760762                'subscribe'   => $subscribe,
    761763                'unsubscribe' => $unsubscribe,
     764                'js_confirm'  => $js_confirm,
    762765            ) );
    763766        }
Note: See TracChangeset for help on using the changeset viewer.