Remove nav walker and Bootstrap navbar
This commit is contained in:
@@ -11,38 +11,3 @@ function get_search_form() {
|
||||
return $form;
|
||||
}
|
||||
add_filter('get_search_form', __NAMESPACE__ . '\\get_search_form');
|
||||
|
||||
/**
|
||||
* Make a URL relative
|
||||
*/
|
||||
function root_relative_url($input) {
|
||||
preg_match('|https?://([^/]+)(/.*)|i', $input, $matches);
|
||||
if (!isset($matches[1]) || !isset($matches[2])) {
|
||||
return $input;
|
||||
} elseif (($matches[1] === $_SERVER['SERVER_NAME']) || $matches[1] === $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']) {
|
||||
return wp_make_link_relative($input);
|
||||
} else {
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare URL against relative URL
|
||||
*/
|
||||
function url_compare($url, $rel) {
|
||||
$url = trailingslashit($url);
|
||||
$rel = trailingslashit($rel);
|
||||
if ((strcasecmp($url, $rel) === 0) || root_relative_url($url) == $rel) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if element is empty
|
||||
*/
|
||||
function is_element_empty($element) {
|
||||
$element = trim($element);
|
||||
return !empty($element);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user