-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnest-starter-plugin.php
103 lines (88 loc) · 2.06 KB
/
nest-starter-plugin.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/*
Plugin Name: Nest Custom Plugin
Plugin URI: https://bigwing.com
Description: Post Types, Taxonomies, Custom Fields
Author: BigWingAgency
Version: 1.0.0
Requires at least: 4.3
Author URI: https://bigwing.com
*/
class Nest_Custom_Plugin {
public function __construct() {
}
/**
* Run plugin init actions
*
* Called after class has been instantiated
*
* @since 1.0
*
*/
public function run() {
add_action( 'init', array( $this, 'create_post_types' ), 11 );
add_action( 'init', array( $this, 'create_taxonomies' ), 12 );
add_action( 'cmb2_init', array( $this, 'create_custom_fields' ), 10 );
add_action( 'init', array( $this, 'create_shortcodes' ), 14 );
}
/**
* Create custom post types here
*
* Create custom post types here
*
* @since 1.0
*
*/
public function create_post_types() {
}
/**
* Create custom taxonomies here
*
* Create custom taxonomies here
*
* @since 1.0
*
*/
public function create_taxonomies() {
}
/**
* Create custom post types here
*
* Create custom post types here
*
* @since 1.0
*
*/
public function create_custom_fields() {
/* Create Custom H1 */
$custom_h1 = new_cmb2_box( array(
'id' => 'custom_h1',
'title' => 'Custom Headline',
'object_types' => get_post_types( '', 'names' ),
'context' => 'normal',
'priority' => 'high',
'show_names' => true
) );
$custom_h1->add_field( array(
'name' => 'Custom H1',
'desc' => 'Enter your Custom H1 text here.',
'id' => 'custom_h1',
'type' => 'text'
) );
}
/**
* Create shortcodes here
*
* Create shortcodes here
*
* @since 1.0
*
*/
public function create_shortcodes() {
}
} //end Nest_Custom_Plugin
add_action( 'plugins_loaded', function() {
$custom_plugin = new Nest_Custom_Plugin();
$custom_plugin->run();
} );
?>