|
39 | 39 | ); |
40 | 40 |
|
41 | 41 | if ( $_POST ) { |
42 | | - do_action( 'wpmuadminedit' , '' ); |
| 42 | + /** This action is documented in wp-admin/network/edit.php */ |
| 43 | + do_action( 'wpmuadminedit' ); |
43 | 44 |
|
44 | 45 | check_admin_referer( 'siteoptions' ); |
45 | 46 |
|
|
64 | 65 | update_site_option( $option_name, $value ); |
65 | 66 | } |
66 | 67 |
|
67 | | - // Update more options here |
| 68 | + /** |
| 69 | + * Fires after the network options are updated. |
| 70 | + * |
| 71 | + * @since MU |
| 72 | + */ |
68 | 73 | do_action( 'update_wpmu_options' ); |
69 | 74 |
|
70 | 75 | wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) ); |
|
285 | 290 | <td> |
286 | 291 | <?php |
287 | 292 | $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 | + */ |
288 | 308 | $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) ); |
289 | 309 | foreach ( (array) $menu_items as $key => $val ) { |
290 | 310 | 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 | 314 | </tr> |
295 | 315 | </table> |
296 | 316 |
|
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' ); ?> |
299 | 324 | <?php submit_button(); ?> |
300 | 325 | </form> |
301 | 326 | </div> |
|
0 commit comments