Skip to content

Commit 0705fe6

Browse files
committed
Merge branch 'master' into af/add-discussion-page
2 parents dd9768e + 246dff9 commit 0705fe6

15 files changed

+1004
-199
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ See the [Core Trac ticket](https://core.trac.wordpress.org/ticket/39441) for mor
1616

1717
### Testing the new layout
1818

19-
To test the new layout and markup, visit the Settings > General page in the admin. This is the only page that is currently modified for testing.
19+
To test the new layout and markup, visit a settings page in the admin. At this point, all settings pages except the Discussion page have been migrated to using the enhanced Settings API.
2020

2121
### Testing the enhanced Settings API
2222

settings-api-enhanced.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,34 @@ function sae_replace_options_general() {
3333
exit;
3434
}
3535

36+
/**
37+
* Replaces the Settings > Writing screen with the plugin variant.
38+
*/
39+
function sae_replace_options_writing() {
40+
global $title, $parent_file, $submenu_file;
41+
42+
// Ensure submenu item is highlighted correctly.
43+
$submenu_file = 'options-writing.php';
44+
45+
require_once SAE_ABSPATH . 'wp-admin/options-writing.php';
46+
47+
exit;
48+
}
49+
50+
/**
51+
* Replaces the Settings > Reading screen with the plugin variant.
52+
*/
53+
function sae_replace_options_reading() {
54+
global $title, $parent_file, $submenu_file;
55+
56+
// Ensure submenu item is highlighted correctly.
57+
$submenu_file = 'options-reading.php';
58+
59+
require_once SAE_ABSPATH . 'wp-admin/options-reading.php';
60+
61+
exit;
62+
}
63+
3664
/**
3765
* Replaces the Settings > Media screen with the plugin variant.
3866
*/
@@ -47,6 +75,20 @@ function sae_replace_options_media() {
4775
exit;
4876
}
4977

78+
/**
79+
* Replaces the Settings > Permalink screen with the plugin variant.
80+
*/
81+
function sae_replace_options_permalink() {
82+
global $title, $parent_file, $submenu_file, $is_nginx, $wp_rewrite;
83+
84+
// Ensure submenu item is highlighted correctly.
85+
$submenu_file = 'options-permalink.php';
86+
87+
require_once SAE_ABSPATH . 'wp-admin/options-permalink.php';
88+
89+
exit;
90+
}
91+
5092
/**
5193
* Replaces the Settings > Discussion screen with the plugin variant.
5294
*/
@@ -78,7 +120,10 @@ function sae_load() {
78120

79121
add_action( 'admin_enqueue_scripts', 'sae_enqueue_forms_css' );
80122
add_action( 'load-options-general.php', 'sae_replace_options_general' );
123+
add_action( 'load-options-writing.php', 'sae_replace_options_writing' );
124+
add_action( 'load-options-reading.php', 'sae_replace_options_reading' );
81125
add_action( 'load-options-media.php', 'sae_replace_options_media' );
126+
add_action( 'load-options-permalink.php', 'sae_replace_options_permalink' );
82127
add_action( 'load-options-discussion.php', 'sae_replace_options_discussion' );
83128
}
84129

0 commit comments

Comments
 (0)