-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenesis-explained.php
42 lines (39 loc) · 1.23 KB
/
genesis-explained.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
<?php
/**
* Genesis Explained
*
* @package NickTheGeek\GenesisExplained
* @author Nick Croft
* @copyright 2018 Nick Croft
* @license GPL-3.0+
*
* @wordpress-plugin
* Plugin Name: Genesis Explained
* Plugin URI: https://github.com/NicktheGeek/genesis-explained
* Description: Code examples from the Genesis Explained book.
* Version: 1.2
* Author: Nick_theGeek
* Author URI: https://designsbynickthegeek.com/
* Text Domain: gfwa
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* GitHub Plugin URI: https://github.com/NicktheGeek/genesis-explained
* Requires PHP: 5.2
* Requires WP: 3.3
*/
add_action( 'genesis_init', 'genesis_explained_init' );
/**
* Includes the example files automatically.
*
* Callback is on genesis_init so we know the files will only be loaded
* if and only if Genesis is active.
*/
function genesis_explained_init() {
$genesis_explained_directories = glob( dirname( __FILE__ ) . '/*', GLOB_ONLYDIR );
foreach ( $genesis_explained_directories as $chapter ) {
$file = sprintf( '%sexample.php', trailingslashit( $chapter ) );
if ( file_exists( $file ) ) {
include $file;
}
}
}