Skip to content

Commit

Permalink
don't add multisite prefix into admin routes regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ol1s authored Sep 12, 2019
1 parent ab5027a commit 6a229ae
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions classes/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class Route
protected $is_admin;

/**
* @return void
*/
* @return void
*/
public function call($controller, $action)
{
$this->controller = $controller;
Expand All @@ -42,14 +42,7 @@ public static function match($regex)
*/
public static function admin($regex)
{
$siteurl = site_url();
$siteurl = str_replace('://', '', $siteurl);
$siteurl_split = explode('/', $siteurl);
array_shift($siteurl_split);
$site_prefix = implode('/', $siteurl_split);

$admin_prefix = $site_prefix.'/wp-admin';
$admin_prefix = ltrim($admin_prefix, '/');
$admin_prefix = 'wp-admin';

$regex = ltrim($regex, '/');
$regex = $admin_prefix.'/'.$regex;
Expand Down

0 comments on commit 6a229ae

Please sign in to comment.