<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16026] trunk/wp-admin/plugins.php: More self_admin_url.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16026">16026</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-10-27 22:51:06 +0000 (Wed, 27 Oct 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>More self_admin_url. props PeteMall, see <a href="http://trac.wordpress.org/ticket/14062">#14062</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (16025 => 16026)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2010-10-27 22:27:06 UTC (rev 16025)
+++ trunk/wp-admin/plugins.php        2010-10-27 22:51:06 UTC (rev 16026)
</span><span class="lines">@@ -32,10 +32,10 @@
</span><span class="cx">
</span><span class="cx">                         check_admin_referer('activate-plugin_' . $plugin);
</span><span class="cx">
</span><del>-                        $result = activate_plugin($plugin, admin_url('plugins.php?error=true&plugin=' . $plugin), $network_wide);
</del><ins>+                        $result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), $network_wide);
</ins><span class="cx">                         if ( is_wp_error( $result ) ) {
</span><span class="cx">                                 if ( 'unexpected_output' == $result->get_error_code() ) {
</span><del>-                                        $redirect = admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
</del><ins>+                                        $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
</ins><span class="cx">                                         wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
</span><span class="cx">                                         exit;
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -49,9 +49,9 @@
</span><span class="cx">                                 update_option('recently_activated', $recent);
</span><span class="cx">                         }
</span><span class="cx">                         if ( isset($_GET['from']) && 'import' == $_GET['from'] ) {
</span><del>-                                wp_redirect( admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix
</del><ins>+                                wp_redirect( self_admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix
</ins><span class="cx">                         } else {
</span><del>-                                wp_redirect( admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above
</del><ins>+                                wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above
</ins><span class="cx">                         }
</span><span class="cx">                         exit;
</span><span class="cx">                         break;
</span><span class="lines">@@ -65,11 +65,11 @@
</span><span class="cx">                         $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</span><span class="cx">                         $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); // Only activate plugins which are not already active.
</span><span class="cx">                         if ( empty($plugins) ) {
</span><del>-                                wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                                wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                                 exit;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        activate_plugins($plugins, admin_url('plugins.php?error=true'), $network_wide);
</del><ins>+                        activate_plugins($plugins, self_admin_url('plugins.php?error=true'), $network_wide);
</ins><span class="cx">
</span><span class="cx">                         $recent = (array)get_option('recently_activated');
</span><span class="cx">                         foreach ( $plugins as $plugin => $time)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">
</span><span class="cx">                         update_option('recently_activated', $recent);
</span><span class="cx">
</span><del>-                        wp_redirect( admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                        wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                         exit;
</span><span class="cx">                         break;
</span><span class="cx">                 case 'update-selected' :
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">                         echo '<h2>' . esc_html( $title ) . '</h2>';
</span><span class="cx">
</span><span class="cx">
</span><del>-                        $url = admin_url('update.php?action=update-selected&amp;plugins=' . urlencode( join(',', $plugins) ));
</del><ins>+                        $url = self_admin_url('update.php?action=update-selected&amp;plugins=' . urlencode( join(',', $plugins) ));
</ins><span class="cx">                         $url = wp_nonce_url($url, 'bulk-update-plugins');
</span><span class="cx">
</span><span class="cx">                         echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">                         if ( headers_sent() )
</span><span class="cx">                                 echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />";
</span><span class="cx">                         else
</span><del>-                                wp_redirect( admin_url("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                                wp_redirect( self_admin_url("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                         exit;
</span><span class="cx">                         break;
</span><span class="cx">                 case 'deactivate-selected':
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">                         $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</span><span class="cx">                         $plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
</span><span class="cx">                         if ( empty($plugins) ) {
</span><del>-                                wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                                wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                                 exit;
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx">                                 $deactivated[ $plugin ] = time();
</span><span class="cx">
</span><span class="cx">                         update_option('recently_activated', $deactivated + (array)get_option('recently_activated'));
</span><del>-                        wp_redirect( admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                        wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                         exit;
</span><span class="cx">                         break;
</span><span class="cx">                 case 'delete-selected':
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx">                         $plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
</span><span class="cx">                         $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
</span><span class="cx">                         if ( empty($plugins) ) {
</span><del>-                                wp_redirect( admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                                wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                                 exit;
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx">                         $delete_result = delete_plugins($plugins);
</span><span class="cx">
</span><span class="cx">                         set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length
</span><del>-                        wp_redirect( admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") );
</del><ins>+                        wp_redirect( self_admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") );
</ins><span class="cx">                         exit;
</span><span class="cx">                         break;
</span><span class="cx">                 case 'clear-recent-list':
</span></span></pre>
</div>
</div>
</body>
</html>