Skip to content

Commit 030d697

Browse files
committed
Inline documentation for hooks in wp-admin/network/settings.php.
Props ninio for the initial patches. Fixes #25727. git-svn-id: https://develop.svn.wordpress.org/trunk@25967 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9a5e8ac commit 030d697

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

src/wp-admin/network/settings.php

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
);
4040

4141
if ( $_POST ) {
42-
do_action( 'wpmuadminedit' , '' );
42+
/** This action is documented in wp-admin/network/edit.php */
43+
do_action( 'wpmuadminedit' );
4344

4445
check_admin_referer( 'siteoptions' );
4546

@@ -64,7 +65,11 @@
6465
update_site_option( $option_name, $value );
6566
}
6667

67-
// Update more options here
68+
/**
69+
* Fires after the network options are updated.
70+
*
71+
* @since MU
72+
*/
6873
do_action( 'update_wpmu_options' );
6974

7075
wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
@@ -285,6 +290,21 @@
285290
<td>
286291
<?php
287292
$menu_perms = get_site_option( 'menu_items' );
293+
/**
294+
* Filter available network-wide administration menu options.
295+
*
296+
* Options returned to this filter are output as individual checkboxes that, when selected,
297+
* enable site administrator access to the specified administration menu in certain contexts.
298+
*
299+
* Adding options for specific menus here hinges on the appropriate checks and capabilities
300+
* being in place in the site dashboard on the other side. For instance, when the single
301+
* default option, 'plugins' is enabled, site administrators are granted access to the Plugins
302+
* screen in their individual sites' dashboards.
303+
*
304+
* @since MU
305+
*
306+
* @param array $admin_menus The menu items available.
307+
*/
288308
$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
289309
foreach ( (array) $menu_items as $key => $val ) {
290310
echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . " /> " . esc_html( $val ) . "</label><br/>";
@@ -294,8 +314,13 @@
294314
</tr>
295315
</table>
296316

297-
<?php do_action( 'wpmu_options' ); // Add more options here ?>
298-
317+
<?php
318+
/**
319+
* Fires at the end of the Network Settings form, before the submit button.
320+
*
321+
* @since MU
322+
*/
323+
do_action( 'wpmu_options' ); ?>
299324
<?php submit_button(); ?>
300325
</form>
301326
</div>

0 commit comments

Comments
 (0)