WordPress.org

Make WordPress Core

Ticket #785: plugin-page-actions.diff

File plugin-page-actions.diff, 4.5 KB (added by morganiq, 9 years ago)
Line 
1? wp-admin/.DS_Store
2? wp-admin/._admin-functions.php
3? wp-admin/._admin.php
4? wp-admin/._menu-header.php
5? wp-admin/._options-permalink.php
6? wp-admin/._options.php
7Index: wp-admin/admin-functions.php
8===================================================================
9RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-functions.php,v
10retrieving revision 1.78
11diff -r1.78 admin-functions.php
12812a813,836
13> function show_plugin_page($type = false) {
14>       global $wp_filter, $plugin_page;
15>       
16>       $plugin_name = preg_replace('!\.php!', '', $plugin_page);
17>       
18>       if ($type && isset($wp_filter[$type . '_page_' . $plugin_name])) {
19>               
20>               do_action($type . '_page_' . $plugin_name);
21>               
22>       } else {
23>               if ( validate_file($plugin_page) ) {
24>                       die(__('Invalid plugin page'));
25>               }
26>
27>               if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
28>                       die(sprintf(__('Cannot load %s.'), $plugin_page));
29>
30>               include(ABSPATH . "wp-content/plugins/$plugin_page");
31>       }
32>       
33>       include(ABSPATH . 'wp-admin/admin-footer.php');
34> }
35>
36>
37Index: wp-admin/admin.php
38===================================================================
39RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin.php,v
40retrieving revision 1.7
41diff -r1.7 admin.php
4241c41
43< // Handle plugin admin pages.
44---
45> // For plugin Options/Management pages
4644,45c44,51
47<       if ( validate_file($plugin_page) ) {
48<               die(__('Invalid plugin page'));
49---
50>       
51>       // Maintain backward compatibility with double-loading plugins
52>       if ($pagenow == 'admin.php') {
53>               
54>               if (! isset($_GET['noheader']))
55>                       require_once(ABSPATH . '/wp-admin/admin-header.php');
56>                       
57>               show_plugin_page();
5847,56d52
59<
60<       if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
61<               die(sprintf(__('Cannot load %s.'), $plugin_page));
62<
63<       if (! isset($_GET['noheader']))
64<               require_once(ABSPATH . '/wp-admin/admin-header.php');
65<
66<       include(ABSPATH . "wp-content/plugins/$plugin_page");
67<
68<       include(ABSPATH . 'wp-admin/admin-footer.php');
69Index: wp-admin/edit.php
70===================================================================
71RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit.php,v
72retrieving revision 1.42
73diff -r1.42 edit.php
744d3
75< $title = __('Posts');
766c5,16
77< require_once('admin-header.php');
78---
79>
80> // Handle plugin Management page.
81> if ($plugin_page) :
82>       if (! isset($_GET['noheader']))
83>               require_once(ABSPATH . '/wp-admin/admin-header.php');
84>               
85>       show_plugin_page('management');
86>
87> else :
88>
89> $title = __('Posts');
90> require_once(ABSPATH . '/wp-admin/admin-header.php');
91220a231,232
92>
93> endif;
94Index: wp-admin/menu-header.php
95===================================================================
96RCS file: /cvsroot/cafelog/wordpress/wp-admin/menu-header.php,v
97retrieving revision 1.4
98diff -r1.4 menu-header.php
9938c38
100< if ( (substr($self, -10) == substr($item[2], -10)) || (isset($plugin_page) && $plugin_page == $item[2]) ) $class = ' class="current"';
101---
102> if ( (!isset($plugin_page) && (substr($self, -10) == substr($item[2], -10))) || (isset($plugin_page) && $plugin_page == $item[2]) ) $class = ' class="current"';
10342,44c42,53
104< if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}"))
105<       echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";                 
106<  else
107---
108> if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}")) {
109>       // Maintain backward-compatibility with double-loading plugins
110>       if (isset($wp_filter['options_page_' . str_replace('.php', '', $item[2])]) || isset($wp_filter['management_page_' . str_replace('.php', '', $item[2])])) {
111>               if ($parent_file == 'options-general.php')
112>                       echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/options.php?page={$item[2]}'$class>{$item[0]}</a></li>";
113>               elseif ($parent_file == 'edit.php')
114>                       echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/edit.php?page={$item[2]}'$class>{$item[0]}</a></li>";
115>       }
116>       else
117>               echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
118> }
119> else {
12045a55
121> }
122Index: wp-admin/options.php
123===================================================================
124RCS file: /cvsroot/cafelog/wordpress/wp-admin/options.php,v
125retrieving revision 1.41
126diff -r1.41 options.php
1274d3
128< $title = __('Options');
1297a7,17
130> // Handle plugin Options page.
131> if ($plugin_page) :
132>       if (! isset($_GET['noheader']))
133>               require_once(ABSPATH . '/wp-admin/admin-header.php');
134>               
135>       show_plugin_page('options');
136>
137> else :
138>
139> $title = __('Options');
140>
141124a135,136
142>
143> endif;