<?php

namespace Roots\Sage\Extras;

use Roots\Sage\Setup;

/**
 * Add <body> classes
 */
function body_class($classes) {
  // Add page slug if it doesn't exist
  if (is_single() || is_page() && !is_front_page()) {
    if (!in_array(basename(get_permalink()), $classes)) {
      $classes[] = basename(get_permalink());
    }
  }

  // Add class if sidebar is active
  if (Setup\display_sidebar()) {
    $classes[] = 'sidebar-primary';
  }

  return $classes;
}
add_filter('body_class', __NAMESPACE__ . '\\body_class');

/**
 * Clean up the_excerpt()
 */
function excerpt_more() {
  return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'sage') . '</a>';
}
add_filter('excerpt_more', __NAMESPACE__ . '\\excerpt_more');

/**
 * Prevent '/admin' to redirect to '/careers/administrative-jobs/'
 */
function redirect_exceptions($redirect_url, $requested_url) {

  if($requested_url==='admin') {
    $redirect_url = $requested_url;
  }

  return $redirect_url;
}
add_filter('redirect_canonical', __NAMESPACE__ . '\\redirect_exceptions');
<?php

namespace Roots\Sage\Extras;

use Roots\Sage\Setup;

/**
 * Add <body> classes
 */
function body_class($classes) {
  // Add page slug if it doesn't exist
  if (is_single() || is_page() && !is_front_page()) {
    if (!in_array(basename(get_permalink()), $classes)) {
      $classes[] = basename(get_permalink());
    }
  }

  // Add class if sidebar is active
  if (Setup\display_sidebar()) {
    $classes[] = 'sidebar-primary';
  }

  return $classes;
}
add_filter('body_class', __NAMESPACE__ . '\\body_class');

/**
 * Clean up the_excerpt()
 */
function excerpt_more() {
  return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'sage') . '</a>';
}
add_filter('excerpt_more', __NAMESPACE__ . '\\excerpt_more');

/**
 * Prevent '/admin' from redirecting to '/careers/administrative-jobs/'
 */
function redirect_exceptions($redirect_url, $requested_url) {

  if($requested_url==='admin') {
    $redirect_url = $requested_url;
  }

  return $redirect_url;
}
add_filter('redirect_canonical', __NAMESPACE__ . '\\redirect_exceptions');
Comment grammar - c’mon Bryant…
Comment grammar - c’mon Bryant…