/**
 * Theme Name:     Maxwell Child
 * Author:         ThemeZee
 * Template:       maxwell
 * Text Domain:	   Maxwell Child
 * Description:    Maxwell is a minimalistic and elegant WordPress theme featuring an ultra clean magazine layout. With a beautiful typography, various post layouts and a gorgeous featured posts slideshow Maxwell truly helps you to stand out.
 */
<?php
/**
 * Maxwell Child Theme functions
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}


/**
 * Load Maxwell parent stylesheet.
 */
function maxwell_child_enqueue_parent_style() {

	wp_enqueue_style(
		'maxwell-parent-style',
		get_template_directory_uri() . '/style.css',
		array(),
		wp_get_theme( get_template() )->get( 'Version' )
	);

}
add_action( 'wp_enqueue_scripts', 'maxwell_child_enqueue_parent_style', 5 );


/**
 * Hide WordPress REST API user enumeration.
 */
add_filter( 'rest_endpoints', function ( $endpoints ) {

	if ( isset( $endpoints['/wp/v2/users'] ) ) {
		unset( $endpoints['/wp/v2/users'] );
	}

	return $endpoints;

} );


/**
 * Prevent author enumeration.
 */
add_action( 'init', function () {

	if ( ! is_admin() && isset( $_GET['author'] ) ) {
		wp_safe_redirect( home_url( '/' ) );
		exit;
	}

} );