[wp-trac] [WordPress Trac] #61269: Plugin Dependencies: Add filter to restore auto-redirect after plugin activation

WordPress Trac noreply at wordpress.org
Fri May 24 20:52:32 UTC 2024


#61269: Plugin Dependencies: Add filter to restore auto-redirect after plugin
activation
-------------------------------------------------+-------------------------
 Reporter:  hellofromTonya                       |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.5.4
Component:  Upgrade/Install                      |     Version:  6.5
 Severity:  normal                               |  Resolution:
 Keywords:  needs-testing needs-dev-note has-    |     Focuses:
  patch has-testing-info                         |  administration
-------------------------------------------------+-------------------------

Comment (by costdev):

 @kevinwhoffman While it's still early days for us to predict, yes, I can
 envisage that extra parameters may be added to this filter and that's the
 primary reason why it was designed to accept an `array` parameter rather
 than just a single `(string) $url` parameter.

 For example:
 {{{#!php
 <?php

 // DO NOT USE. THIS IS NOT IMPLEMENTED IN WORDPRESS CORE.

 add_filter( 'plugin_configuration_woocommerce',
 'woocommerce_add_config_data' );

 function woocommerce_add_config_data( $config_data ) {
     if ( $something_saying_onboarding_is_not_completed ) {
         $config_data['url']        = admin_url( 'admin.php?page=wc-
 admin&path=%2Fsetup-wizard' );
         $config_data['label']      = __( 'Get Started', 'woocommerce' );
         $config_data['aria_label'] = sprintf(
             /* translators: %s: WooCommerce. */
             __( 'Get started with %s.' ),
             'WooCommerce'
         );
     } else {
         $config_data['url']        = admin_url( 'admin.php?page=wc-admin'
 );
         $config_data['label']      = __( 'Open', 'woocommerce' );
         $config_data['aria_label'] = sprintf(
             /* translators: %s: WooCommerce. */
             __( 'Open %s.' ),
             'WooCommerce'
         );
     }

     return $config_data;
 }

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61269#comment:41>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list