Skip to:
Content

BuddyPress.org

Changeset 6422


Ignore:
Timestamp:
10/15/2012 08:50:23 PM (11 years ago)
Author:
boonebgorges
Message:

Remove Settings link on plugins.php and replace with Setup Wizard in installation mode

When activating BP for the first time, and before running the setup wizard,
the Settings page is inoperative. So there should not be a Settings link on
the BuddyPress row of the Plugins panel. Instead, show a Setup Wizard link
at these times.

Fixes #4603

Props apeatling aka The Godfather

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-admin.php

    r6343 r6422  
    361361     */
    362362    public function add_settings_link( $links, $file ) {
    363 
    364363        if ( buddypress()->basename == $file ) {
    365             $url           = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
    366             $settings_link = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>';
     364            $page = 'bp-components';
     365            $text = __( 'Settings', 'buddypress' );
     366            $url  = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
     367
     368            // If we're in install mode then the link needs to show "Wizard" and link
     369            // to the wizard. Otherwise we can show the BuddyPress settings page link.
     370            if ( 'install' == bp_get_maintenance_mode() ) {
     371                $page = 'bp-wizard';
     372                $text = __( 'Setup Wizard', 'buddypress' );
     373                $url  = bp_core_do_network_admin() ? network_admin_url( 'admin.php?page=' . $page ) : admin_url( 'index.php?page=' . $page );
     374            }
     375
     376            $settings_link  = '<a href="' . add_query_arg( array( 'page' => $page ), $url ) . '">' . $text . '</a>';
     377
    367378            array_unshift( $links, $settings_link );
    368379        }
Note: See TracChangeset for help on using the changeset viewer.