Genesis Simple Hooks - Version 1.8.0

Version Description

  • Increased requirement to Genesis 1.8.0.
  • Switched over to the Genesis 1.8 admin menu class to build admin menu.
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Genesis Simple Hooks
Version 1.8.0
Comparing to
See all releases

Code changes from version 1.7.1 to 1.8.0

Files changed (4) hide show
  1. admin.php +500 -193
  2. boxes.php +0 -367
  3. plugin.php +36 -14
  4. readme.txt +8 -4
admin.php CHANGED
@@ -1,241 +1,548 @@
1
  <?php
2
  /**
3
- * Return the defaults array
 
 
 
 
 
 
4
  *
5
- * @since 0.1
6
  */
7
- function simplehooks_defaults() {
8
-
9
- return array(
10
-
11
- /** Wordpress Hooks */
12
- 'wp_head' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
13
- 'wp_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- /** Internal Hooks */
16
- 'genesis_pre' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
17
- 'genesis_pre_framework' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
18
- 'genesis_init' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
19
- 'genesis_setup' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
20
 
21
- /** Document Hooks */
22
- 'genesis_doctype' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
23
- 'genesis_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
24
- 'genesis_meta' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
25
- 'genesis_before' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
26
- 'genesis_after' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
27
 
28
- /** Header hooks */
29
- 'genesis_before_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
30
- 'genesis_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
31
- 'genesis_header_right' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
32
- 'genesis_after_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
33
 
34
- 'genesis_site_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
35
- 'genesis_site_description' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
36
 
37
- /** Content Hooks */
38
- 'genesis_before_content_sidebar_wrap' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
39
- 'genesis_after_content_sidebar_wrap' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
40
 
41
- 'genesis_before_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
42
- 'genesis_after_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
43
 
44
- /** Loop Hooks */
45
- 'genesis_before_loop' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
46
- 'genesis_loop' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
47
- 'genesis_after_loop' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
48
 
49
- 'genesis_after_endwhile' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
50
- 'genesis_loop_else' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
 
 
51
 
52
- /** Post Hooks */
53
- 'genesis_before_post' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
54
- 'genesis_after_post' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
55
 
56
- 'genesis_before_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
57
- 'genesis_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
58
- 'genesis_after_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
59
 
60
- 'genesis_before_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
61
- 'genesis_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
62
- 'genesis_after_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
63
 
64
- /** Comment Hooks */
65
- 'genesis_before_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
66
- 'genesis_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
67
- 'genesis_list_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
68
- 'genesis_after_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
69
 
70
- 'genesis_before_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
71
- 'genesis_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
72
- 'genesis_list_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
73
- 'genesis_after_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
74
 
75
- 'genesis_before_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
76
- 'genesis_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
77
- 'genesis_after_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
78
 
79
- 'genesis_before_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
80
- 'genesis_after_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
 
 
81
 
82
- 'genesis_before_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
83
- 'genesis_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
84
- 'genesis_after_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
85
 
86
- /** Sidebar Hooks */
87
- 'genesis_before_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
88
- 'genesis_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
89
- 'genesis_after_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
90
 
91
- 'genesis_before_sidebar_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
92
- 'genesis_after_sidebar_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
93
 
94
- 'genesis_before_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
95
- 'genesis_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
96
- 'genesis_after_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
97
 
98
- 'genesis_before_sidebar_alt_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
99
- 'genesis_after_sidebar_alt_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
 
100
 
101
- 'genesis_before_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
102
- 'genesis_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
103
- 'genesis_after_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
 
104
 
105
- /** Admin Hooks */
106
- 'genesis_import_export_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
107
- 'genesis_export' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
108
- 'genesis_import' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
109
- 'genesis_theme_settings_metaboxes' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
110
- 'genesis_upgrade' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
111
-
112
- );
113
 
114
- }
 
 
 
115
 
116
- /**
117
- * This registers the settings field and adds defaults to the options table
118
- */
119
- add_action( 'admin_init', 'register_simplehooks_settings' );
120
- function register_simplehooks_settings() {
121
 
122
- register_setting( SIMPLEHOOKS_SETTINGS_FIELD, SIMPLEHOOKS_SETTINGS_FIELD );
123
- add_option( SIMPLEHOOKS_SETTINGS_FIELD, simplehooks_defaults(), '', 'yes' );
124
 
125
- }
126
 
127
- /**
128
- * This is a necessary go-between to get our scripts and boxes loaded
129
- * on the theme settings page only, and not the rest of the admin
130
- */
131
- add_action( 'admin_menu', 'simplehooks_settings_init', 15 );
132
- function simplehooks_settings_init() {
133
 
134
- global $_simplehooks_settings_pagehook;
 
 
 
 
135
 
136
- // Add "Design Settings" submenu
137
- $_simplehooks_settings_pagehook = add_submenu_page( 'genesis', __( 'Genesis - Simple Hooks','simplehooks' ), __( 'Simple Hooks','simplehooks' ), 'manage_options', 'simplehooks', 'simplehooks_settings_admin' );
 
 
138
 
139
- add_action( 'load-'.$_simplehooks_settings_pagehook, 'simplehooks_settings_scripts' );
140
- add_action( 'load-'.$_simplehooks_settings_pagehook, 'simplehooks_settings_boxes' );
 
 
 
141
 
142
- }
 
 
 
 
143
 
144
- function simplehooks_settings_scripts() {
145
- wp_enqueue_script( 'common' );
146
- wp_enqueue_script( 'wp-lists' );
147
- wp_enqueue_script( 'postbox' );
148
- }
149
 
150
- function simplehooks_settings_boxes() {
151
- global $_simplehooks_settings_pagehook;
152
-
153
- add_meta_box( 'simplehooks-wp-hooks', __( 'WordPress Hooks', 'simplehooks' ), 'simplehooks_wp_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
154
- add_meta_box( 'simplehooks-document-hooks', __( 'Document Hooks', 'simplehooks' ), 'simplehooks_document_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
155
- add_meta_box( 'simplehooks-header-hooks', __( 'Header Hooks', 'simplehooks' ), 'simplehooks_header_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
156
- add_meta_box( 'simplehooks-content-hooks', __( 'Content Hooks', 'simplehooks' ), 'simplehooks_content_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
157
- add_meta_box( 'simplehooks-loop-hooks', __( 'Loop Hooks', 'simplehooks' ), 'simplehooks_loop_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
158
- add_meta_box( 'simplehooks-post-hooks', __( 'Post/Page Hooks', 'simplehooks' ), 'simplehooks_post_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
159
- add_meta_box( 'simplehooks-comment-list-hooks', __( 'Comment List Hooks', 'simplehooks' ), 'simplehooks_comment_list_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
160
- add_meta_box( 'simplehooks-ping-list-hooks', __( 'Ping List Hooks', 'simplehooks' ), 'simplehooks_ping_list_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
161
- add_meta_box( 'simplehooks-comment-hooks', __( 'Single Comment Hooks', 'simplehooks' ), 'simplehooks_comment_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
162
- add_meta_box( 'simplehooks-comment-form-hooks', __( 'Comment Form Hooks', 'simplehooks' ), 'simplehooks_comment_form_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
163
- add_meta_box( 'simplehooks-sidebar-hooks', __( 'Sidebar Hooks', 'simplehooks' ), 'simplehooks_sidebar_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
164
- add_meta_box( 'simplehooks-footer-hooks', __( 'Footer Hooks', 'simplehooks' ), 'simplehooks_footer_hooks_box', $_simplehooks_settings_pagehook, 'column1' );
165
- }
166
 
167
- /**
168
- * Tell WordPress that we want only 1 column available for our meta-boxes
169
- */
170
- add_filter( 'screen_layout_columns', 'simplehooks_settings_layout_columns', 10, 2 );
171
- function simplehooks_settings_layout_columns( $columns, $screen ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
- global $_simplehooks_settings_pagehook;
174
 
175
- if ( $screen == $_simplehooks_settings_pagehook ) {
176
- // This page should have 3 column options
177
- $columns[$_simplehooks_settings_pagehook] = 1;
178
  }
179
 
180
- return $columns;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
182
 
 
183
  /**
184
- * This function is what actually gets output to the page. It handles the markup,
185
- * builds the form, outputs necessary JS stuff, and fires <code>do_meta_boxes()</code>
 
186
  */
187
- function simplehooks_settings_admin() {
188
-
189
- global $_simplehooks_settings_pagehook, $screen_layout_columns;
190
-
191
- $width = "width: 99%;";
192
- $hide2 = $hide3 = " display: none;";
193
-
194
- ?>
195
- <div id="simplehooks" class="wrap genesis-metaboxes">
196
- <form method="post" action="options.php">
197
-
198
- <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
199
- <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
200
- <?php settings_fields( SIMPLEHOOKS_SETTINGS_FIELD ); // important! ?>
201
-
202
- <?php screen_icon( 'plugins' ); ?>
203
- <h2>
204
- <?php
205
- echo esc_html( get_admin_page_title() );
206
- submit_button( __( 'Save Settings', 'genesis' ), 'button-primary genesis-h2-button', 'submit', false );
207
- submit_button( __( 'Reset Settings', 'genesis' ), 'button-secondary genesis-h2-button', SIMPLEHOOKS_SETTINGS_FIELD . '[reset]', false, array( 'onclick' => 'return genesis_confirm(\'' . esc_js( __( 'Are you sure you want to reset?', 'genesis' ) ) . '\');' ) );
208
- ?>
209
- </h2>
210
-
211
- <?php
212
- if ( genesis_get_option( 'reset', SIMPLEHOOKS_SETTINGS_FIELD ) ) {
213
- update_option( SIMPLEHOOKS_SETTINGS_FIELD, simplehooks_defaults() );
214
- echo '<div id="message" class="updated" id="message"><p><strong>' . __( 'Modifications Reset', 'simplehooks' ) . '</strong></p></div>';
215
- }
216
- elseif( isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated'] == 'true' ) {
217
- echo '<div id="message" class="updated" id="message"><p><strong>' . __( 'Modifications Saved', 'simplehooks' ) . '</strong></p></div>';
218
- }
219
- ?>
220
-
221
- <div class="metabox-holder">
222
- <div class="postbox-container" style="<?php echo $width; ?>">
223
- <?php do_meta_boxes( $_simplehooks_settings_pagehook, 'column1', null ); ?>
224
- </div>
225
- </div>
226
-
227
- </form>
228
- </div>
229
- <script type="text/javascript">
230
- //<![CDATA[
231
- jQuery(document).ready(function($) {
232
- // close postboxes that should be closed
233
- $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
234
- // postboxes setup
235
- postboxes.add_postbox_toggles('<?php echo $_simplehooks_settings_pagehook; ?>');
236
- });
237
- //]]>
238
- </script>
239
 
240
- <?php
241
  }
1
  <?php
2
  /**
3
+ * This file handles the creation of the Simple Hooks admin menu.
4
+ */
5
+
6
+
7
+ /**
8
+ * Registers a new admin page, providing content and corresponding menu item
9
+ * for the Simple Hooks Settings page.
10
  *
11
+ * @since 1.8.0
12
  */
13
+ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
14
+
15
+ /**
16
+ * Create an admin menu item and settings page.
17
+ *
18
+ * @since 1.8.0
19
+ *
20
+ * @uses SIMPLEHOOKS_SETTINGS_FIELD settings field key
21
+ *
22
+ */
23
+ function __construct() {
24
+
25
+ $page_id = 'simplehooks';
26
+
27
+ $menu_ops = array(
28
+ 'submenu' => array(
29
+ 'parent_slug' => 'genesis',
30
+ 'page_title' => __( 'Genesis - Simple Hooks', 'simplehooks' ),
31
+ 'menu_title' => __( 'Simple Hooks', 'simplehooks' )
32
+ )
33
+ );
34
+
35
+ $page_ops = array(
36
+ 'screen_icon' => 'plugins',
37
+ );
38
+
39
+ $settings_field = SIMPLEHOOKS_SETTINGS_FIELD;
40
+
41
+ $default_settings = array(
42
+
43
+ /** Wordpress Hooks */
44
+ 'wp_head' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
45
+ 'wp_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
46
+
47
+ /** Internal Hooks */
48
+ 'genesis_pre' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
49
+ 'genesis_pre_framework' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
50
+ 'genesis_init' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
51
+ 'genesis_setup' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
52
+
53
+ /** Document Hooks */
54
+ 'genesis_doctype' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
55
+ 'genesis_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
56
+ 'genesis_meta' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
57
+ 'genesis_before' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
58
+ 'genesis_after' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
59
+
60
+ /** Header hooks */
61
+ 'genesis_before_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
62
+ 'genesis_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
63
+ 'genesis_header_right' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
64
+ 'genesis_after_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
65
+
66
+ 'genesis_site_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
67
+ 'genesis_site_description' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
68
+
69
+ /** Content Hooks */
70
+ 'genesis_before_content_sidebar_wrap' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
71
+ 'genesis_after_content_sidebar_wrap' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
72
+
73
+ 'genesis_before_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
74
+ 'genesis_after_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
75
+
76
+ /** Loop Hooks */
77
+ 'genesis_before_loop' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
78
+ 'genesis_loop' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
79
+ 'genesis_after_loop' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
80
+
81
+ 'genesis_after_endwhile' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
82
+ 'genesis_loop_else' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
83
+
84
+ /** Post Hooks */
85
+ 'genesis_before_post' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
86
+ 'genesis_after_post' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
87
+
88
+ 'genesis_before_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
89
+ 'genesis_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
90
+ 'genesis_after_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
91
+
92
+ 'genesis_before_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
93
+ 'genesis_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
94
+ 'genesis_after_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
95
+
96
+ /** Comment Hooks */
97
+ 'genesis_before_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
98
+ 'genesis_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
99
+ 'genesis_list_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
100
+ 'genesis_after_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
101
+
102
+ 'genesis_before_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
103
+ 'genesis_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
104
+ 'genesis_list_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
105
+ 'genesis_after_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
106
+
107
+ 'genesis_before_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
108
+ 'genesis_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
109
+ 'genesis_after_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
110
+
111
+ 'genesis_before_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
112
+ 'genesis_after_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
113
+
114
+ 'genesis_before_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
115
+ 'genesis_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
116
+ 'genesis_after_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
117
+
118
+ /** Sidebar Hooks */
119
+ 'genesis_before_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
120
+ 'genesis_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
121
+ 'genesis_after_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
122
+
123
+ 'genesis_before_sidebar_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
124
+ 'genesis_after_sidebar_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
125
+
126
+ 'genesis_before_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
127
+ 'genesis_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
128
+ 'genesis_after_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
129
+
130
+ 'genesis_before_sidebar_alt_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
131
+ 'genesis_after_sidebar_alt_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
132
+
133
+ 'genesis_before_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
134
+ 'genesis_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
135
+ 'genesis_after_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
136
+
137
+ /** Admin Hooks */
138
+ 'genesis_import_export_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
139
+ 'genesis_export' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
140
+ 'genesis_import' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
141
+ 'genesis_theme_settings_metaboxes' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
142
+ 'genesis_upgrade' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
143
+
144
+ );
145
+
146
+ /** Create the page */
147
+ $this->create( $page_id, $menu_ops, $page_ops, $settings_field, $default_settings );
148
+
149
+ }
150
+
151
+ /**
152
+ * Load the necessary scripts for this admin page.
153
+ *
154
+ * @since 1.8.0
155
+ *
156
+ */
157
+ function scripts() {
158
+
159
+ /** Load parent scripts as well as Genesis admin scripts */
160
+ parent::scripts();
161
+ genesis_load_admin_js();
162
+
163
+ }
164
+
165
+ /**
166
+ * Register meta boxes on the Simple Hooks Settings page.
167
+ *
168
+ * @since 1.8.0
169
+ *
170
+ */
171
+ function metaboxes() {
172
+
173
+ add_meta_box( 'simplehooks-wp-hooks', __( 'WordPress Hooks', 'simplehooks' ), array( $this, 'wp_hooks_box' ), $this->pagehook, 'main' );
174
+ add_meta_box( 'simplehooks-document-hooks', __( 'Document Hooks', 'simplehooks' ), array( $this, 'document_hooks_box' ), $this->pagehook, 'main' );
175
+ add_meta_box( 'simplehooks-header-hooks', __( 'Header Hooks', 'simplehooks' ), array( $this, 'header_hooks_box' ), $this->pagehook, 'main' );
176
+ add_meta_box( 'simplehooks-content-hooks', __( 'Content Hooks', 'simplehooks' ), array( $this, 'content_hooks_box' ), $this->pagehook, 'main' );
177
+ add_meta_box( 'simplehooks-loop-hooks', __( 'Loop Hooks', 'simplehooks' ), array( $this, 'loop_hooks_box' ), $this->pagehook, 'main' );
178
+ add_meta_box( 'simplehooks-post-hooks', __( 'Post/Page Hooks', 'simplehooks' ), array( $this, 'post_hooks_box' ), $this->pagehook, 'main' );
179
+ add_meta_box( 'simplehooks-comment-list-hooks', __( 'Comment List Hooks', 'simplehooks' ), array( $this, 'comment_list_hooks_box' ), $this->pagehook, 'main' );
180
+ add_meta_box( 'simplehooks-ping-list-hooks', __( 'Ping List Hooks', 'simplehooks' ), array( $this, 'ping_list_hooks_box' ), $this->pagehook, 'main' );
181
+ add_meta_box( 'simplehooks-comment-hooks', __( 'Single Comment Hooks', 'simplehooks' ), array( $this, 'comment_hooks_box' ), $this->pagehook, 'main' );
182
+ add_meta_box( 'simplehooks-comment-form-hooks', __( 'Comment Form Hooks', 'simplehooks' ), array( $this, 'comment_form_hooks_box' ), $this->pagehook, 'main' );
183
+ add_meta_box( 'simplehooks-sidebar-hooks', __( 'Sidebar Hooks', 'simplehooks' ), array( $this, 'sidebar_hooks_box' ), $this->pagehook, 'main' );
184
+ add_meta_box( 'simplehooks-footer-hooks', __( 'Footer Hooks', 'simplehooks' ), array( $this, 'footer_hooks_box' ), $this->pagehook, 'main' );
185
 
186
+ }
187
+
188
+ function wp_hooks_box() {
 
 
189
 
190
+ simplehooks_form_generate( array(
191
+ 'hook' => 'wp_head',
192
+ 'desc' => __( 'This hook executes immediately before the closing <code>&lt;/head&gt;</code> tag.', 'simplehooks' )
193
+ ) );
 
 
194
 
195
+ simplehooks_form_generate( array(
196
+ 'hook' => 'wp_footer',
197
+ 'desc' => __( 'This hook executes immediately before the closing <code>&lt;/body&gt;</code> tag.', 'simplehooks' )
198
+ ) );
 
199
 
200
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
 
201
 
202
+ }
 
 
203
 
204
+ function document_hooks_box() {
 
205
 
206
+ simplehooks_form_generate( array(
207
+ 'hook' => 'genesis_title',
208
+ 'desc' => __( 'This hook executes between the main document <code>&lt;title&gt;&lt;/title&gt;</code> tags.', 'simplehooks' )
209
+ ) );
210
 
211
+ simplehooks_form_generate( array(
212
+ 'hook' => 'genesis_meta',
213
+ 'desc' => __( 'This hook executes in the document <code>&lt;head&gt;</code>.<br /> It is commonly used to output <code>META</code> information about the document.', 'simplehooks' ),
214
+ 'unhook' => array( 'genesis_load_favicon' )
215
+ ) );
216
 
217
+ simplehooks_form_generate( array(
218
+ 'hook' => 'genesis_before',
219
+ 'desc' => __( 'This hook executes immediately after the opening <code>&lt;body&gt;</code> tag.', 'simplehooks' )
220
+ ) );
221
 
222
+ simplehooks_form_generate( array(
223
+ 'hook' => 'genesis_after',
224
+ 'desc' => __( 'This hook executes immediately before the closing <code>&lt;/body&gt;</code> tag.', 'simplehooks' )
225
+ ) );
226
 
227
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
 
 
228
 
229
+ }
 
 
 
 
230
 
231
+ function header_hooks_box() {
 
 
 
232
 
233
+ simplehooks_form_generate( array(
234
+ 'hook' => 'genesis_before_header',
235
+ 'desc' => __( 'This hook executes immediately before the header (outside the <code>#header</code> div).', 'simplehooks' )
236
+ ) );
237
 
238
+ simplehooks_form_generate( array(
239
+ 'hook' => 'genesis_header',
240
+ 'desc' => __( 'This hook outputs the default header (the <code>#header</code> div)', 'simplehooks' ),
241
+ 'unhook' => array( 'genesis_do_header' )
242
+ ) );
243
 
244
+ simplehooks_form_generate( array(
245
+ 'hook' => 'genesis_after_header',
246
+ 'desc' => __( 'This hook executes immediately after the header (outside the <code>#header</code> div).', 'simplehooks' )
247
+ ) );
248
 
249
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
 
 
 
250
 
251
+ }
 
252
 
253
+ function content_hooks_box() {
 
 
254
 
255
+ simplehooks_form_generate( array(
256
+ 'hook' => 'genesis_before_content_sidebar_wrap',
257
+ 'desc' => __( 'This hook executes immediately before the div block that wraps the content and the primary sidebar (outside the <code>#content-sidebar-wrap</code> div).', 'simplehooks' )
258
+ ) );
259
 
260
+ simplehooks_form_generate( array(
261
+ 'hook' => 'genesis_after_content_sidebar_wrap',
262
+ 'desc' => __( 'This hook executes immediately after the div block that wraps the content and the primary sidebar (outside the <code>#content-sidebar-wrap</code> div).', 'simplehooks' )
263
+ ) );
264
 
265
+ simplehooks_form_generate( array(
266
+ 'hook' => 'genesis_before_content',
267
+ 'desc' => __( 'This hook executes immediately before the content column (outside the <code>#content</code> div).', 'simplehooks' )
268
+ ) );
 
 
 
 
269
 
270
+ simplehooks_form_generate( array(
271
+ 'hook' => 'genesis_after_content',
272
+ 'desc' => __( 'This hook executes immediately after the content column (outside the <code>#content</code> div).', 'simplehooks' )
273
+ ) );
274
 
275
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
 
 
 
 
276
 
277
+ }
 
278
 
279
+ function loop_hooks_box() {
280
 
281
+ simplehooks_form_generate( array(
282
+ 'hook' => 'genesis_before_loop',
283
+ 'desc' => __( 'This hook executes immediately before all loop blocks.<br /> Therefore, this hook falls outside the loop, and cannot execute functions that require loop template tags or variables.', 'simplehooks' )
284
+ ) );
 
 
285
 
286
+ simplehooks_form_generate( array(
287
+ 'hook' => 'genesis_loop',
288
+ 'desc' => __( 'This hook executes both default and custom loops.', 'simplehooks' ),
289
+ 'unhook' => array( 'genesis_do_loop' )
290
+ ) );
291
 
292
+ simplehooks_form_generate( array(
293
+ 'hook' => 'genesis_after_loop',
294
+ 'desc' => __( 'This hook executes immediately after all loop blocks.<br /> Therefore, this hook falls outside the loop, and cannot execute functions that require loop template tags or variables.', 'simplehooks' )
295
+ ) );
296
 
297
+ simplehooks_form_generate( array(
298
+ 'hook' => 'genesis_after_endwhile',
299
+ 'desc' => __( 'This hook executes after the <code>endwhile;</code> statement.', 'simplehooks' ),
300
+ 'unhook' => array( 'genesis_posts_nav' )
301
+ ) );
302
 
303
+ simplehooks_form_generate( array(
304
+ 'hook' => 'genesis_loop_else',
305
+ 'desc' => __( 'This hook executes after the <code>else :</code> statement in all loop blocks. The content attached to this hook will only display if there are no posts available when a loop is executed.', 'simplehooks' ),
306
+ 'unhook' => array( 'genesis_do_noposts' )
307
+ ) );
308
 
309
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
 
 
 
 
310
 
311
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
 
313
+ function post_hooks_box() {
314
+
315
+ simplehooks_form_generate( array(
316
+ 'hook' => 'genesis_before_post',
317
+ 'desc' => __( 'This hook executes before each post in all loop blocks (outside the <code>post_class()</code> div).', 'simplehooks' )
318
+ ) );
319
+
320
+ simplehooks_form_generate( array(
321
+ 'hook' => 'genesis_after_post',
322
+ 'desc' => __( 'This hook executes after each post in all loop blocks (outside the <code>post_class()</code> div).', 'simplehooks' ),
323
+ 'unhook' => array( 'genesis_do_author_box' )
324
+ ) );
325
+
326
+ simplehooks_form_generate( array(
327
+ 'hook' => 'genesis_before_post_title',
328
+ 'desc' => __( 'This hook executes immediately before each post/page title within the loop.', 'simplehooks' )
329
+ ) );
330
+
331
+ simplehooks_form_generate( array(
332
+ 'hook' => 'genesis_post_title',
333
+ 'desc' => __( 'This hook outputs the post/page title.', 'simplehooks' ),
334
+ 'unhook' => array( 'genesis_do_post_title' )
335
+ ) );
336
+
337
+ simplehooks_form_generate( array(
338
+ 'hook' => 'genesis_after_post_title',
339
+ 'desc' => __( 'This hook executes immediately after each post/page title within the loop.', 'simplehooks' )
340
+ ) );
341
+
342
+ simplehooks_form_generate( array(
343
+ 'hook' => 'genesis_before_post_content',
344
+ 'desc' => __( 'This hook executes immediately before the <code>genesis_post_content</code> hook for each post/page within the loop.', 'simplehooks' ),
345
+ 'unhook' => array( 'genesis_post_info' )
346
+ ) );
347
+
348
+ simplehooks_form_generate( array(
349
+ 'hook' => 'genesis_post_content',
350
+ 'desc' => __( 'This hook outputs the content of the post/page, by default.', 'simplehooks' ),
351
+ 'unhook' => array( 'genesis_do_post_image', 'genesis_do_post_content' )
352
+ ) );
353
+
354
+ simplehooks_form_generate( array(
355
+ 'hook' => 'genesis_after_post_content',
356
+ 'desc' => __( 'This hook executes immediately after the <code>genesis_post_content</code> hook for each post/page within the loop.', 'simplehooks' ),
357
+ 'unhook' => array( 'genesis_post_meta' )
358
+ ) );
359
+
360
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
361
+
362
+ }
363
+
364
+ function comment_list_hooks_box() {
365
+
366
+ simplehooks_form_generate( array(
367
+ 'hook' => 'genesis_before_comments',
368
+ 'desc' => __( 'This hook executes immediately before the comments block (outside the <code>#comments</code> div).', 'simplehooks' )
369
+ ) );
370
+
371
+ simplehooks_form_generate( array(
372
+ 'hook' => 'genesis_comments',
373
+ 'desc' => __( 'This hook outputs the comments block, including the <code>#comments</code> div.', 'simplehooks' ),
374
+ 'unhook' => array( 'genesis_do_comments' )
375
+ ) );
376
+
377
+ simplehooks_form_generate( array(
378
+ 'hook' => 'genesis_list_comments',
379
+ 'desc' => __( 'This hook executes inside the comments block, inside the <code>.comment-list</code> OL. By default, it outputs a list of comments associated with a post via the <code>genesis_default_list_comments()</code> function.', 'simplehooks' ),
380
+ 'unhook' => array( 'genesis_default_list_comments' )
381
+ ) );
382
+
383
+ simplehooks_form_generate( array(
384
+ 'hook' => 'genesis_after_comments',
385
+ 'desc' => __( 'This hook executes immediately after the comments block (outside the <code>#comments</code> div).', 'simplehooks' )
386
+ ) );
387
+
388
+ }
389
+
390
+ function ping_list_hooks_box() {
391
+
392
+ simplehooks_form_generate( array(
393
+ 'hook' => 'genesis_before_pings',
394
+ 'desc' => __( 'This hook executes immediately before the pings block (outside the <code>#pings</code> div).', 'simplehooks' ),
395
+ 'unhook' => array( 'genesis_do_pings' )
396
+ ) );
397
+
398
+ simplehooks_form_generate( array(
399
+ 'hook' => 'genesis_pings',
400
+ 'desc' => __( 'This hook outputs the pings block, including the <code>#pings</code> div.', 'simplehooks' )
401
+ ) );
402
+
403
+ simplehooks_form_generate( array(
404
+ 'hook' => 'genesis_list_pings',
405
+ 'desc' => __( 'This hook executes inside the pings block, inside the <code>.ping-list</code> OL. By default, it outputs a list of pings associated with a post via the <code>genesis_default_list_pings()</code> function.', 'simplehooks' ),
406
+ 'unhook' => array( 'genesis_default_list_pings' )
407
+ ) );
408
+
409
+ simplehooks_form_generate( array(
410
+ 'hook' => 'genesis_after_pings',
411
+ 'desc' => __( 'This hook executes immediately after the pings block (outside the <code>#pings</code> div).', 'simplehooks' )
412
+ ) );
413
+
414
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
415
+
416
+ }
417
+
418
+ function comment_hooks_box() {
419
+
420
+ simplehooks_form_generate( array(
421
+ 'hook' => 'genesis_before_comment',
422
+ 'desc' => __( 'This hook executes immediately before each individual comment (inside the <code>.comment</code> list item).', 'simplehooks' )
423
+ ) );
424
+
425
+ simplehooks_form_generate( array(
426
+ 'hook' => 'genesis_after_comment',
427
+ 'desc' => __( 'This hook executes immediately after each individual comment (inside the <code>.comment</code> list item).', 'simplehooks' )
428
+ ) );
429
 
430
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
431
 
 
 
 
432
  }
433
 
434
+ function comment_form_hooks_box() {
435
+
436
+ simplehooks_form_generate( array(
437
+ 'hook' => 'genesis_before_comment_form',
438
+ 'desc' => __( 'This hook executes immediately before the comment form, outside the <code>#respond</code> div.', 'simplehooks' )
439
+ ) );
440
+
441
+ simplehooks_form_generate( array(
442
+ 'hook' => 'genesis_comment_form',
443
+ 'desc' => __( 'This hook outputs the entire comment form, including the <code>#respond</code> div.', 'simplehooks' ),
444
+ 'unhook' => array( 'genesis_do_comment_form' )
445
+ ) );
446
+
447
+ simplehooks_form_generate( array(
448
+ 'hook' => 'genesis_after_comment_form',
449
+ 'desc' => __( 'This hook executes immediately after the comment form, outside the <code>#respond</code> div.', 'simplehooks' )
450
+ ) );
451
+
452
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
453
+
454
+ }
455
+
456
+ function sidebar_hooks_box() {
457
+
458
+ simplehooks_form_generate( array(
459
+ 'hook' => 'genesis_before_sidebar',
460
+ 'desc' => __( 'This hook executes immediately before the primary sidebar column (outside the <code>#sidebar</code> div).', 'simplehooks' )
461
+ ) );
462
+
463
+ simplehooks_form_generate( array(
464
+ 'hook' => 'genesis_sidebar',
465
+ 'desc' => __( 'This hook outputs the content of the primary sidebar, including the widget area output.', 'simplehooks' ),
466
+ 'unhook' => array( 'genesis_do_sidebar' )
467
+ ) );
468
+
469
+ simplehooks_form_generate( array(
470
+ 'hook' => 'genesis_after_sidebar',
471
+ 'desc' => __( 'This hook executes immediately after the primary sidebar column (outside the <code>#sidebar</code> div).', 'simplehooks' )
472
+ ) );
473
+
474
+ simplehooks_form_generate( array(
475
+ 'hook' => 'genesis_before_sidebar_widget_area',
476
+ 'desc' => __( 'This hook executes immediately before the primary sidebar widget area (inside the <code>#sidebar</code> div).', 'simplehooks' )
477
+ ) );
478
+
479
+ simplehooks_form_generate( array(
480
+ 'hook' => 'genesis_after_sidebar_widget_area',
481
+ 'desc' => __( 'This hook executes immediately after the primary sidebar widget area (inside the <code>#sidebar</code> div).', 'simplehooks' )
482
+ ) );
483
+
484
+ simplehooks_form_generate( array(
485
+ 'hook' => 'genesis_before_sidebar_alt',
486
+ 'desc' => __( 'This hook executes immediately before the alternate sidebar column (outside the <code>#sidebar-alt</code> div).', 'simplehooks' )
487
+ ) );
488
+
489
+ simplehooks_form_generate( array(
490
+ 'hook' => 'genesis_sidebar_alt',
491
+ 'desc' => __( 'This hook outputs the content of the secondary sidebar, including the widget area output.', 'simplehooks' ),
492
+ 'unhook' => array( 'genesis_do_sidebar_alt' )
493
+ ) );
494
+
495
+ simplehooks_form_generate( array(
496
+ 'hook' => 'genesis_after_sidebar_alt',
497
+ 'desc' => __( 'This hook executes immediately after the alternate sidebar column (outside the <code>#sidebar-alt</code> div).', 'simplehooks' )
498
+ ) );
499
+
500
+ simplehooks_form_generate( array(
501
+ 'hook' => 'genesis_before_sidebar_alt_widget_area',
502
+ 'desc' => __( 'This hook executes immediately before the alternate sidebar widget area (inside the <code>#sidebar-alt</code> div).', 'simplehooks' )
503
+ ) );
504
+
505
+ simplehooks_form_generate( array(
506
+ 'hook' => 'genesis_after_sidebar_alt_widget_area',
507
+ 'desc' => __( 'This hook executes immediately after the alternate sidebar widget area (inside the <code>#sidebar-alt</code> div).', 'simplehooks' )
508
+ ) );
509
+
510
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
511
+
512
+ }
513
+
514
+ function footer_hooks_box() {
515
+
516
+ simplehooks_form_generate( array(
517
+ 'hook' => 'genesis_before_footer',
518
+ 'desc' => __( 'This hook executes immediately before the footer (outside the <code>#footer</code> div).', 'simplehooks' )
519
+ ) );
520
+
521
+ simplehooks_form_generate( array(
522
+ 'hook' => 'genesis_footer',
523
+ 'desc' => __( 'This hook, by default, outputs the content of the footer (inside the <code>#footer</code> div).', 'simplehooks' ),
524
+ 'unhook' => array( 'genesis_do_footer' )
525
+ ) );
526
+
527
+ simplehooks_form_generate( array(
528
+ 'hook' => 'genesis_after_footer',
529
+ 'desc' => __( 'This hook executes immediately after the footer (outside the <code>#footer</code> div).', 'simplehooks' )
530
+ ) );
531
+
532
+ submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
533
+
534
+ }
535
+
536
  }
537
 
538
+ add_action( 'genesis_admin_menu', 'simplehooks_settings_menu' );
539
  /**
540
+ * Instantiate the class to create the menu.
541
+ *
542
+ * @since 1.8.0
543
  */
544
+ function simplehooks_settings_menu() {
545
+
546
+ new Genesis_Simple_Hooks_Admin;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
 
 
548
  }
boxes.php DELETED
@@ -1,367 +0,0 @@
1
- <?php
2
- /**
3
- * This next section defines functions that contain the content of the "boxes" that will be
4
- * output by default on the "SEO Settings" page. There's a bunch of them.
5
- *
6
- */
7
-
8
- function simplehooks_wp_hooks_box() {
9
-
10
- simplehooks_form_generate( array(
11
- 'hook' => 'wp_head',
12
- 'desc' => __( 'This hook executes immediately before the closing <code>&lt;/head&gt;</code> tag.', 'simplehooks' )
13
- ) );
14
-
15
- simplehooks_form_generate( array(
16
- 'hook' => 'wp_footer',
17
- 'desc' => __( 'This hook executes immediately before the closing <code>&lt;/body&gt;</code> tag.', 'simplehooks' )
18
- ) );
19
-
20
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
21
-
22
- }
23
-
24
- function simplehooks_document_hooks_box() {
25
-
26
- simplehooks_form_generate( array(
27
- 'hook' => 'genesis_title',
28
- 'desc' => __( 'This hook executes between the main document <code>&lt;title&gt;&lt;/title&gt;</code> tags.', 'simplehooks' )
29
- ) );
30
-
31
- simplehooks_form_generate( array(
32
- 'hook' => 'genesis_meta',
33
- 'desc' => __( 'This hook executes in the document <code>&lt;head&gt;</code>.<br /> It is commonly used to output <code>META</code> information about the document.', 'simplehooks' ),
34
- 'unhook' => array( 'genesis_load_favicon' )
35
- ) );
36
-
37
- simplehooks_form_generate( array(
38
- 'hook' => 'genesis_before',
39
- 'desc' => __( 'This hook executes immediately after the opening <code>&lt;body&gt;</code> tag.', 'simplehooks' )
40
- ) );
41
-
42
- simplehooks_form_generate( array(
43
- 'hook' => 'genesis_after',
44
- 'desc' => __( 'This hook executes immediately before the closing <code>&lt;/body&gt;</code> tag.', 'simplehooks' )
45
- ) );
46
-
47
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
48
-
49
- }
50
-
51
- function simplehooks_header_hooks_box() {
52
-
53
- simplehooks_form_generate( array(
54
- 'hook' => 'genesis_before_header',
55
- 'desc' => __( 'This hook executes immediately before the header (outside the <code>#header</code> div).', 'simplehooks' )
56
- ) );
57
-
58
- simplehooks_form_generate( array(
59
- 'hook' => 'genesis_header',
60
- 'desc' => __( 'This hook outputs the default header (the <code>#header</code> div)', 'simplehooks' ),
61
- 'unhook' => array( 'genesis_do_header' )
62
- ) );
63
-
64
- simplehooks_form_generate( array(
65
- 'hook' => 'genesis_after_header',
66
- 'desc' => __( 'This hook executes immediately after the header (outside the <code>#header</code> div).', 'simplehooks' )
67
- ) );
68
-
69
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
70
-
71
- }
72
-
73
- function simplehooks_content_hooks_box() {
74
-
75
- simplehooks_form_generate( array(
76
- 'hook' => 'genesis_before_content_sidebar_wrap',
77
- 'desc' => __( 'This hook executes immediately before the div block that wraps the content and the primary sidebar (outside the <code>#content-sidebar-wrap</code> div).', 'simplehooks' )
78
- ) );
79
-
80
- simplehooks_form_generate( array(
81
- 'hook' => 'genesis_after_content_sidebar_wrap',
82
- 'desc' => __( 'This hook executes immediately after the div block that wraps the content and the primary sidebar (outside the <code>#content-sidebar-wrap</code> div).', 'simplehooks' )
83
- ) );
84
-
85
- simplehooks_form_generate( array(
86
- 'hook' => 'genesis_before_content',
87
- 'desc' => __( 'This hook executes immediately before the content column (outside the <code>#content</code> div).', 'simplehooks' )
88
- ) );
89
-
90
- simplehooks_form_generate( array(
91
- 'hook' => 'genesis_after_content',
92
- 'desc' => __( 'This hook executes immediately after the content column (outside the <code>#content</code> div).', 'simplehooks' )
93
- ) );
94
-
95
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
96
-
97
- }
98
-
99
- function simplehooks_loop_hooks_box() {
100
-
101
- simplehooks_form_generate( array(
102
- 'hook' => 'genesis_before_loop',
103
- 'desc' => __( 'This hook executes immediately before all loop blocks.<br /> Therefore, this hook falls outside the loop, and cannot execute functions that require loop template tags or variables.', 'simplehooks' )
104
- ) );
105
-
106
- simplehooks_form_generate( array(
107
- 'hook' => 'genesis_loop',
108
- 'desc' => __( 'This hook executes both default and custom loops.', 'simplehooks' ),
109
- 'unhook' => array( 'genesis_do_loop' )
110
- ) );
111
-
112
- simplehooks_form_generate( array(
113
- 'hook' => 'genesis_after_loop',
114
- 'desc' => __( 'This hook executes immediately after all loop blocks.<br /> Therefore, this hook falls outside the loop, and cannot execute functions that require loop template tags or variables.', 'simplehooks' )
115
- ) );
116
-
117
- simplehooks_form_generate( array(
118
- 'hook' => 'genesis_after_endwhile',
119
- 'desc' => __( 'This hook executes after the <code>endwhile;</code> statement.', 'simplehooks' ),
120
- 'unhook' => array( 'genesis_posts_nav' )
121
- ) );
122
-
123
- simplehooks_form_generate( array(
124
- 'hook' => 'genesis_loop_else',
125
- 'desc' => __( 'This hook executes after the <code>else :</code> statement in all loop blocks. The content attached to this hook will only display if there are no posts available when a loop is executed.', 'simplehooks' ),
126
- 'unhook' => array( 'genesis_do_noposts' )
127
- ) );
128
-
129
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
130
-
131
- }
132
-
133
- function simplehooks_post_hooks_box() {
134
-
135
- simplehooks_form_generate( array(
136
- 'hook' => 'genesis_before_post',
137
- 'desc' => __( 'This hook executes before each post in all loop blocks (outside the <code>post_class()</code> div).', 'simplehooks' )
138
- ) );
139
-
140
- simplehooks_form_generate( array(
141
- 'hook' => 'genesis_after_post',
142
- 'desc' => __( 'This hook executes after each post in all loop blocks (outside the <code>post_class()</code> div).', 'simplehooks' ),
143
- 'unhook' => array( 'genesis_do_author_box' )
144
- ) );
145
-
146
- simplehooks_form_generate( array(
147
- 'hook' => 'genesis_before_post_title',
148
- 'desc' => __( 'This hook executes immediately before each post/page title within the loop.', 'simplehooks' )
149
- ) );
150
-
151
- simplehooks_form_generate( array(
152
- 'hook' => 'genesis_post_title',
153
- 'desc' => __( 'This hook outputs the post/page title.', 'simplehooks' ),
154
- 'unhook' => array( 'genesis_do_post_title' )
155
- ) );
156
-
157
- simplehooks_form_generate( array(
158
- 'hook' => 'genesis_after_post_title',
159
- 'desc' => __( 'This hook executes immediately after each post/page title within the loop.', 'simplehooks' )
160
- ) );
161
-
162
- simplehooks_form_generate( array(
163
- 'hook' => 'genesis_before_post_content',
164
- 'desc' => __( 'This hook executes immediately before the <code>genesis_post_content</code> hook for each post/page within the loop.', 'simplehooks' ),
165
- 'unhook' => array( 'genesis_post_info' )
166
- ) );
167
-
168
- simplehooks_form_generate( array(
169
- 'hook' => 'genesis_post_content',
170
- 'desc' => __( 'This hook outputs the content of the post/page, by default.', 'simplehooks' ),
171
- 'unhook' => array( 'genesis_do_post_image', 'genesis_do_post_content' )
172
- ) );
173
-
174
- simplehooks_form_generate( array(
175
- 'hook' => 'genesis_after_post_content',
176
- 'desc' => __( 'This hook executes immediately after the <code>genesis_post_content</code> hook for each post/page within the loop.', 'simplehooks' ),
177
- 'unhook' => array( 'genesis_post_meta' )
178
- ) );
179
-
180
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
181
-
182
- }
183
-
184
- function simplehooks_comment_list_hooks_box() {
185
-
186
- simplehooks_form_generate( array(
187
- 'hook' => 'genesis_before_comments',
188
- 'desc' => __( 'This hook executes immediately before the comments block (outside the <code>#comments</code> div).', 'simplehooks' )
189
- ) );
190
-
191
- simplehooks_form_generate( array(
192
- 'hook' => 'genesis_comments',
193
- 'desc' => __( 'This hook outputs the comments block, including the <code>#comments</code> div.', 'simplehooks' ),
194
- 'unhook' => array( 'genesis_do_comments' )
195
- ) );
196
-
197
- simplehooks_form_generate( array(
198
- 'hook' => 'genesis_list_comments',
199
- 'desc' => __( 'This hook executes inside the comments block, inside the <code>.comment-list</code> OL. By default, it outputs a list of comments associated with a post via the <code>genesis_default_list_comments()</code> function.', 'simplehooks' ),
200
- 'unhook' => array( 'genesis_default_list_comments' )
201
- ) );
202
-
203
- simplehooks_form_generate( array(
204
- 'hook' => 'genesis_after_comments',
205
- 'desc' => __( 'This hook executes immediately after the comments block (outside the <code>#comments</code> div).', 'simplehooks' )
206
- ) );
207
-
208
- }
209
-
210
- function simplehooks_ping_list_hooks_box() {
211
-
212
- simplehooks_form_generate( array(
213
- 'hook' => 'genesis_before_pings',
214
- 'desc' => __( 'This hook executes immediately before the pings block (outside the <code>#pings</code> div).', 'simplehooks' ),
215
- 'unhook' => array( 'genesis_do_pings' )
216
- ) );
217
-
218
- simplehooks_form_generate( array(
219
- 'hook' => 'genesis_pings',
220
- 'desc' => __( 'This hook outputs the pings block, including the <code>#pings</code> div.', 'simplehooks' )
221
- ) );
222
-
223
- simplehooks_form_generate( array(
224
- 'hook' => 'genesis_list_pings',
225
- 'desc' => __( 'This hook executes inside the pings block, inside the <code>.ping-list</code> OL. By default, it outputs a list of pings associated with a post via the <code>genesis_default_list_pings()</code> function.', 'simplehooks' ),
226
- 'unhook' => array( 'genesis_default_list_pings' )
227
- ) );
228
-
229
- simplehooks_form_generate( array(
230
- 'hook' => 'genesis_after_pings',
231
- 'desc' => __( 'This hook executes immediately after the pings block (outside the <code>#pings</code> div).', 'simplehooks' )
232
- ) );
233
-
234
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
235
-
236
- }
237
-
238
- function simplehooks_comment_hooks_box() {
239
-
240
- simplehooks_form_generate( array(
241
- 'hook' => 'genesis_before_comment',
242
- 'desc' => __( 'This hook executes immediately before each individual comment (inside the <code>.comment</code> list item).', 'simplehooks' )
243
- ) );
244
-
245
- simplehooks_form_generate( array(
246
- 'hook' => 'genesis_after_comment',
247
- 'desc' => __( 'This hook executes immediately after each individual comment (inside the <code>.comment</code> list item).', 'simplehooks' )
248
- ) );
249
-
250
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
251
-
252
- }
253
-
254
- function simplehooks_comment_form_hooks_box() {
255
-
256
- simplehooks_form_generate( array(
257
- 'hook' => 'genesis_before_comment_form',
258
- 'desc' => __( 'This hook executes immediately before the comment form, outside the <code>#respond</code> div.', 'simplehooks' )
259
- ) );
260
-
261
- simplehooks_form_generate( array(
262
- 'hook' => 'genesis_comment_form',
263
- 'desc' => __( 'This hook outputs the entire comment form, including the <code>#respond</code> div.', 'simplehooks' ),
264
- 'unhook' => array( 'genesis_do_comment_form' )
265
- ) );
266
-
267
- simplehooks_form_generate( array(
268
- 'hook' => 'genesis_after_comment_form',
269
- 'desc' => __( 'This hook executes immediately after the comment form, outside the <code>#respond</code> div.', 'simplehooks' )
270
- ) );
271
-
272
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
273
-
274
- }
275
-
276
- function simplehooks_sidebar_hooks_box() {
277
-
278
- simplehooks_form_generate( array(
279
- 'hook' => 'genesis_before_sidebar',
280
- 'desc' => __( 'This hook executes immediately before the primary sidebar column (outside the <code>#sidebar</code> div).', 'simplehooks' )
281
- ) );
282
-
283
- simplehooks_form_generate( array(
284
- 'hook' => 'genesis_sidebar',
285
- 'desc' => __( 'This hook outputs the content of the primary sidebar, including the widget area output.', 'simplehooks' ),
286
- 'unhook' => array( 'genesis_do_sidebar' )
287
- ) );
288
-
289
- simplehooks_form_generate( array(
290
- 'hook' => 'genesis_after_sidebar',
291
- 'desc' => __( 'This hook executes immediately after the primary sidebar column (outside the <code>#sidebar</code> div).', 'simplehooks' )
292
- ) );
293
-
294
- simplehooks_form_generate( array(
295
- 'hook' => 'genesis_before_sidebar_widget_area',
296
- 'desc' => __( 'This hook executes immediately before the primary sidebar widget area (inside the <code>#sidebar</code> div).', 'simplehooks' )
297
- ) );
298
-
299
- simplehooks_form_generate( array(
300
- 'hook' => 'genesis_after_sidebar_widget_area',
301
- 'desc' => __( 'This hook executes immediately after the primary sidebar widget area (inside the <code>#sidebar</code> div).', 'simplehooks' )
302
- ) );
303
-
304
- simplehooks_form_generate( array(
305
- 'hook' => 'genesis_before_sidebar_alt',
306
- 'desc' => __( 'This hook executes immediately before the alternate sidebar column (outside the <code>#sidebar-alt</code> div).', 'simplehooks' )
307
- ) );
308
-
309
- simplehooks_form_generate( array(
310
- 'hook' => 'genesis_sidebar_alt',
311
- 'desc' => __( 'This hook outputs the content of the secondary sidebar, including the widget area output.', 'simplehooks' ),
312
- 'unhook' => array( 'genesis_do_sidebar_alt' )
313
- ) );
314
-
315
- simplehooks_form_generate( array(
316
- 'hook' => 'genesis_after_sidebar_alt',
317
- 'desc' => __( 'This hook executes immediately after the alternate sidebar column (outside the <code>#sidebar-alt</code> div).', 'simplehooks' )
318
- ) );
319
-
320
- simplehooks_form_generate( array(
321
- 'hook' => 'genesis_before_sidebar_alt_widget_area',
322
- 'desc' => __( 'This hook executes immediately before the alternate sidebar widget area (inside the <code>#sidebar-alt</code> div).', 'simplehooks' )
323
- ) );
324
-
325
- simplehooks_form_generate( array(
326
- 'hook' => 'genesis_after_sidebar_alt_widget_area',
327
- 'desc' => __( 'This hook executes immediately after the alternate sidebar widget area (inside the <code>#sidebar-alt</code> div).', 'simplehooks' )
328
- ) );
329
-
330
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
331
-
332
- }
333
-
334
- function simplehooks_footer_hooks_box() {
335
-
336
- simplehooks_form_generate( array(
337
- 'hook' => 'genesis_before_footer',
338
- 'desc' => __( 'This hook executes immediately before the footer (outside the <code>#footer</code> div).', 'simplehooks' )
339
- ) );
340
-
341
- simplehooks_form_generate( array(
342
- 'hook' => 'genesis_footer',
343
- 'desc' => __( 'This hook, by default, outputs the content of the footer (inside the <code>#footer</code> div).', 'simplehooks' ),
344
- 'unhook' => array( 'genesis_do_footer' )
345
- ) );
346
-
347
- simplehooks_form_generate( array(
348
- 'hook' => 'genesis_after_footer',
349
- 'desc' => __( 'This hook executes immediately after the footer (outside the <code>#footer</code> div).', 'simplehooks' )
350
- ) );
351
-
352
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
353
-
354
- }
355
-
356
- /* Sample box and box content
357
- function simplehooks__hooks_box() {
358
-
359
- simplehooks_form_generate(array(
360
- 'hook' => 'genesis_',
361
- 'desc' => __( '', 'simplehooks' )
362
- ) );
363
-
364
- submit_button( __( 'Save Changes', 'simplehooks' ), 'primary' );
365
-
366
- }
367
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin.php CHANGED
@@ -6,12 +6,16 @@
6
  Author: Nathan Rice
7
  Author URI: http://www.nathanrice.net/
8
 
9
- Version: 1.7.1
10
 
11
  License: GNU General Public License v2.0 (or later)
12
  License URI: http://www.opensource.org/licenses/gpl-license.php
13
  */
14
 
 
 
 
 
15
  register_activation_hook( __FILE__, 'simplehooks_activation' );
16
  /**
17
  * This function runs on plugin activation. It checks to make sure the required
@@ -21,50 +25,66 @@ register_activation_hook( __FILE__, 'simplehooks_activation' );
21
  */
22
  function simplehooks_activation() {
23
 
24
- $latest = '1.7.1';
25
 
26
  $theme_info = get_theme_data( TEMPLATEPATH . '/style.css' );
27
 
28
  if ( 'genesis' != basename( TEMPLATEPATH ) ) {
29
  deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
30
- wp_die( sprintf( __( 'Sorry, you can\'t activate unless you have installed <a href="%s">Genesis</a>', 'apl' ), 'http://www.studiopress.com/themes/genesis' ) );
31
  }
32
 
33
  if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
34
  deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
35
- wp_die( sprintf( __( 'Sorry, you cannot activate without <a href="%s">Genesis %s</a> or greater', 'apl' ), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) );
36
  }
37
 
38
  }
39
 
40
- // Define our constants
41
- define( 'SIMPLEHOOKS_SETTINGS_FIELD', 'simplehooks-settings' );
42
- define( 'SIMPLEHOOKS_PLUGIN_DIR', dirname( __FILE__ ) );
 
 
 
 
 
 
 
 
 
 
43
 
44
- // Include files
45
- require_once( SIMPLEHOOKS_PLUGIN_DIR . '/admin.php' );
46
- require_once( SIMPLEHOOKS_PLUGIN_DIR . '/functions.php' );
47
- require_once( SIMPLEHOOKS_PLUGIN_DIR . '/boxes.php' );
 
 
 
 
48
 
 
49
  /**
50
  * The following code loops through all the hooks, and attempts to
51
  * execute the code in the proper location.
52
  *
 
 
53
  * @since 0.1
54
  */
55
- add_action( 'genesis_init', 'simplehooks_execute_hooks', 20 );
56
  function simplehooks_execute_hooks() {
57
 
58
  $hooks = get_option( SIMPLEHOOKS_SETTINGS_FIELD );
59
 
60
  foreach ( (array) $hooks as $hook => $array ) {
61
 
62
- // Add new content to hook
63
  if ( simplehooks_get_option( $hook, 'content' ) ) {
64
  add_action( $hook, 'simplehooks_execute_hook' );
65
  }
66
 
67
- // Unhook stuff
68
  if ( isset( $array['unhook'] ) ) {
69
 
70
  foreach( (array) $array['unhook'] as $function ) {
@@ -83,6 +103,8 @@ function simplehooks_execute_hooks() {
83
  * The following function executes any code meant to be hooked.
84
  * It checks to see if shortcodes or PHP should be executed as well.
85
  *
 
 
86
  * @since 0.1
87
  */
88
  function simplehooks_execute_hook() {
6
  Author: Nathan Rice
7
  Author URI: http://www.nathanrice.net/
8
 
9
+ Version: 1.8.0
10
 
11
  License: GNU General Public License v2.0 (or later)
12
  License URI: http://www.opensource.org/licenses/gpl-license.php
13
  */
14
 
15
+ /** Define our constants */
16
+ define( 'SIMPLEHOOKS_SETTINGS_FIELD', 'simplehooks-settings' );
17
+ define( 'SIMPLEHOOKS_PLUGIN_DIR', dirname( __FILE__ ) );
18
+
19
  register_activation_hook( __FILE__, 'simplehooks_activation' );
20
  /**
21
  * This function runs on plugin activation. It checks to make sure the required
25
  */
26
  function simplehooks_activation() {
27
 
28
+ $latest = '1.8.0';
29
 
30
  $theme_info = get_theme_data( TEMPLATEPATH . '/style.css' );
31
 
32
  if ( 'genesis' != basename( TEMPLATEPATH ) ) {
33
  deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
34
+ wp_die( sprintf( __( 'Sorry, you can\'t activate unless you have installed <a href="%s">Genesis</a>', 'simplehooks' ), 'http://www.studiopress.com/themes/genesis' ) );
35
  }
36
 
37
  if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
38
  deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
39
+ wp_die( sprintf( __( 'Sorry, you cannot activate without <a href="%s">Genesis %s</a> or greater', 'simplehooks' ), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) );
40
  }
41
 
42
  }
43
 
44
+ add_action( 'genesis_init', 'simplehooks_init', 20 );
45
+ /**
46
+ * Load admin menu and helper functions. Hooked to `genesis_init`.
47
+ *
48
+ * @since 1.8.0
49
+ */
50
+ function simplehooks_init() {
51
+
52
+ /** Verify version */
53
+ if ( version_compare( PARENT_THEME_VERSION, '1.8.0', '<' ) ) {
54
+ deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
55
+ wp_die( sprintf( __( 'Sorry, this version of Simple Hooks requires WordPress 3.3 (or later) and Genesis %s (or later).', 'simplehooks' ), $latest ) );
56
+ }
57
 
58
+ /** Admin Menu */
59
+ if ( is_admin() )
60
+ require_once( SIMPLEHOOKS_PLUGIN_DIR . '/admin.php' );
61
+
62
+ /** Helper function */
63
+ require_once( SIMPLEHOOKS_PLUGIN_DIR . '/functions.php' );
64
+
65
+ }
66
 
67
+ add_action( 'genesis_init', 'simplehooks_execute_hooks', 20 );
68
  /**
69
  * The following code loops through all the hooks, and attempts to
70
  * execute the code in the proper location.
71
  *
72
+ * @uses simplehooks_execute_hook() as a callback.
73
+ *
74
  * @since 0.1
75
  */
 
76
  function simplehooks_execute_hooks() {
77
 
78
  $hooks = get_option( SIMPLEHOOKS_SETTINGS_FIELD );
79
 
80
  foreach ( (array) $hooks as $hook => $array ) {
81
 
82
+ /** Add new content to hook */
83
  if ( simplehooks_get_option( $hook, 'content' ) ) {
84
  add_action( $hook, 'simplehooks_execute_hook' );
85
  }
86
 
87
+ /** Unhook stuff */
88
  if ( isset( $array['unhook'] ) ) {
89
 
90
  foreach( (array) $array['unhook'] as $function ) {
103
  * The following function executes any code meant to be hooked.
104
  * It checks to see if shortcodes or PHP should be executed as well.
105
  *
106
+ * @uses simplehooks_get_option()
107
+ *
108
  * @since 0.1
109
  */
110
  function simplehooks_execute_hook() {
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: nathanrice, studiopress
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
4
  Tags: hooks, genesis, genesiswp, studiopress
5
- Requires at least: 3.2
6
- Tested up to: 3.2.1
7
- Stable tag: 1.7.1
8
 
9
  This plugin creates a new Genesis settings page that allows you to insert code (HTML, Shortcodes, and PHP), and attach it to any of the 50+ action hooks throughout the Genesis Theme Framework, from StudioPress.
10
 
@@ -107,4 +107,8 @@ The most common request from Genesis users is how to properly modify their foote
107
  * Increased requirement to Genesis 1.7.1
108
  * Fixed display issues in the admin screen
109
  * Added new hooks to the defaults array
110
- * Whitespace, standards, and documentation
 
 
 
 
2
  Contributors: nathanrice, studiopress
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
4
  Tags: hooks, genesis, genesiswp, studiopress
5
+ Requires at least: 3.3
6
+ Tested up to: 3.3.1
7
+ Stable tag: 1.8.0
8
 
9
  This plugin creates a new Genesis settings page that allows you to insert code (HTML, Shortcodes, and PHP), and attach it to any of the 50+ action hooks throughout the Genesis Theme Framework, from StudioPress.
10
 
107
  * Increased requirement to Genesis 1.7.1
108
  * Fixed display issues in the admin screen
109
  * Added new hooks to the defaults array
110
+ * Whitespace, standards, and documentation
111
+
112
+ = 1.8.0 =
113
+ * Increased requirement to Genesis 1.8.0.
114
+ * Switched over to the Genesis 1.8 admin menu class to build admin menu.