-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhide-author-archive.php
48 lines (43 loc) · 1.35 KB
/
hide-author-archive.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Plugin Name: Hide Author Archive
* Plugin URI: https://github.com/kuno1/hide-author-archive
* Description: Hide author archive pages.
* Version: %nightly%
* Author: Tarosky
* Author URI: https://tarosky.co.jp
* License: GPLv3 or later
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-3.0.html
* Text Domain: hide-author-archive
* Domain Path: languages
*
* @package hide-author-archive
*/
// This file actually do nothing.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Invalid request.' );
}
// Load autoloader if exists.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
/**
* Load i18n.
*/
function hide_author_archive_i18n() {
load_plugin_textdomain( 'hide-author-archive', false, basename( __DIR__ ) . '/languages' );
}
add_action( 'plugins_loaded', 'hide_author_archive_i18n' );
// Load includes.
require __DIR__ . '/includes/functions-rewrite.php';
require __DIR__ . '/includes/functions-rest.php';
require __DIR__ . '/includes/functions-admin.php';
require __DIR__ . '/includes/override-yoast.php';
/**
* Flush rewrite rules.
*/
function hide_author_archive_activation_hook() {
flush_rewrite_rules( false );
}
register_activation_hook( __FILE__, 'hide_author_archive_activation_hook' );
register_deactivation_hook( __FILE__, 'hide_author_archive_activation_hook' );