-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxml-sitemaps-manager.php
More file actions
57 lines (50 loc) · 2.08 KB
/
xml-sitemaps-manager.php
File metadata and controls
57 lines (50 loc) · 2.08 KB
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
49
50
51
52
53
54
55
56
57
<?php
/**
* XML Sitemaps Manager
*
* Plugin Name: XML Sitemaps Manager
* Plugin URI: https://status301.net/wordpress-plugins/xml-sitemaps-manager/
* Description: Fix some bugs and add new options to manage the WordPress core XML Sitemaps. Happy with the results? Please leave me a <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemaps%20Manager">tip</a></strong> for continued development and support. Thanks :)
* Text Domain: xml-sitemaps-manager
* Version: 0.7
* Requires at least: 5.5
* Requires PHP: 5.6
* Author: RavanH
* Author URI: https://status301.net/
*
* @package XML Sitemaps Manager
*/
defined( 'WPINC' ) || die;
define( 'XMLSM_VERSION', '0.7' );
define( 'XMLSM_BASENAME', plugin_basename( __FILE__ ) );
add_action( 'init', array( 'XMLSitemapsManager\Load', 'front' ), 9 );
add_action( 'admin_init', array( 'XMLSitemapsManager\Load', 'admin' ) );
register_deactivation_hook( __FILE__, array( 'XMLSitemapsManager\Admin', 'deactivate' ) );
/**
* XML Sitemap Manager Autoloader.
*
* @since 0.5
*
* @param string $class_name The fully-qualified class name.
*
* @return void
*/
\spl_autoload_register(
function ( $class_name ) {
// Skip this if not in our namespace.
if ( 0 !== \strpos( $class_name, 'XMLSitemapsManager\\' ) ) {
return;
}
// Replace namespace separators with directory separators in the relative
// class name, prepend with class-, append with .php, build our file path.
$class_name = \str_replace( 'XMLSitemapsManager', 'includes', $class_name );
$class_name = \strtolower( $class_name );
$path_array = \explode( '\\', $class_name );
$file_name = 'class-' . \array_pop( $path_array ) . '.php';
$file = __DIR__ .\DIRECTORY_SEPARATOR . \implode( \DIRECTORY_SEPARATOR, $path_array ) . \DIRECTORY_SEPARATOR . $file_name;
// If the file exists, inlcude it.
if ( \file_exists( $file ) ) {
include $file;
}
}
);