Version Description
- Rewrite plugin based on new plugin boilerplate.
- Added new hooks.
- Require unfiltered_html capability to execute PHP.
- Better Genesis dependency handling.
- Change activation hook to conditional admin notice.
Download this release
Release Info
Developer | nathanrice |
Plugin | Genesis Simple Hooks |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 2.1.2 to 2.2.0
- admin.php +0 -604
- functions.php +0 -72
- genesis-simple-hooks.php +211 -0
- includes/class-genesis-simple-hooks-admin.php +648 -0
- includes/deprecated.php +99 -0
- includes/functions.php +35 -0
- languages/genesis-simple-hooks.pot +224 -223
- package.json +1 -1
- plugin.php +11 -129
- readme.txt +10 -3
admin.php
DELETED
@@ -1,604 +0,0 @@
|
|
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', 'genesis-simple-hooks' ),
|
31 |
-
'menu_title' => __( 'Simple Hooks', 'genesis-simple-hooks' )
|
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 |
-
//* HTML5 Entry Hooks
|
85 |
-
'genesis_before_entry' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
86 |
-
'genesis_entry_header' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
87 |
-
'genesis_entry_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
88 |
-
'genesis_entry_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
89 |
-
'genesis_after_entry' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
90 |
-
|
91 |
-
//* xHTML Entry Hooks
|
92 |
-
'genesis_before_post' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
93 |
-
'genesis_after_post' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
94 |
-
|
95 |
-
'genesis_before_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
96 |
-
'genesis_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
97 |
-
'genesis_after_post_title' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
98 |
-
|
99 |
-
'genesis_before_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
100 |
-
'genesis_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
101 |
-
'genesis_after_post_content' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
102 |
-
|
103 |
-
//* Comment Hooks
|
104 |
-
'genesis_before_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
105 |
-
'genesis_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
106 |
-
'genesis_list_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
107 |
-
'genesis_after_comments' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
108 |
-
|
109 |
-
'genesis_before_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
110 |
-
'genesis_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
111 |
-
'genesis_list_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
112 |
-
'genesis_after_pings' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
113 |
-
|
114 |
-
'genesis_before_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
115 |
-
'genesis_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
116 |
-
'genesis_after_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
117 |
-
|
118 |
-
'genesis_before_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
119 |
-
'genesis_after_comment' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
120 |
-
|
121 |
-
'genesis_before_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
122 |
-
'genesis_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
123 |
-
'genesis_after_comment_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
124 |
-
|
125 |
-
//* Sidebar Hooks
|
126 |
-
'genesis_before_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
127 |
-
'genesis_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
128 |
-
'genesis_after_sidebar' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
129 |
-
|
130 |
-
'genesis_before_sidebar_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
131 |
-
'genesis_after_sidebar_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
132 |
-
|
133 |
-
'genesis_before_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
134 |
-
'genesis_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
135 |
-
'genesis_after_sidebar_alt' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
136 |
-
|
137 |
-
'genesis_before_sidebar_alt_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
138 |
-
'genesis_after_sidebar_alt_widget_area' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
139 |
-
|
140 |
-
//* Footer hooks
|
141 |
-
'genesis_before_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
142 |
-
'genesis_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
143 |
-
'genesis_after_footer' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
144 |
-
|
145 |
-
//* Admin Hooks
|
146 |
-
'genesis_import_export_form' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
147 |
-
'genesis_export' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
148 |
-
'genesis_import' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
149 |
-
'genesis_theme_settings_metaboxes' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
150 |
-
'genesis_upgrade' => array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ),
|
151 |
-
|
152 |
-
);
|
153 |
-
|
154 |
-
//* Create the page */
|
155 |
-
$this->create( $page_id, $menu_ops, $page_ops, $settings_field, $default_settings );
|
156 |
-
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Load the necessary scripts for this admin page.
|
161 |
-
*
|
162 |
-
* @since 1.8.0
|
163 |
-
*
|
164 |
-
*/
|
165 |
-
function scripts() {
|
166 |
-
|
167 |
-
//* Load parent scripts as well as Genesis admin scripts */
|
168 |
-
parent::scripts();
|
169 |
-
genesis_load_admin_js();
|
170 |
-
|
171 |
-
}
|
172 |
-
|
173 |
-
/**
|
174 |
-
* Register meta boxes on the Simple Hooks Settings page.
|
175 |
-
*
|
176 |
-
* @since 1.8.0
|
177 |
-
*
|
178 |
-
*/
|
179 |
-
function metaboxes() {
|
180 |
-
|
181 |
-
add_meta_box( 'simplehooks-wp-hooks', __( 'WordPress Hooks', 'genesis-simple-hooks' ), array( $this, 'wp_hooks_box' ), $this->pagehook, 'main' );
|
182 |
-
add_meta_box( 'simplehooks-document-hooks', __( 'Document Hooks', 'genesis-simple-hooks' ), array( $this, 'document_hooks_box' ), $this->pagehook, 'main' );
|
183 |
-
add_meta_box( 'simplehooks-header-hooks', __( 'Header Hooks', 'genesis-simple-hooks' ), array( $this, 'header_hooks_box' ), $this->pagehook, 'main' );
|
184 |
-
add_meta_box( 'simplehooks-content-hooks', __( 'Content Hooks', 'genesis-simple-hooks' ), array( $this, 'content_hooks_box' ), $this->pagehook, 'main' );
|
185 |
-
add_meta_box( 'simplehooks-loop-hooks', __( 'Loop Hooks', 'genesis-simple-hooks' ), array( $this, 'loop_hooks_box' ), $this->pagehook, 'main' );
|
186 |
-
|
187 |
-
if ( current_theme_supports( 'html5' ) )
|
188 |
-
add_meta_box( 'simplehooks-entry-hooks', __( 'Entry Hooks', 'genesis-simple-hooks' ), array( $this, 'html5_entry_hooks_box' ), $this->pagehook, 'main' );
|
189 |
-
else
|
190 |
-
add_meta_box( 'simplehooks-post-hooks', __( 'Post/Page Hooks', 'genesis-simple-hooks' ), array( $this, 'post_hooks_box' ), $this->pagehook, 'main' );
|
191 |
-
|
192 |
-
add_meta_box( 'simplehooks-comment-list-hooks', __( 'Comment List Hooks', 'genesis-simple-hooks' ), array( $this, 'comment_list_hooks_box' ), $this->pagehook, 'main' );
|
193 |
-
add_meta_box( 'simplehooks-ping-list-hooks', __( 'Ping List Hooks', 'genesis-simple-hooks' ), array( $this, 'ping_list_hooks_box' ), $this->pagehook, 'main' );
|
194 |
-
add_meta_box( 'simplehooks-comment-hooks', __( 'Single Comment Hooks', 'genesis-simple-hooks' ), array( $this, 'comment_hooks_box' ), $this->pagehook, 'main' );
|
195 |
-
add_meta_box( 'simplehooks-comment-form-hooks', __( 'Comment Form Hooks', 'genesis-simple-hooks' ), array( $this, 'comment_form_hooks_box' ), $this->pagehook, 'main' );
|
196 |
-
add_meta_box( 'simplehooks-sidebar-hooks', __( 'Sidebar Hooks', 'genesis-simple-hooks' ), array( $this, 'sidebar_hooks_box' ), $this->pagehook, 'main' );
|
197 |
-
add_meta_box( 'simplehooks-footer-hooks', __( 'Footer Hooks', 'genesis-simple-hooks' ), array( $this, 'footer_hooks_box' ), $this->pagehook, 'main' );
|
198 |
-
|
199 |
-
}
|
200 |
-
|
201 |
-
function wp_hooks_box() {
|
202 |
-
|
203 |
-
simplehooks_form_generate( array(
|
204 |
-
'hook' => 'wp_head',
|
205 |
-
'desc' => __( 'This hook executes immediately before the closing <code></head></code> tag.', 'genesis-simple-hooks' ),
|
206 |
-
'unhook' => array( 'genesis_load_favicon' ),
|
207 |
-
) );
|
208 |
-
|
209 |
-
simplehooks_form_generate( array(
|
210 |
-
'hook' => 'wp_footer',
|
211 |
-
'desc' => __( 'This hook executes immediately before the closing <code></body></code> tag.', 'genesis-simple-hooks' ),
|
212 |
-
) );
|
213 |
-
|
214 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
215 |
-
|
216 |
-
}
|
217 |
-
|
218 |
-
function document_hooks_box() {
|
219 |
-
|
220 |
-
simplehooks_form_generate( array(
|
221 |
-
'hook' => 'genesis_title',
|
222 |
-
'desc' => __( 'This hook executes between the main document <code><title></title></code> tags.', 'genesis-simple-hooks' )
|
223 |
-
) );
|
224 |
-
|
225 |
-
simplehooks_form_generate( array(
|
226 |
-
'hook' => 'genesis_meta',
|
227 |
-
'desc' => __( 'This hook executes in the document <code><head></code>.<br /> It is commonly used to output <code>META</code> information about the document.', 'genesis-simple-hooks' ),
|
228 |
-
) );
|
229 |
-
|
230 |
-
simplehooks_form_generate( array(
|
231 |
-
'hook' => 'genesis_before',
|
232 |
-
'desc' => __( 'This hook executes immediately after the opening <code><body></code> tag.', 'genesis-simple-hooks' )
|
233 |
-
) );
|
234 |
-
|
235 |
-
simplehooks_form_generate( array(
|
236 |
-
'hook' => 'genesis_after',
|
237 |
-
'desc' => __( 'This hook executes immediately before the closing <code></body></code> tag.', 'genesis-simple-hooks' )
|
238 |
-
) );
|
239 |
-
|
240 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
241 |
-
|
242 |
-
}
|
243 |
-
|
244 |
-
function header_hooks_box() {
|
245 |
-
|
246 |
-
simplehooks_form_generate( array(
|
247 |
-
'hook' => 'genesis_before_header',
|
248 |
-
'desc' => __( 'This hook executes immediately before the header.', 'genesis-simple-hooks' )
|
249 |
-
) );
|
250 |
-
|
251 |
-
simplehooks_form_generate( array(
|
252 |
-
'hook' => 'genesis_header',
|
253 |
-
'desc' => __( 'This hook outputs the default header.', 'genesis-simple-hooks' ),
|
254 |
-
'unhook' => array( 'genesis_do_header' )
|
255 |
-
) );
|
256 |
-
|
257 |
-
simplehooks_form_generate( array(
|
258 |
-
'hook' => 'genesis_after_header',
|
259 |
-
'desc' => __( 'This hook executes immediately after the header.', 'genesis-simple-hooks' )
|
260 |
-
) );
|
261 |
-
|
262 |
-
simplehooks_form_generate( array(
|
263 |
-
'hook' => 'genesis_site_title',
|
264 |
-
'desc' => __( 'This hooks executes inside the header, and by default, outputs the site title.' , 'genesis-simple-hooks' ),
|
265 |
-
'unhook' => array( 'genesis_seo_site_title' ),
|
266 |
-
) );
|
267 |
-
|
268 |
-
simplehooks_form_generate( array(
|
269 |
-
'hook' => 'genesis_site_description',
|
270 |
-
'desc' => __( 'This hooks executes inside the header, and by default, outputs the site description.' , 'genesis-simple-hooks' ),
|
271 |
-
'unhook' => array( 'genesis_seo_site_description' ),
|
272 |
-
) );
|
273 |
-
|
274 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
275 |
-
|
276 |
-
}
|
277 |
-
|
278 |
-
function content_hooks_box() {
|
279 |
-
|
280 |
-
simplehooks_form_generate( array(
|
281 |
-
'hook' => 'genesis_before_content_sidebar_wrap',
|
282 |
-
'desc' => __( 'This hook executes immediately before the div block that wraps the content and the primary sidebar.', 'genesis-simple-hooks' )
|
283 |
-
) );
|
284 |
-
|
285 |
-
simplehooks_form_generate( array(
|
286 |
-
'hook' => 'genesis_after_content_sidebar_wrap',
|
287 |
-
'desc' => __( 'This hook executes immediately after the div block that wraps the content and the primary sidebar.', 'genesis-simple-hooks' )
|
288 |
-
) );
|
289 |
-
|
290 |
-
simplehooks_form_generate( array(
|
291 |
-
'hook' => 'genesis_before_content',
|
292 |
-
'desc' => __( 'This hook executes immediately before the content column.', 'genesis-simple-hooks' )
|
293 |
-
) );
|
294 |
-
|
295 |
-
simplehooks_form_generate( array(
|
296 |
-
'hook' => 'genesis_after_content',
|
297 |
-
'desc' => __( 'This hook executes immediately after the content column.', 'genesis-simple-hooks' )
|
298 |
-
) );
|
299 |
-
|
300 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
301 |
-
|
302 |
-
}
|
303 |
-
|
304 |
-
function loop_hooks_box() {
|
305 |
-
|
306 |
-
simplehooks_form_generate( array(
|
307 |
-
'hook' => 'genesis_before_loop',
|
308 |
-
'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.', 'genesis-simple-hooks' )
|
309 |
-
) );
|
310 |
-
|
311 |
-
simplehooks_form_generate( array(
|
312 |
-
'hook' => 'genesis_loop',
|
313 |
-
'desc' => __( 'This hook executes both default and custom loops.', 'genesis-simple-hooks' ),
|
314 |
-
'unhook' => array( 'genesis_do_loop' )
|
315 |
-
) );
|
316 |
-
|
317 |
-
simplehooks_form_generate( array(
|
318 |
-
'hook' => 'genesis_after_loop',
|
319 |
-
'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.', 'genesis-simple-hooks' )
|
320 |
-
) );
|
321 |
-
|
322 |
-
simplehooks_form_generate( array(
|
323 |
-
'hook' => 'genesis_after_endwhile',
|
324 |
-
'desc' => __( 'This hook executes after the <code>endwhile;</code> statement.', 'genesis-simple-hooks' ),
|
325 |
-
'unhook' => array( 'genesis_posts_nav' )
|
326 |
-
) );
|
327 |
-
|
328 |
-
simplehooks_form_generate( array(
|
329 |
-
'hook' => 'genesis_loop_else',
|
330 |
-
'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.', 'genesis-simple-hooks' ),
|
331 |
-
'unhook' => array( 'genesis_do_noposts' )
|
332 |
-
) );
|
333 |
-
|
334 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
335 |
-
|
336 |
-
}
|
337 |
-
|
338 |
-
function html5_entry_hooks_box() {
|
339 |
-
|
340 |
-
simplehooks_form_generate(array(
|
341 |
-
'hook' => 'genesis_before_entry',
|
342 |
-
'desc' => __( 'This hook executes before each entry in all loop blocks (outside the entry markup element).', 'genesis-simple-hooks' )
|
343 |
-
) );
|
344 |
-
|
345 |
-
simplehooks_form_generate(array(
|
346 |
-
'hook' => 'genesis_entry_header',
|
347 |
-
'desc' => __( 'This hook executes before the entry content. By default, it outputs the entry title and meta information.', 'genesis-simple-hooks' )
|
348 |
-
) );
|
349 |
-
|
350 |
-
simplehooks_form_generate(array(
|
351 |
-
'hook' => 'genesis_entry_content',
|
352 |
-
'desc' => __( 'This hook, by default, outputs the entry content.', 'genesis-simple-hooks' )
|
353 |
-
) );
|
354 |
-
|
355 |
-
simplehooks_form_generate(array(
|
356 |
-
'hook' => 'genesis_entry_footer',
|
357 |
-
'desc' => __( 'This hook executes after the entry content. By Default, it outputs entry meta information.', 'genesis-simple-hooks' )
|
358 |
-
) );
|
359 |
-
|
360 |
-
simplehooks_form_generate(array(
|
361 |
-
'hook' => 'genesis_after_entry',
|
362 |
-
'desc' => __( 'This hook executes after each entry in all loop blocks (outside the entry markup element).', 'genesis-simple-hooks' )
|
363 |
-
) );
|
364 |
-
|
365 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
366 |
-
|
367 |
-
}
|
368 |
-
|
369 |
-
function post_hooks_box() {
|
370 |
-
|
371 |
-
simplehooks_form_generate( array(
|
372 |
-
'hook' => 'genesis_before_post',
|
373 |
-
'desc' => __( 'This hook executes before each post in all loop blocks (outside the <code>post_class()</code> div).', 'genesis-simple-hooks' )
|
374 |
-
) );
|
375 |
-
|
376 |
-
simplehooks_form_generate( array(
|
377 |
-
'hook' => 'genesis_after_post',
|
378 |
-
'desc' => __( 'This hook executes after each post in all loop blocks (outside the <code>post_class()</code> div).', 'genesis-simple-hooks' ),
|
379 |
-
'unhook' => array( 'genesis_do_author_box' )
|
380 |
-
) );
|
381 |
-
|
382 |
-
simplehooks_form_generate( array(
|
383 |
-
'hook' => 'genesis_before_post_title',
|
384 |
-
'desc' => __( 'This hook executes immediately before each post/page title within the loop.', 'genesis-simple-hooks' )
|
385 |
-
) );
|
386 |
-
|
387 |
-
simplehooks_form_generate( array(
|
388 |
-
'hook' => 'genesis_post_title',
|
389 |
-
'desc' => __( 'This hook outputs the post/page title.', 'genesis-simple-hooks' ),
|
390 |
-
'unhook' => array( 'genesis_do_post_title' )
|
391 |
-
) );
|
392 |
-
|
393 |
-
simplehooks_form_generate( array(
|
394 |
-
'hook' => 'genesis_after_post_title',
|
395 |
-
'desc' => __( 'This hook executes immediately after each post/page title within the loop.', 'genesis-simple-hooks' )
|
396 |
-
) );
|
397 |
-
|
398 |
-
simplehooks_form_generate( array(
|
399 |
-
'hook' => 'genesis_before_post_content',
|
400 |
-
'desc' => __( 'This hook executes immediately before the <code>genesis_post_content</code> hook for each post/page within the loop.', 'genesis-simple-hooks' ),
|
401 |
-
'unhook' => array( 'genesis_post_info' )
|
402 |
-
) );
|
403 |
-
|
404 |
-
simplehooks_form_generate( array(
|
405 |
-
'hook' => 'genesis_post_content',
|
406 |
-
'desc' => __( 'This hook outputs the content of the post/page, by default.', 'genesis-simple-hooks' ),
|
407 |
-
'unhook' => array( 'genesis_do_post_image', 'genesis_do_post_content' )
|
408 |
-
) );
|
409 |
-
|
410 |
-
simplehooks_form_generate( array(
|
411 |
-
'hook' => 'genesis_after_post_content',
|
412 |
-
'desc' => __( 'This hook executes immediately after the <code>genesis_post_content</code> hook for each post/page within the loop.', 'genesis-simple-hooks' ),
|
413 |
-
'unhook' => array( 'genesis_post_meta' )
|
414 |
-
) );
|
415 |
-
|
416 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
417 |
-
|
418 |
-
}
|
419 |
-
|
420 |
-
function comment_list_hooks_box() {
|
421 |
-
|
422 |
-
simplehooks_form_generate( array(
|
423 |
-
'hook' => 'genesis_before_comments',
|
424 |
-
'desc' => __( 'This hook executes immediately before the comments block.', 'genesis-simple-hooks' )
|
425 |
-
) );
|
426 |
-
|
427 |
-
simplehooks_form_generate( array(
|
428 |
-
'hook' => 'genesis_comments',
|
429 |
-
'desc' => __( 'This hook outputs the comments block.', 'genesis-simple-hooks' ),
|
430 |
-
'unhook' => array( 'genesis_do_comments' )
|
431 |
-
) );
|
432 |
-
|
433 |
-
simplehooks_form_generate( array(
|
434 |
-
'hook' => 'genesis_list_comments',
|
435 |
-
'desc' => __( 'This hook executes inside the comments block. By default, it outputs a list of comments associated with a post via the <code>genesis_default_list_comments()</code> function.', 'genesis-simple-hooks' ),
|
436 |
-
'unhook' => array( 'genesis_default_list_comments' )
|
437 |
-
) );
|
438 |
-
|
439 |
-
simplehooks_form_generate( array(
|
440 |
-
'hook' => 'genesis_after_comments',
|
441 |
-
'desc' => __( 'This hook executes immediately after the comments block.', 'genesis-simple-hooks' )
|
442 |
-
) );
|
443 |
-
|
444 |
-
}
|
445 |
-
|
446 |
-
function ping_list_hooks_box() {
|
447 |
-
|
448 |
-
simplehooks_form_generate( array(
|
449 |
-
'hook' => 'genesis_before_pings',
|
450 |
-
'desc' => __( 'This hook executes immediately before the pings block.', 'genesis-simple-hooks' ),
|
451 |
-
'unhook' => array( 'genesis_do_pings' )
|
452 |
-
) );
|
453 |
-
|
454 |
-
simplehooks_form_generate( array(
|
455 |
-
'hook' => 'genesis_pings',
|
456 |
-
'desc' => __( 'This hook outputs the pings block.', 'genesis-simple-hooks' )
|
457 |
-
) );
|
458 |
-
|
459 |
-
simplehooks_form_generate( array(
|
460 |
-
'hook' => 'genesis_list_pings',
|
461 |
-
'desc' => __( 'This hook executes inside the pings block. By default, it outputs a list of pings associated with a post via the <code>genesis_default_list_pings()</code> function.', 'genesis-simple-hooks' ),
|
462 |
-
'unhook' => array( 'genesis_default_list_pings' )
|
463 |
-
) );
|
464 |
-
|
465 |
-
simplehooks_form_generate( array(
|
466 |
-
'hook' => 'genesis_after_pings',
|
467 |
-
'desc' => __( 'This hook executes immediately after the pings block.', 'genesis-simple-hooks' )
|
468 |
-
) );
|
469 |
-
|
470 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
471 |
-
|
472 |
-
}
|
473 |
-
|
474 |
-
function comment_hooks_box() {
|
475 |
-
|
476 |
-
simplehooks_form_generate( array(
|
477 |
-
'hook' => 'genesis_before_comment',
|
478 |
-
'desc' => __( 'This hook executes immediately before each individual comment (inside the <code>.comment</code> list item).', 'genesis-simple-hooks' )
|
479 |
-
) );
|
480 |
-
|
481 |
-
simplehooks_form_generate( array(
|
482 |
-
'hook' => 'genesis_after_comment',
|
483 |
-
'desc' => __( 'This hook executes immediately after each individual comment (inside the <code>.comment</code> list item).', 'genesis-simple-hooks' )
|
484 |
-
) );
|
485 |
-
|
486 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
487 |
-
|
488 |
-
}
|
489 |
-
|
490 |
-
function comment_form_hooks_box() {
|
491 |
-
|
492 |
-
simplehooks_form_generate( array(
|
493 |
-
'hook' => 'genesis_before_comment_form',
|
494 |
-
'desc' => __( 'This hook executes immediately before the comment form.', 'genesis-simple-hooks' )
|
495 |
-
) );
|
496 |
-
|
497 |
-
simplehooks_form_generate( array(
|
498 |
-
'hook' => 'genesis_comment_form',
|
499 |
-
'desc' => __( 'This hook outputs the entire comment form.', 'genesis-simple-hooks' ),
|
500 |
-
'unhook' => array( 'genesis_do_comment_form' )
|
501 |
-
) );
|
502 |
-
|
503 |
-
simplehooks_form_generate( array(
|
504 |
-
'hook' => 'genesis_after_comment_form',
|
505 |
-
'desc' => __( 'This hook executes immediately after the comment form.', 'genesis-simple-hooks' )
|
506 |
-
) );
|
507 |
-
|
508 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
509 |
-
|
510 |
-
}
|
511 |
-
|
512 |
-
function sidebar_hooks_box() {
|
513 |
-
|
514 |
-
simplehooks_form_generate( array(
|
515 |
-
'hook' => 'genesis_before_sidebar',
|
516 |
-
'desc' => __( 'This hook executes immediately before the primary sidebar column.', 'genesis-simple-hooks' )
|
517 |
-
) );
|
518 |
-
|
519 |
-
simplehooks_form_generate( array(
|
520 |
-
'hook' => 'genesis_sidebar',
|
521 |
-
'desc' => __( 'This hook outputs the content of the primary sidebar, including the widget area output.', 'genesis-simple-hooks' ),
|
522 |
-
'unhook' => array( 'genesis_do_sidebar' )
|
523 |
-
) );
|
524 |
-
|
525 |
-
simplehooks_form_generate( array(
|
526 |
-
'hook' => 'genesis_after_sidebar',
|
527 |
-
'desc' => __( 'This hook executes immediately after the primary sidebar column.', 'genesis-simple-hooks' )
|
528 |
-
) );
|
529 |
-
|
530 |
-
simplehooks_form_generate( array(
|
531 |
-
'hook' => 'genesis_before_sidebar_widget_area',
|
532 |
-
'desc' => __( 'This hook executes immediately before the primary sidebar widget area.', 'genesis-simple-hooks' )
|
533 |
-
) );
|
534 |
-
|
535 |
-
simplehooks_form_generate( array(
|
536 |
-
'hook' => 'genesis_after_sidebar_widget_area',
|
537 |
-
'desc' => __( 'This hook executes immediately after the primary sidebar widget area.', 'genesis-simple-hooks' )
|
538 |
-
) );
|
539 |
-
|
540 |
-
simplehooks_form_generate( array(
|
541 |
-
'hook' => 'genesis_before_sidebar_alt',
|
542 |
-
'desc' => __( 'This hook executes immediately before the alternate sidebar column.', 'genesis-simple-hooks' )
|
543 |
-
) );
|
544 |
-
|
545 |
-
simplehooks_form_generate( array(
|
546 |
-
'hook' => 'genesis_sidebar_alt',
|
547 |
-
'desc' => __( 'This hook outputs the content of the secondary sidebar, including the widget area output.', 'genesis-simple-hooks' ),
|
548 |
-
'unhook' => array( 'genesis_do_sidebar_alt' )
|
549 |
-
) );
|
550 |
-
|
551 |
-
simplehooks_form_generate( array(
|
552 |
-
'hook' => 'genesis_after_sidebar_alt',
|
553 |
-
'desc' => __( 'This hook executes immediately after the alternate sidebar column.', 'genesis-simple-hooks' )
|
554 |
-
) );
|
555 |
-
|
556 |
-
simplehooks_form_generate( array(
|
557 |
-
'hook' => 'genesis_before_sidebar_alt_widget_area',
|
558 |
-
'desc' => __( 'This hook executes immediately before the alternate sidebar widget area.', 'genesis-simple-hooks' )
|
559 |
-
) );
|
560 |
-
|
561 |
-
simplehooks_form_generate( array(
|
562 |
-
'hook' => 'genesis_after_sidebar_alt_widget_area',
|
563 |
-
'desc' => __( 'This hook executes immediately after the alternate sidebar widget area.', 'genesis-simple-hooks' )
|
564 |
-
) );
|
565 |
-
|
566 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
567 |
-
|
568 |
-
}
|
569 |
-
|
570 |
-
function footer_hooks_box() {
|
571 |
-
|
572 |
-
simplehooks_form_generate( array(
|
573 |
-
'hook' => 'genesis_before_footer',
|
574 |
-
'desc' => __( 'This hook executes immediately before the footer.', 'genesis-simple-hooks' )
|
575 |
-
) );
|
576 |
-
|
577 |
-
simplehooks_form_generate( array(
|
578 |
-
'hook' => 'genesis_footer',
|
579 |
-
'desc' => __( 'This hook, by default, outputs the content of the footer.', 'genesis-simple-hooks' ),
|
580 |
-
'unhook' => array( 'genesis_do_footer' )
|
581 |
-
) );
|
582 |
-
|
583 |
-
simplehooks_form_generate( array(
|
584 |
-
'hook' => 'genesis_after_footer',
|
585 |
-
'desc' => __( 'This hook executes immediately after the footer.', 'genesis-simple-hooks' )
|
586 |
-
) );
|
587 |
-
|
588 |
-
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
589 |
-
|
590 |
-
}
|
591 |
-
|
592 |
-
}
|
593 |
-
|
594 |
-
add_action( 'genesis_admin_menu', 'simplehooks_settings_menu' );
|
595 |
-
/**
|
596 |
-
* Instantiate the class to create the menu.
|
597 |
-
*
|
598 |
-
* @since 1.8.0
|
599 |
-
*/
|
600 |
-
function simplehooks_settings_menu() {
|
601 |
-
|
602 |
-
new Genesis_Simple_Hooks_Admin;
|
603 |
-
|
604 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
functions.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Pull an Simple Hooks option from the database, return value
|
5 |
-
*
|
6 |
-
* @since 0.1
|
7 |
-
*/
|
8 |
-
function simplehooks_get_option( $hook = null, $field = null, $all = false ) {
|
9 |
-
|
10 |
-
static $options = array();
|
11 |
-
|
12 |
-
$options = $options ? $options : get_option( SIMPLEHOOKS_SETTINGS_FIELD );
|
13 |
-
|
14 |
-
if ( $all )
|
15 |
-
return $options;
|
16 |
-
|
17 |
-
if ( ! array_key_exists( $hook, (array) $options ) )
|
18 |
-
return '';
|
19 |
-
|
20 |
-
$option = isset( $options[$hook][$field] ) ? $options[$hook][$field] : '';
|
21 |
-
|
22 |
-
return wp_kses_stripslashes( wp_kses_decode_entities( $option ) );
|
23 |
-
|
24 |
-
}
|
25 |
-
/**
|
26 |
-
* Pull an EasyHook option from the database, echo value
|
27 |
-
*
|
28 |
-
* @since 0.1
|
29 |
-
*/
|
30 |
-
function simplehooks_option($hook = null, $field = null) {
|
31 |
-
|
32 |
-
echo simplehooks_get_option( $hook, $field );
|
33 |
-
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* This function generates the form code to be used in the metaboxes
|
38 |
-
*
|
39 |
-
* @since 0.1
|
40 |
-
*/
|
41 |
-
function simplehooks_form_generate( $args = array() ) {
|
42 |
-
|
43 |
-
?>
|
44 |
-
|
45 |
-
<h4><code><?php echo $args['hook']; ?></code> <?php _e( 'Hook', 'genesis-simple-hooks' ); ?></h4>
|
46 |
-
<p><span class="description"><?php echo $args['desc']; ?></span></p>
|
47 |
-
|
48 |
-
<?php
|
49 |
-
if ( isset( $args['unhook'] ) ) {
|
50 |
-
|
51 |
-
foreach ( (array) $args['unhook'] as $function ) {
|
52 |
-
?>
|
53 |
-
|
54 |
-
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]" value="<?php echo $function; ?>" <?php if ( in_array( $function, (array) simplehooks_get_option( $args['hook'], 'unhook' ) ) ) echo 'checked'; ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][unhook][]"><?php printf( __( 'Unhook <code>%s()</code> function from this hook?', 'genesis-simple-hooks' ), $function ); ?></label><br />
|
55 |
-
|
56 |
-
<?php
|
57 |
-
}
|
58 |
-
|
59 |
-
}
|
60 |
-
?>
|
61 |
-
|
62 |
-
<p><textarea name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][content]" cols="70" rows="5"><?php echo htmlentities( simplehooks_get_option( $args['hook'], 'content' ), ENT_QUOTES, 'UTF-8' ); ?></textarea></p>
|
63 |
-
|
64 |
-
<p>
|
65 |
-
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]" value="1" <?php checked( 1, simplehooks_get_option( $args['hook'], 'shortcodes' ) ); ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][shortcodes]"><?php _e( 'Execute Shortcodes on this hook?', 'genesis-simple-hooks' ); ?></label><br />
|
66 |
-
<input type="checkbox" name="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]" id="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]" value="1" <?php checked( 1, simplehooks_get_option( $args['hook'], 'php' ) ); ?> /> <label for="<?php echo SIMPLEHOOKS_SETTINGS_FIELD; ?>[<?php echo $args['hook']; ?>][php]"><?php _e( 'Execute PHP on this hook?', 'genesis-simple-hooks' ); ?></label>
|
67 |
-
</p>
|
68 |
-
|
69 |
-
<hr class="div" />
|
70 |
-
|
71 |
-
<?php
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
genesis-simple-hooks.php
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Genesis_Simple_Hooks {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Plugin version
|
7 |
+
*/
|
8 |
+
public $plugin_version = '2.2.0';
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Minimum WordPress version.
|
12 |
+
*/
|
13 |
+
public $min_wp_version = '4.7.2';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Minimum Genesis version.
|
17 |
+
*/
|
18 |
+
public $min_genesis_version = '2.4.2';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* The plugin textdomain, for translations.
|
22 |
+
*/
|
23 |
+
public $plugin_textdomain = 'genesis-simple-hooks';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* The url to the plugin directory.
|
27 |
+
*/
|
28 |
+
public $plugin_dir_url;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* The path to the plugin directory.
|
32 |
+
*/
|
33 |
+
public $plugin_dir_path;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The main settings field for this plugin.
|
37 |
+
*/
|
38 |
+
public $settings_field = 'simplehooks-settings';
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Admin menu and settings page.
|
42 |
+
*/
|
43 |
+
public $admin;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Constructor.
|
47 |
+
*
|
48 |
+
* @since 2.2.0
|
49 |
+
*/
|
50 |
+
public function __construct() {
|
51 |
+
|
52 |
+
$this->plugin_dir_url = plugin_dir_url( __FILE__ );
|
53 |
+
$this->plugin_dir_path = plugin_dir_path( __FILE__ );
|
54 |
+
|
55 |
+
// For backward compatibility
|
56 |
+
define( 'SIMPLEHOOKS_PLUGIN_DIR', $this->plugin_dir_path );
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Initialize.
|
62 |
+
*
|
63 |
+
* @since 2.2.0
|
64 |
+
*/
|
65 |
+
public function init() {
|
66 |
+
|
67 |
+
$this->load_plugin_textdomain();
|
68 |
+
|
69 |
+
add_action( 'admin_notices', array( $this, 'requirements_notice' ) );
|
70 |
+
|
71 |
+
// Because this is a Genesis-dependent plugin
|
72 |
+
add_action( 'genesis_setup', array( $this, 'includes' ) );
|
73 |
+
add_action( 'genesis_setup', array( $this, 'instantiate' ) );
|
74 |
+
add_action( 'genesis_setup', array( $this, 'execute_hooks' ) );
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Show admin notice if minimum requirements aren't met.
|
80 |
+
*
|
81 |
+
* @since 2.2.0
|
82 |
+
*/
|
83 |
+
public function requirements_notice() {
|
84 |
+
|
85 |
+
if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, $this->min_genesis_version, '>=' ) ) {
|
86 |
+
|
87 |
+
$action = defined( 'PARENT_THEME_VERSION' ) ? __( 'upgrade to', 'genesis-simple-hooks' ) : __( 'install and activate', 'genesis-simple-hooks' );
|
88 |
+
|
89 |
+
$message = sprintf( __( 'Genesis Simple Hooks requires WordPress %s and Genesis %s, or greater. Please %s the latest version of <a href="%s" target="_blank">Genesis</a> to use this plugin.', 'genesis-simple-' ), $this->min_wp_version, $this->min_genesis_version, $action, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa' );
|
90 |
+
echo '<div class="notice notice-warning"><p>' . $message . '</p></div>';
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Load the plugin textdomain, for translation.
|
98 |
+
*
|
99 |
+
* @since 2.2.0
|
100 |
+
*/
|
101 |
+
public function load_plugin_textdomain() {
|
102 |
+
load_plugin_textdomain( 'genesis-simple-hooks', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* All general includes.
|
107 |
+
*
|
108 |
+
* @since 2.2.0
|
109 |
+
*/
|
110 |
+
public function includes() {
|
111 |
+
|
112 |
+
require_once( $this->plugin_dir_path . 'includes/functions.php' );
|
113 |
+
require_once( $this->plugin_dir_path . 'includes/deprecated.php' );
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Include the class file, instantiate the classes, create objects.
|
119 |
+
*
|
120 |
+
* @since 2.2.0
|
121 |
+
*/
|
122 |
+
public function instantiate() {
|
123 |
+
|
124 |
+
require_once( $this->plugin_dir_path . 'includes/class-genesis-simple-hooks-admin.php' );
|
125 |
+
$this->admin = new Genesis_Simple_Hooks_Admin;
|
126 |
+
$this->admin->init();
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Helper function to retrieve the static object without using globals.
|
132 |
+
*
|
133 |
+
* @since 2.2.0
|
134 |
+
*/
|
135 |
+
public function execute_hooks() {
|
136 |
+
|
137 |
+
$hooks = get_option( $this->settings_field );
|
138 |
+
|
139 |
+
//print_r( $hooks );
|
140 |
+
|
141 |
+
foreach ( (array) $hooks as $hook => $array ) {
|
142 |
+
|
143 |
+
// Add new content to hook
|
144 |
+
if ( ! empty( $array['content'] ) ) {
|
145 |
+
add_action( $hook, array( $this, 'execute_hook' ) );
|
146 |
+
}
|
147 |
+
|
148 |
+
// Unhook stuff
|
149 |
+
if ( isset( $array['unhook'] ) ) {
|
150 |
+
|
151 |
+
foreach( (array) $array['unhook'] as $function ) {
|
152 |
+
remove_action( $hook, $function );
|
153 |
+
}
|
154 |
+
|
155 |
+
}
|
156 |
+
|
157 |
+
}
|
158 |
+
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* The following function executes any code meant to be hooked.
|
163 |
+
* It checks to see if shortcodes or PHP should be executed as well.
|
164 |
+
*
|
165 |
+
* @uses simplehooks_get_option()
|
166 |
+
*
|
167 |
+
* @since 2.2.0
|
168 |
+
*/
|
169 |
+
public function execute_hook() {
|
170 |
+
|
171 |
+
$hook = current_filter();
|
172 |
+
$content = simplehooks_get_option( $hook, 'content' );
|
173 |
+
|
174 |
+
if ( ! $hook || ! $content ) {
|
175 |
+
return;
|
176 |
+
}
|
177 |
+
|
178 |
+
$shortcodes = simplehooks_get_option( $hook, 'shortcodes' );
|
179 |
+
$php = simplehooks_get_option( $hook, 'php' );
|
180 |
+
|
181 |
+
$value = $shortcodes ? do_shortcode( $content ) : $content;
|
182 |
+
|
183 |
+
if ( $php ) {
|
184 |
+
eval( "?>$value " );
|
185 |
+
} else {
|
186 |
+
echo $value;
|
187 |
+
}
|
188 |
+
|
189 |
+
}
|
190 |
+
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Helper function to retrieve the static object without using globals.
|
195 |
+
*
|
196 |
+
* @since 0.9.0
|
197 |
+
*/
|
198 |
+
function Genesis_Simple_Hooks() {
|
199 |
+
|
200 |
+
static $object;
|
201 |
+
|
202 |
+
if ( null == $object ) {
|
203 |
+
$object = new Genesis_Simple_Hooks;
|
204 |
+
}
|
205 |
+
|
206 |
+
return $object;
|
207 |
+
}
|
208 |
+
/**
|
209 |
+
* Initialize the object on `plugins_loaded`.
|
210 |
+
*/
|
211 |
+
add_action( 'plugins_loaded', array( Genesis_Simple_Hooks(), 'init' ) );
|
includes/class-genesis-simple-hooks-admin.php
ADDED
@@ -0,0 +1,648 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
* Settings field.
|
17 |
+
*
|
18 |
+
* @since 2.2.0
|
19 |
+
*/
|
20 |
+
public $settings_field = 'simplehooks-settings';
|
21 |
+
|
22 |
+
public $wp_hooks;
|
23 |
+
|
24 |
+
public $document_hooks;
|
25 |
+
|
26 |
+
public $header_hooks;
|
27 |
+
|
28 |
+
public $content_hooks;
|
29 |
+
|
30 |
+
public $loop_hooks;
|
31 |
+
|
32 |
+
public $entry_hooks;
|
33 |
+
|
34 |
+
public $post_hooks;
|
35 |
+
|
36 |
+
public $comment_hooks;
|
37 |
+
|
38 |
+
public $sidebar_hooks;
|
39 |
+
|
40 |
+
public $footer_hooks;
|
41 |
+
|
42 |
+
public $admin_hooks;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Constructor.
|
46 |
+
*
|
47 |
+
* @since 1.8.0
|
48 |
+
*
|
49 |
+
*/
|
50 |
+
public function __construct() {
|
51 |
+
|
52 |
+
// For backward compatibility
|
53 |
+
define( 'SIMPLEHOOKS_SETTINGS_FIELD', $this->settings_field );
|
54 |
+
|
55 |
+
$this->define_hooks();
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Initialize.
|
61 |
+
*
|
62 |
+
* @since 2.1.0
|
63 |
+
*/
|
64 |
+
public function init() {
|
65 |
+
|
66 |
+
add_action( 'genesis_admin_menu', array( $this, 'admin_menu' ) );
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Create the admin menu item and settings page.
|
72 |
+
*
|
73 |
+
* @since 2.2.0
|
74 |
+
*/
|
75 |
+
public function admin_menu() {
|
76 |
+
|
77 |
+
$page_id = 'simplehooks';
|
78 |
+
|
79 |
+
$menu_ops = array(
|
80 |
+
'submenu' => array(
|
81 |
+
'parent_slug' => 'genesis',
|
82 |
+
'page_title' => __( 'Genesis - Simple Hooks', 'genesis-simple-hooks' ),
|
83 |
+
'menu_title' => __( 'Simple Hooks', 'genesis-simple-hooks' )
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
$page_ops = array(
|
88 |
+
'screen_icon' => 'plugins',
|
89 |
+
);
|
90 |
+
|
91 |
+
// Create the page
|
92 |
+
$this->create( $page_id, $menu_ops, $page_ops, $this->settings_field, $this->get_default_settings() );
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Load the necessary scripts for this admin page.
|
98 |
+
*
|
99 |
+
* @since 1.8.0
|
100 |
+
*
|
101 |
+
*/
|
102 |
+
public function scripts() {
|
103 |
+
|
104 |
+
// Load parent scripts as well as Genesis admin scripts */
|
105 |
+
parent::scripts();
|
106 |
+
genesis_load_admin_js();
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Save method. Allows for data manipulation and sanitization before saving.
|
112 |
+
*
|
113 |
+
* @since 2.2.0
|
114 |
+
*/
|
115 |
+
public function save( $newvalue, $oldvalue ) {
|
116 |
+
|
117 |
+
foreach ( $newvalue as $hook => $data ) {
|
118 |
+
|
119 |
+
if ( empty( $data ) ) {
|
120 |
+
continue;
|
121 |
+
}
|
122 |
+
|
123 |
+
if ( ! current_user_can( 'unfiltered_html' ) ) {
|
124 |
+
|
125 |
+
// kses post, if value of content changed.
|
126 |
+
if ( $newvalue[ $hook ]['content'] !== $oldvalue[ $hook ]['content'] ) {
|
127 |
+
$newvalue[ $hook ]['content'] = wp_kses_post( $data['content'] );
|
128 |
+
}
|
129 |
+
|
130 |
+
// Maintain php selection, since option is hidden for lower users.
|
131 |
+
$newvalue[ $hook ]['php'] = $oldvalue[ $hook ]['php'];
|
132 |
+
|
133 |
+
}
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
return $newvalue;
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Assign all our hooks to class variables.
|
143 |
+
*
|
144 |
+
* @since 2.2.0
|
145 |
+
*/
|
146 |
+
public function define_hooks() {
|
147 |
+
|
148 |
+
$this->wp_hooks = array(
|
149 |
+
'wp_head' => array(
|
150 |
+
'description' => __( 'Executes immediately before the closing <code></head></code> tag.', 'genesis-simple-hooks' ),
|
151 |
+
'unhook' => array( 'genesis_load_favicon', 'genesis_do_meta_pingback', 'genesis_paged_rel', 'genesis_meta_name', 'genesis_meta_url', 'genesis_header_scripts', 'genesis_custom_header_style' ),
|
152 |
+
),
|
153 |
+
'wp_footer' => array(
|
154 |
+
'description' => __( 'Executes immediately before the closing <code></body></code> tag.', 'genesis-simple-hooks' ),
|
155 |
+
'unhook' => array( 'genesis_footer_scripts' ),
|
156 |
+
),
|
157 |
+
);
|
158 |
+
|
159 |
+
$this->document_hooks = array(
|
160 |
+
'genesis_doctype' => array(
|
161 |
+
'description' => __( 'Executes in the document head. Genesis uses this to output the doctype.', 'genesis-simple-hooks' ),
|
162 |
+
'unhook' => array( 'genesis_do_doctype' ),
|
163 |
+
),
|
164 |
+
'genesis_title' => array(
|
165 |
+
'description' => __( 'Executes in the document head. Genesis uses this to output the document title.', 'genesis-simple-hooks' ),
|
166 |
+
'unhook' => array( 'genesis_do_title' ),
|
167 |
+
),
|
168 |
+
'genesis_meta' => array(
|
169 |
+
'description' => __( 'Executes in the document head. Genesis uses this to output meta tags.', 'genesis-simple-hooks' ),
|
170 |
+
'unhook' => array( 'genesis_seo_meta_description', 'genesis_seo_meta_keywords', 'genesis_robots_meta', 'genesis_responsive_viewport', ),
|
171 |
+
),
|
172 |
+
'genesis_before' => array(
|
173 |
+
'description' => __( 'Executes immediately after the opening <code><body></code> tag.', 'genesis-simple-hooks' ),
|
174 |
+
),
|
175 |
+
'genesis_after' => array(
|
176 |
+
'description' => __( 'Executes immediately before the closing <code></body></code> tag.', 'genesis-simple-hooks' ),
|
177 |
+
),
|
178 |
+
);
|
179 |
+
|
180 |
+
$this->header_hooks = array(
|
181 |
+
'genesis_before_header' => array(
|
182 |
+
'description' => __( 'Executes immediately before the header.', 'genesis-simple-hooks' )
|
183 |
+
),
|
184 |
+
'genesis_header' => array(
|
185 |
+
'description' => __( 'Genesis uses this hook to output the default header.', 'genesis-simple-hooks' ),
|
186 |
+
'unhook' => array( 'genesis_do_header' ),
|
187 |
+
),
|
188 |
+
'genesis_header_right' => array(
|
189 |
+
'description' => __( 'Executes inside the page header, immediately before the header widget area.', 'genesis-simple-hooks' ),
|
190 |
+
),
|
191 |
+
'genesis_after_header' => array(
|
192 |
+
'description' => __( 'Executes immediately after the header.', 'genesis-simple-hooks' )
|
193 |
+
),
|
194 |
+
'genesis_site_title' => array(
|
195 |
+
'description' => __( 'Executes inside the header. Genesis uses this hook to output the site title.' , 'genesis-simple-hooks' ),
|
196 |
+
'unhook' => array( 'genesis_seo_site_title' ),
|
197 |
+
),
|
198 |
+
'genesis_site_description' => array(
|
199 |
+
'description' => __( 'Executes inside the header. Genesis uses this hook to output the site description.' , 'genesis-simple-hooks' ),
|
200 |
+
'unhook' => array( 'genesis_seo_site_description' ),
|
201 |
+
),
|
202 |
+
);
|
203 |
+
|
204 |
+
$this->content_hooks = array(
|
205 |
+
'genesis_before_content_sidebar_wrap' => array(
|
206 |
+
'description' => __( 'Executes before the content-sidebar-wrap opening markup.', 'genesis-simple-hooks' ),
|
207 |
+
),
|
208 |
+
'genesis_after_content_sidebar_wrap' => array(
|
209 |
+
'description' => __( 'Executes after the content-sidebar-wrap closing markup.', 'genesis-simple-hooks' ),
|
210 |
+
),
|
211 |
+
'genesis_before_content' => array(
|
212 |
+
'description' => __( 'Executes before the content opening markup.', 'genesis-simple-hooks' ),
|
213 |
+
),
|
214 |
+
'genesis_after_content' => array(
|
215 |
+
'description' => __( 'Executes after the content closing markup.', 'genesis-simple-hooks' ),
|
216 |
+
),
|
217 |
+
);
|
218 |
+
|
219 |
+
$this->loop_hooks = array(
|
220 |
+
'genesis_before_loop' => array(
|
221 |
+
'description' => __( 'Executes before the loop.', 'genesis-simple-hooks' ),
|
222 |
+
),
|
223 |
+
'genesis_loop' => array(
|
224 |
+
'description' => __( 'Executes in the content section. Genesis uses this hook to output the loop.', 'genesis-simple-hooks' ),
|
225 |
+
'unhook' => array( 'genesis_do_loop' ),
|
226 |
+
),
|
227 |
+
'genesis_after_loop' => array(
|
228 |
+
'description' => __( 'Executes after the loop.', 'genesis-simple-hooks' ),
|
229 |
+
),
|
230 |
+
'genesis_after_endwhile' => array(
|
231 |
+
'description' => __( 'Executes after the WordPress loop endwhile.', 'genesis-simple-hooks' ),
|
232 |
+
'unhook' => array( 'genesis_posts_nav' ),
|
233 |
+
),
|
234 |
+
'genesis_loop_else' => array(
|
235 |
+
'description' => __( "Executes in the loop's else statement.", 'genesis-simple-hooks' ),
|
236 |
+
'unhook' => array( 'genesis_do_noposts' ),
|
237 |
+
),
|
238 |
+
'genesis_reset_loops' => array(
|
239 |
+
'description' => __( 'Executes if the loop actions are reset.', 'genesis-simple-hooks' ),
|
240 |
+
),
|
241 |
+
);
|
242 |
+
|
243 |
+
/**
|
244 |
+
* HTML5 entry hooks
|
245 |
+
*/
|
246 |
+
$this->entry_hooks = array(
|
247 |
+
'genesis_before_entry' => array(
|
248 |
+
'description' => __( 'Executes before the entry.', 'genesis-simple-hooks' ),
|
249 |
+
),
|
250 |
+
'genesis_entry_header' => array(
|
251 |
+
'description' => __( 'Executes as part of the entry. Genesis uses this hook to output the entry header.', 'genesis-simple-hooks' ),
|
252 |
+
'unhook' => array( 'genesis_do_post_title' ),
|
253 |
+
),
|
254 |
+
'genesis_before_entry_content' => array(
|
255 |
+
'description' => __( 'Executes before the entry content', 'genesis-simple-hooks' ),
|
256 |
+
'unhook' => array( 'genesis_do_post_content' ),
|
257 |
+
),
|
258 |
+
'genesis_entry_content' => array(
|
259 |
+
'description' => __( 'Executes as part of the entry. Genesis uses this hook to output the entry content.', 'genesis-simple-hooks' ),
|
260 |
+
'unhook' => array( 'genesis_do_post_content' ),
|
261 |
+
),
|
262 |
+
'genesis_after_entry_content' => array(
|
263 |
+
'description' => __( 'Executes after the entry content', 'genesis-simple-hooks' ),
|
264 |
+
'unhook' => array( 'genesis_do_post_content' ),
|
265 |
+
),
|
266 |
+
'genesis_entry_footer' => array(
|
267 |
+
'description' => __( 'Executes as part of the entry. Genesis uses this hook to output the entry footer.', 'genesis-simple-hooks' ),
|
268 |
+
'unhook' => array( 'genesis_post_meta' ),
|
269 |
+
),
|
270 |
+
'genesis_after_entry' => array(
|
271 |
+
'description' => __( 'Executes after the entry.', 'genesis-simple-hooks' ),
|
272 |
+
'unhook' => array( 'genesis_adjacent_entry_nav', 'genesis_get_comments_template' ),
|
273 |
+
),
|
274 |
+
);
|
275 |
+
|
276 |
+
/**
|
277 |
+
* xHTML post hooks
|
278 |
+
*/
|
279 |
+
$this->post_hooks = array(
|
280 |
+
'genesis_before_post' => array(
|
281 |
+
'description' => __( 'Executes before the post opening markup.', 'genesis-simple-hooks' ),
|
282 |
+
),
|
283 |
+
'genesis_after_post' => array(
|
284 |
+
'description' => __( 'Executes after the post closing markup.', 'genesis-simple-hooks' ),
|
285 |
+
'unhook' => array( 'genesis_do_author_box_single', 'genesis_get_comments_template' ),
|
286 |
+
),
|
287 |
+
'genesis_before_post_title' => array(
|
288 |
+
'description' => __( 'Executes before the post title.', 'genesis-simple-hooks' ),
|
289 |
+
'unhook' => array( 'genesis_do_post_format_image' ),
|
290 |
+
),
|
291 |
+
'genesis_post_title' => array(
|
292 |
+
'description' => __( 'Executes as part of the post. Genesis uses this hook to output the post title.', 'genesis-simple-hooks' ),
|
293 |
+
'unhook' => array( 'genesis_do_post_title' ),
|
294 |
+
),
|
295 |
+
'genesis_after_post_title' => array(
|
296 |
+
'description' => __( 'Executes after the post title.', 'genesis-simple-hooks' ),
|
297 |
+
),
|
298 |
+
'genesis_before_post_content' => array(
|
299 |
+
'description' => __( 'Executes before the post content.', 'genesis-simple-hooks' ),
|
300 |
+
'unhook' => array( 'genesis_post_info' ),
|
301 |
+
),
|
302 |
+
'genesis_post_content' => array(
|
303 |
+
'description' => __( 'Executes as part of the post. Genesis uses this hook to output the post content.', 'genesis-simple-hooks' ),
|
304 |
+
'unhook' => array( 'genesis_do_post_image', 'genesis_do_post_content', 'genesis_do_post_permalink', 'genesis_do_post_content_nav' ),
|
305 |
+
),
|
306 |
+
'genesis_after_post_content' => array(
|
307 |
+
'description' => __( 'Executes after the post content.', 'genesis-simple-hooks' ),
|
308 |
+
'unhook' => array( 'genesis_post_meta' ),
|
309 |
+
),
|
310 |
+
);
|
311 |
+
|
312 |
+
$this->comment_hooks = array(
|
313 |
+
'genesis_before_comments' => array(
|
314 |
+
'description' => __( 'Executes before the comments section opening markup.', 'genesis-simple-hooks' ),
|
315 |
+
),
|
316 |
+
'genesis_comments' => array(
|
317 |
+
'description' => __( 'Executes after an entry. Genesis uses this hook to output the comments section.', 'genesis-simple-hooks' ),
|
318 |
+
'unhook' => array( 'genesis_do_comments' ),
|
319 |
+
),
|
320 |
+
'genesis_list_comments' => array(
|
321 |
+
'description' => __( 'Executes in the comments section. Genesis uses this hook to output the comment list.', 'genesis-simple-hooks' ),
|
322 |
+
'unhook' => array( 'genesis_default_list_comments' ),
|
323 |
+
),
|
324 |
+
'genesis_after_comments' => array(
|
325 |
+
'description' => __( 'Executes after the comments section closing markup.', 'genesis-simple-hooks' ),
|
326 |
+
),
|
327 |
+
'genesis_before_pings' => array(
|
328 |
+
'description' => __( 'Executes before the pings section opening markup.', 'genesis-simple-hooks' ),
|
329 |
+
),
|
330 |
+
'genesis_pings' => array(
|
331 |
+
'description' => __( 'Executes after an entry. Genesis uses this hook to output the pings section.', 'genesis-simple-hooks' ),
|
332 |
+
'unhook' => array( 'genesis_do_pings' ),
|
333 |
+
),
|
334 |
+
'genesis_list_pings' => array(
|
335 |
+
'description' => __( 'Executes in the pings section. Genesis uses this hook to output the ping list.', 'genesis-simple-hooks' ),
|
336 |
+
'unhook' => array( 'genesis_default_list_pings' ),
|
337 |
+
),
|
338 |
+
'genesis_after_pings' => array(
|
339 |
+
'description' => __( 'Executes after the ping section closing markup.', 'genesis-simple-hooks' ),
|
340 |
+
),
|
341 |
+
'genesis_before_comment' => array(
|
342 |
+
'description' => __( 'Executes before a single comment.', 'genesis-simple-hooks' ),
|
343 |
+
),
|
344 |
+
'genesis_comment' => array(
|
345 |
+
'description' => __( 'Executes in the comment list. Genesis uses this hook to output a single comment.', 'genesis-simple-hooks' ),
|
346 |
+
),
|
347 |
+
'genesis_after_comment' => array(
|
348 |
+
'description' => __( 'Executes after a single comment.', 'genesis-simple-hooks' ),
|
349 |
+
),
|
350 |
+
'genesis_before_comment_form' => array(
|
351 |
+
'description' => __( 'Executes before the comment form.', 'genesis-simple-hooks' ),
|
352 |
+
),
|
353 |
+
'genesis_comment_form' => array(
|
354 |
+
'description' => __( 'Executes after the comment and ping list. Genesis uses this hook to output the comment form.', 'genesis-simple-hooks' ),
|
355 |
+
'unhook' => array( 'genesis_do_comment_form' ),
|
356 |
+
),
|
357 |
+
'genesis_after_comment_form' => array(
|
358 |
+
'description' => __( 'Executes after the comment form.', 'genesis-simple-hooks' ),
|
359 |
+
),
|
360 |
+
);
|
361 |
+
|
362 |
+
$this->sidebar_hooks = array(
|
363 |
+
'genesis_before_sidebar' => array(
|
364 |
+
'description' => __( 'Executes before the primary sidebar.', 'genesis-simple-hooks' ),
|
365 |
+
),
|
366 |
+
'genesis_sidebar' => array(
|
367 |
+
'description' => __( 'Executes after the content section in 2+ column layouts. Genesis uses this hook to output the primary sidebar.', 'genesis-simple-hooks' ),
|
368 |
+
'unhook' => array( 'genesis_do_sidebar' ),
|
369 |
+
),
|
370 |
+
'genesis_after_sidebar' => array(
|
371 |
+
'description' => __( 'Executes after the primary sidebar.', 'genesis-simple-hooks' ),
|
372 |
+
),
|
373 |
+
'genesis_before_sidebar_widget_area' => array(
|
374 |
+
'description' => __( 'Executes before the primary sidebar widget area.', 'genesis-simple-hooks' ),
|
375 |
+
),
|
376 |
+
'genesis_after_sidebar_widget_area' => array(
|
377 |
+
'description' => __( 'Executes after the primary sidebar widget area.', 'genesis-simple-hooks' ),
|
378 |
+
),
|
379 |
+
'genesis_before_sidebar_alt' => array(
|
380 |
+
'description' => __( 'Executes before the secondary sidebar.', 'genesis-simple-hooks' ),
|
381 |
+
),
|
382 |
+
'genesis_sidebar_alt' => array(
|
383 |
+
'description' => __( 'Executes after the primary sidebar in 3+ column layouts. Genesis uses this hook to output the secondary sidebar.', 'genesis-simple-hooks' ),
|
384 |
+
'unhook' => array( 'genesis_do_sidebar_alt' ),
|
385 |
+
),
|
386 |
+
'genesis_after_sidebar_alt' => array(
|
387 |
+
'description' => __( 'Executes after the secondary sidebar.', 'genesis-simple-hooks' ),
|
388 |
+
),
|
389 |
+
'genesis_before_sidebar_alt_widget_area' => array(
|
390 |
+
'description' => __( 'Executes before the secondary sidebar widget area.', 'genesis-simple-hooks' ),
|
391 |
+
),
|
392 |
+
'genesis_after_sidebar_alt_widget_area' => array(
|
393 |
+
'description' => __( 'Executes after the secondary sidebar widget area.', 'genesis-simple-hooks' ),
|
394 |
+
),
|
395 |
+
);
|
396 |
+
|
397 |
+
$this->footer_hooks = array(
|
398 |
+
'genesis_before_footer' => array(
|
399 |
+
'description' => __( 'Executes before the site footer.', 'genesis-simple-hooks' ),
|
400 |
+
),
|
401 |
+
'genesis_footer' => array(
|
402 |
+
'description' => __( 'Executes after the content and sidebars. Genesis uses this hook to output the site footer.', 'genesis-simple-hooks' ),
|
403 |
+
'unhook' => array( 'genesis_do_footer' ),
|
404 |
+
),
|
405 |
+
'genesis_after_footer' => array(
|
406 |
+
'description' => __( 'Executes after the site footer.', 'genesis-simple-hooks' ),
|
407 |
+
),
|
408 |
+
);
|
409 |
+
|
410 |
+
$this->admin_hooks = array(
|
411 |
+
'genesis_import_export_form' => array(
|
412 |
+
'description' => __( 'Executes after the form on the the import/export screen.', 'genesis-simple-hooks' ),
|
413 |
+
),
|
414 |
+
'genesis_export' => array(
|
415 |
+
'description' => __( 'Executes during the export function.', 'genesis-simple-hooks' ),
|
416 |
+
),
|
417 |
+
'genesis_import' => array(
|
418 |
+
'description' => __( 'Executes during the import function.', 'genesis-simple-hooks' ),
|
419 |
+
),
|
420 |
+
'genesis_theme_settings_metaboxes' => array(
|
421 |
+
'description' => __( 'Executes in the function that adds metaboxes to the theme settings screen.', 'genesis-simple-hooks' ),
|
422 |
+
),
|
423 |
+
'genesis_upgrade' => array(
|
424 |
+
'description' => __( 'Executes after Genesis upgrades itself.', 'genesis-simple-hooks' ),
|
425 |
+
'unhook' => array( 'genesis_upgrade_redirect' ),
|
426 |
+
),
|
427 |
+
);
|
428 |
+
|
429 |
+
}
|
430 |
+
|
431 |
+
/**
|
432 |
+
* Get default settings (hooks + blank/false values).
|
433 |
+
*
|
434 |
+
* @since 2.2.0
|
435 |
+
*/
|
436 |
+
public function get_default_settings() {
|
437 |
+
|
438 |
+
return array_fill_keys( $this->get_hooks(), array( 'content' => '', 'php' => 0, 'shortcodes' => 0 ) );
|
439 |
+
|
440 |
+
}
|
441 |
+
|
442 |
+
/**
|
443 |
+
* Combine and return all hooks as an array.
|
444 |
+
*
|
445 |
+
* @since 2.2.0
|
446 |
+
*/
|
447 |
+
public function get_hooks() {
|
448 |
+
|
449 |
+
// Merge all hooks arrays
|
450 |
+
$hooks = array_merge(
|
451 |
+
$this->wp_hooks,
|
452 |
+
$this->document_hooks,
|
453 |
+
$this->header_hooks,
|
454 |
+
$this->content_hooks,
|
455 |
+
$this->loop_hooks,
|
456 |
+
$this->entry_hooks,
|
457 |
+
$this->post_hooks,
|
458 |
+
$this->comment_hooks,
|
459 |
+
$this->sidebar_hooks,
|
460 |
+
$this->footer_hooks,
|
461 |
+
$this->admin_hooks
|
462 |
+
);
|
463 |
+
|
464 |
+
// Just the keys
|
465 |
+
$hooks = array_keys( $hooks );
|
466 |
+
|
467 |
+
return $hooks;
|
468 |
+
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Generate form markup from an array of hooks.
|
473 |
+
*
|
474 |
+
* @since 2.2.0
|
475 |
+
*/
|
476 |
+
public function generate_form_markup_from_hooks( $hooks ) {
|
477 |
+
|
478 |
+
foreach ( (array) $hooks as $hook => $info ) {
|
479 |
+
|
480 |
+
// Check for existence in hooks array
|
481 |
+
if ( ! in_array( $hook, $this->get_hooks() ) ) {
|
482 |
+
continue;
|
483 |
+
}
|
484 |
+
|
485 |
+
printf( '<h4><code>%s</code> %s</h4>', esc_html( $hook ), __( 'Hook', 'genesis-simple-hooks' ) );
|
486 |
+
printf( '<p><span class="description">%s</span></p>', $info['description'] );
|
487 |
+
|
488 |
+
if ( isset( $info['unhook'] ) ) {
|
489 |
+
|
490 |
+
foreach ( (array) $info['unhook'] as $function ) {
|
491 |
+
printf(
|
492 |
+
'<label><input type="checkbox" name="%s" id="%s" value="%s" %s/> %s</label><br />',
|
493 |
+
$this->settings_field . "[{$hook}][unhook][]",
|
494 |
+
$this->settings_field . "[{$hook}][unhook][]",
|
495 |
+
$function,
|
496 |
+
in_array( $function, (array) simplehooks_get_option( $hook, 'unhook' ) ) ? 'checked' : '',
|
497 |
+
sprintf( __( 'Unhook <code>%s()</code> function from this hook?', 'genesis-simple-hooks' ), $function )
|
498 |
+
);
|
499 |
+
}
|
500 |
+
|
501 |
+
}
|
502 |
+
|
503 |
+
printf(
|
504 |
+
'<p><textarea name="%s" cols="70" rows="5">%s</textarea></p>',
|
505 |
+
$this->settings_field . "[{$hook}][content]",
|
506 |
+
htmlentities( simplehooks_get_option( $hook, 'content' ), ENT_QUOTES, 'UTF-8' )
|
507 |
+
);
|
508 |
+
|
509 |
+
echo '<p>';
|
510 |
+
|
511 |
+
printf(
|
512 |
+
'<input type="checkbox" name="%1$s" id="%1$s" value="1" %2$s/> <label for="%1$s">%3$s</label><br />',
|
513 |
+
$this->settings_field . "[{$hook}][shortcodes]",
|
514 |
+
checked( 1, simplehooks_get_option( $hook, 'shortcodes' ), 0 ),
|
515 |
+
__( 'Execute Shortcodes on this hook?', 'genesis-simple-hooks' )
|
516 |
+
);
|
517 |
+
|
518 |
+
if ( current_user_can( 'unfiltered_html' ) ) {
|
519 |
+
printf(
|
520 |
+
'<input type="checkbox" name="%1$s" id="%1$s" value="1" %2$s/> <label for="%1$s">%3$s</label><br />',
|
521 |
+
$this->settings_field . "[{$hook}][php]",
|
522 |
+
checked( 1, simplehooks_get_option( $hook, 'php' ), 0 ),
|
523 |
+
__( 'Execute PHP on this hook?', 'genesis-simple-hooks' )
|
524 |
+
);
|
525 |
+
}
|
526 |
+
|
527 |
+
echo '</p>';
|
528 |
+
|
529 |
+
echo '<hr class="div" />';
|
530 |
+
|
531 |
+
}
|
532 |
+
|
533 |
+
}
|
534 |
+
|
535 |
+
/**
|
536 |
+
* Register meta boxes on the Simple Hooks Settings page.
|
537 |
+
*
|
538 |
+
* @since 1.8.0
|
539 |
+
*
|
540 |
+
*/
|
541 |
+
public function metaboxes() {
|
542 |
+
|
543 |
+
add_meta_box( 'simplehooks-wp-hooks', __( 'WordPress Hooks', 'genesis-simple-hooks' ), array( $this, 'wp_hooks_box' ), $this->pagehook, 'main' );
|
544 |
+
add_meta_box( 'simplehooks-document-hooks', __( 'Document Hooks', 'genesis-simple-hooks' ), array( $this, 'document_hooks_box' ), $this->pagehook, 'main' );
|
545 |
+
add_meta_box( 'simplehooks-header-hooks', __( 'Header Hooks', 'genesis-simple-hooks' ), array( $this, 'header_hooks_box' ), $this->pagehook, 'main' );
|
546 |
+
add_meta_box( 'simplehooks-content-hooks', __( 'Content Hooks', 'genesis-simple-hooks' ), array( $this, 'content_hooks_box' ), $this->pagehook, 'main' );
|
547 |
+
add_meta_box( 'simplehooks-loop-hooks', __( 'Loop Hooks', 'genesis-simple-hooks' ), array( $this, 'loop_hooks_box' ), $this->pagehook, 'main' );
|
548 |
+
|
549 |
+
if ( current_theme_supports( 'html5' ) )
|
550 |
+
add_meta_box( 'simplehooks-entry-hooks', __( 'Entry Hooks', 'genesis-simple-hooks' ), array( $this, 'html5_entry_hooks_box' ), $this->pagehook, 'main' );
|
551 |
+
else
|
552 |
+
add_meta_box( 'simplehooks-post-hooks', __( 'Post/Page Hooks', 'genesis-simple-hooks' ), array( $this, 'post_hooks_box' ), $this->pagehook, 'main' );
|
553 |
+
|
554 |
+
add_meta_box( 'simplehooks-comment-hooks', __( 'Comment Hooks', 'genesis-simple-hooks' ), array( $this, 'comment_hooks_box' ), $this->pagehook, 'main' );
|
555 |
+
add_meta_box( 'simplehooks-sidebar-hooks', __( 'Sidebar Hooks', 'genesis-simple-hooks' ), array( $this, 'sidebar_hooks_box' ), $this->pagehook, 'main' );
|
556 |
+
add_meta_box( 'simplehooks-footer-hooks', __( 'Footer Hooks', 'genesis-simple-hooks' ), array( $this, 'footer_hooks_box' ), $this->pagehook, 'main' );
|
557 |
+
|
558 |
+
}
|
559 |
+
|
560 |
+
public function wp_hooks_box() {
|
561 |
+
|
562 |
+
$this->generate_form_markup_from_hooks( $this->wp_hooks );
|
563 |
+
|
564 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
565 |
+
|
566 |
+
}
|
567 |
+
|
568 |
+
public function internal_hooks_box() {
|
569 |
+
|
570 |
+
$this->generate_form_markup_from_hooks( $this->internal_hooks );
|
571 |
+
|
572 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
573 |
+
|
574 |
+
}
|
575 |
+
|
576 |
+
public function document_hooks_box() {
|
577 |
+
|
578 |
+
$this->generate_form_markup_from_hooks( $this->document_hooks );
|
579 |
+
|
580 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
581 |
+
|
582 |
+
}
|
583 |
+
|
584 |
+
public function header_hooks_box() {
|
585 |
+
|
586 |
+
$this->generate_form_markup_from_hooks( $this->header_hooks );
|
587 |
+
|
588 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
589 |
+
|
590 |
+
}
|
591 |
+
|
592 |
+
public function content_hooks_box() {
|
593 |
+
|
594 |
+
$this->generate_form_markup_from_hooks( $this->content_hooks );
|
595 |
+
|
596 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
597 |
+
|
598 |
+
}
|
599 |
+
|
600 |
+
public function loop_hooks_box() {
|
601 |
+
|
602 |
+
$this->generate_form_markup_from_hooks( $this->loop_hooks );
|
603 |
+
|
604 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
605 |
+
|
606 |
+
}
|
607 |
+
|
608 |
+
public function html5_entry_hooks_box() {
|
609 |
+
|
610 |
+
$this->generate_form_markup_from_hooks( $this->entry_hooks );
|
611 |
+
|
612 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
613 |
+
|
614 |
+
}
|
615 |
+
|
616 |
+
public function post_hooks_box() {
|
617 |
+
|
618 |
+
$this->generate_form_markup_from_hooks( $this->post_hooks );
|
619 |
+
|
620 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
621 |
+
|
622 |
+
}
|
623 |
+
|
624 |
+
public function comment_hooks_box() {
|
625 |
+
|
626 |
+
$this->generate_form_markup_from_hooks( $this->comment_hooks );
|
627 |
+
|
628 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
629 |
+
|
630 |
+
}
|
631 |
+
|
632 |
+
public function sidebar_hooks_box() {
|
633 |
+
|
634 |
+
$this->generate_form_markup_from_hooks( $this->sidebar_hooks );
|
635 |
+
|
636 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
637 |
+
|
638 |
+
}
|
639 |
+
|
640 |
+
public function footer_hooks_box() {
|
641 |
+
|
642 |
+
$this->generate_form_markup_from_hooks( $this->footer_hooks );
|
643 |
+
|
644 |
+
submit_button( __( 'Save Changes', 'genesis-simple-hooks' ), 'primary' );
|
645 |
+
|
646 |
+
}
|
647 |
+
|
648 |
+
}
|
includes/deprecated.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Deprecated. Instantiate the admin menu.
|
5 |
+
*
|
6 |
+
* @since 2.0.0
|
7 |
+
* @deprecated 2.3.0
|
8 |
+
*/
|
9 |
+
function simplehooks_settings_menu() {
|
10 |
+
|
11 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Deprecated. This function runs on plugin activation. It checks to make sure Genesis
|
17 |
+
* or a Genesis child theme is active. If not, it deactivates itself.
|
18 |
+
*
|
19 |
+
* @since 0.1.0
|
20 |
+
* @deprecated 2.2.0
|
21 |
+
*/
|
22 |
+
function simplehooks_activation() {
|
23 |
+
|
24 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Deprecated. Deactivate Simple Hooks.
|
30 |
+
*
|
31 |
+
* @since 1.8.0.2
|
32 |
+
* @deprecated 2.2.0
|
33 |
+
*/
|
34 |
+
function simplehooks_deactivate() {
|
35 |
+
|
36 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Deprecated. Load the plugin textdomain
|
42 |
+
*
|
43 |
+
* @deprecated 2.2.0
|
44 |
+
*/
|
45 |
+
function simplehooks_load_textdomain() {
|
46 |
+
|
47 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Deprecated. Load admin menu and helper functions.
|
53 |
+
*
|
54 |
+
* @since 1.8.0
|
55 |
+
* @deprecated 2.2.0
|
56 |
+
*/
|
57 |
+
function simplehooks_init() {
|
58 |
+
|
59 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Deprecated. Loops through all the hooks, and attempts to
|
65 |
+
* execute the code in the proper location.
|
66 |
+
*
|
67 |
+
* @since 0.1.0
|
68 |
+
* @deprecated 2.2.0
|
69 |
+
*/
|
70 |
+
function simplehooks_execute_hooks() {
|
71 |
+
|
72 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Deprecated. Executes any code meant to be hooked.
|
78 |
+
* It checks to see if shortcodes or PHP should be executed as well.
|
79 |
+
*
|
80 |
+
* @since 0.1.0
|
81 |
+
* @deprecated 2.2.0
|
82 |
+
*/
|
83 |
+
function simplehooks_execute_hook() {
|
84 |
+
|
85 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Deprecated. Generates the form code to be used in the metaboxes.
|
91 |
+
*
|
92 |
+
* @since 0.1.0
|
93 |
+
* @deprecated 2.2.0
|
94 |
+
*/
|
95 |
+
function simplehooks_form_generate() {
|
96 |
+
|
97 |
+
_deprecated_function( __FUNCTION__, '2.2.0' );
|
98 |
+
|
99 |
+
}
|
includes/functions.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Pull an Simple Hooks option from the database, return value
|
5 |
+
*
|
6 |
+
* @since 0.1
|
7 |
+
*/
|
8 |
+
function simplehooks_get_option( $hook = null, $field = null, $all = false ) {
|
9 |
+
|
10 |
+
static $options = array();
|
11 |
+
|
12 |
+
$options = $options ? $options : get_option( Genesis_Simple_Hooks()->settings_field );
|
13 |
+
|
14 |
+
if ( $all ) {
|
15 |
+
return $options;
|
16 |
+
}
|
17 |
+
|
18 |
+
if ( ! array_key_exists( $hook, (array) $options ) )
|
19 |
+
return '';
|
20 |
+
|
21 |
+
$option = isset( $options[$hook][$field] ) ? $options[$hook][$field] : '';
|
22 |
+
|
23 |
+
return wp_kses_stripslashes( wp_kses_decode_entities( $option ) );
|
24 |
+
|
25 |
+
}
|
26 |
+
/**
|
27 |
+
* Pull an EasyHook option from the database, echo value
|
28 |
+
*
|
29 |
+
* @since 0.1
|
30 |
+
*/
|
31 |
+
function simplehooks_option($hook = null, $field = null) {
|
32 |
+
|
33 |
+
echo simplehooks_get_option( $hook, $field );
|
34 |
+
|
35 |
+
}
|
languages/genesis-simple-hooks.pot
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
# Copyright (C)
|
2 |
-
# This file is distributed under the
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version:
|
6 |
"Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
"Last-Translator: StudioPress <translations@studiopress.com>\n"
|
13 |
"Language-Team: English <translations@studiopress.com>\n"
|
14 |
"X-Generator: grunt-wp-i18n 0.4.4\n"
|
@@ -24,401 +24,402 @@ msgstr ""
|
|
24 |
"X-Poedit-SearchPath-0: .\n"
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
|
27 |
-
#:
|
28 |
-
msgid "
|
29 |
msgstr ""
|
30 |
|
31 |
-
#:
|
32 |
-
msgid "
|
33 |
msgstr ""
|
34 |
|
35 |
-
#:
|
36 |
-
msgid "
|
|
|
|
|
|
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: admin.php:
|
40 |
-
msgid "
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: admin.php:
|
44 |
-
msgid "
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: admin.php:
|
48 |
-
msgid "
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: admin.php:
|
52 |
-
|
|
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: admin.php:
|
56 |
-
msgid "
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: admin.php:
|
60 |
-
msgid "
|
|
|
|
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: admin.php:
|
64 |
-
msgid "
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: admin.php:
|
68 |
-
msgid "
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: admin.php:
|
72 |
-
msgid "
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: admin.php:
|
76 |
-
msgid "
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: admin.php:
|
80 |
-
msgid "
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: admin.php:
|
84 |
-
msgid "
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: admin.php:
|
88 |
-
msgid ""
|
89 |
-
"This hook executes immediately before the closing "
|
90 |
-
"<code></head></code> tag."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: admin.php:
|
94 |
msgid ""
|
95 |
-
"
|
96 |
-
"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: admin.php:
|
100 |
-
|
101 |
-
#: admin.php:566 admin.php:588
|
102 |
-
msgid "Save Changes"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: admin.php:
|
106 |
-
msgid ""
|
107 |
-
"This hook executes between the main document "
|
108 |
-
"<code><title></title></code> tags."
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: admin.php:
|
112 |
-
msgid ""
|
113 |
-
"This hook executes in the document <code><head></code>.<br /> It is "
|
114 |
-
"commonly used to output <code>META</code> information about the document."
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: admin.php:
|
118 |
-
msgid ""
|
119 |
-
"This hook executes immediately after the opening <code><body></code> "
|
120 |
-
"tag."
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: admin.php:
|
124 |
-
msgid "
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: admin.php:
|
128 |
-
msgid "
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: admin.php:
|
132 |
-
msgid "
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: admin.php:
|
136 |
-
msgid ""
|
137 |
-
"This hooks executes inside the header, and by default, outputs the site "
|
138 |
-
"title."
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: admin.php:
|
142 |
-
msgid ""
|
143 |
-
"This hooks executes inside the header, and by default, outputs the site "
|
144 |
-
"description."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: admin.php:
|
148 |
-
msgid ""
|
149 |
-
"This hook executes immediately before the div block that wraps the content "
|
150 |
-
"and the primary sidebar."
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: admin.php:
|
154 |
-
msgid ""
|
155 |
-
"This hook executes immediately after the div block that wraps the content "
|
156 |
-
"and the primary sidebar."
|
157 |
msgstr ""
|
158 |
|
159 |
-
#: admin.php:
|
160 |
-
msgid "
|
|
|
|
|
161 |
msgstr ""
|
162 |
|
163 |
-
#: admin.php:
|
164 |
-
msgid "
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: admin.php:
|
168 |
msgid ""
|
169 |
-
"
|
170 |
-
"
|
171 |
-
"loop template tags or variables."
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: admin.php:
|
175 |
-
msgid "
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: admin.php:
|
179 |
msgid ""
|
180 |
-
"
|
181 |
-
"
|
182 |
-
"template tags or variables."
|
183 |
msgstr ""
|
184 |
|
185 |
-
#: admin.php:
|
186 |
-
msgid "
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: admin.php:
|
190 |
-
msgid ""
|
191 |
-
"This hook executes after the <code>else :</code> statement in all loop "
|
192 |
-
"blocks. The content attached to this hook will only display if there are no "
|
193 |
-
"posts available when a loop is executed."
|
194 |
msgstr ""
|
195 |
|
196 |
-
#: admin.php:
|
197 |
-
msgid ""
|
198 |
-
|
199 |
-
|
|
|
|
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: admin.php:
|
203 |
msgid ""
|
204 |
-
"
|
205 |
-
"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: admin.php:
|
209 |
-
msgid "
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: admin.php:
|
213 |
-
msgid ""
|
214 |
-
"This hook executes after the entry content. By Default, it outputs entry "
|
215 |
-
"meta information."
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: admin.php:
|
219 |
msgid ""
|
220 |
-
"
|
221 |
-
"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: admin.php:
|
225 |
-
msgid ""
|
226 |
-
"This hook executes before each post in all loop blocks (outside the "
|
227 |
-
"<code>post_class()</code> div)."
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: admin.php:
|
231 |
-
msgid ""
|
232 |
-
"This hook executes after each post in all loop blocks (outside the "
|
233 |
-
"<code>post_class()</code> div)."
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: admin.php:
|
237 |
-
msgid "
|
|
|
|
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: admin.php:
|
241 |
-
msgid "
|
|
|
|
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: admin.php:
|
245 |
-
msgid "
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: admin.php:
|
249 |
-
msgid ""
|
250 |
-
"This hook executes immediately before the <code>genesis_post_content</code> "
|
251 |
-
"hook for each post/page within the loop."
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: admin.php:
|
255 |
-
msgid "
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: admin.php:
|
259 |
msgid ""
|
260 |
-
"
|
261 |
-
"
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: admin.php:
|
265 |
-
msgid "
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: admin.php:
|
269 |
-
msgid "
|
270 |
msgstr ""
|
271 |
|
272 |
-
#: admin.php:
|
273 |
msgid ""
|
274 |
-
"
|
275 |
-
"
|
276 |
-
"<code>genesis_default_list_comments()</code> function."
|
277 |
-
msgstr ""
|
278 |
-
|
279 |
-
#: admin.php:441
|
280 |
-
msgid "This hook executes immediately after the comments block."
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: admin.php:
|
284 |
-
msgid "
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: admin.php:
|
288 |
-
msgid "
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: admin.php:
|
292 |
msgid ""
|
293 |
-
"
|
294 |
-
"
|
295 |
-
"<code>genesis_default_list_pings()</code> function."
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: admin.php:
|
299 |
-
msgid "
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: admin.php:
|
303 |
-
msgid ""
|
304 |
-
"This hook executes immediately before each individual comment (inside the "
|
305 |
-
"<code>.comment</code> list item)."
|
306 |
msgstr ""
|
307 |
|
308 |
-
#: admin.php:
|
309 |
msgid ""
|
310 |
-
"
|
311 |
-
"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: admin.php:
|
315 |
-
msgid "
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: admin.php:
|
319 |
-
msgid "
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: admin.php:
|
323 |
-
msgid "
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: admin.php:
|
327 |
-
msgid "
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: admin.php:
|
331 |
msgid ""
|
332 |
-
"
|
333 |
-
"
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: admin.php:
|
337 |
-
msgid "
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: admin.php:
|
341 |
-
msgid "
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: admin.php:
|
345 |
-
msgid "
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: admin.php:
|
349 |
-
msgid "
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: admin.php:
|
353 |
msgid ""
|
354 |
-
"
|
355 |
-
"
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: admin.php:
|
359 |
-
msgid "
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: admin.php:
|
363 |
-
msgid "
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: admin.php:
|
367 |
-
msgid "
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: admin.php:
|
371 |
-
msgid "
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: admin.php:
|
375 |
-
msgid "
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: admin.php:
|
379 |
-
msgid "
|
380 |
msgstr ""
|
381 |
|
382 |
-
#:
|
383 |
msgid "Hook"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#:
|
387 |
msgid "Unhook <code>%s()</code> function from this hook?"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#:
|
391 |
msgid "Execute Shortcodes on this hook?"
|
392 |
msgstr ""
|
393 |
|
394 |
-
#:
|
395 |
msgid "Execute PHP on this hook?"
|
396 |
msgstr ""
|
397 |
|
398 |
-
#:
|
399 |
-
msgid ""
|
400 |
-
"Sorry, you cannot run Simple Hooks without WordPress %s and <a "
|
401 |
-
"href=\"%s\">Genesis %s</a>, or greater."
|
402 |
msgstr ""
|
403 |
|
404 |
-
|
405 |
-
msgid "
|
406 |
msgstr ""
|
407 |
|
408 |
-
|
409 |
-
msgid "
|
410 |
msgstr ""
|
411 |
|
412 |
-
|
413 |
-
msgid ""
|
414 |
-
"Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the "
|
415 |
-
"Genesis Theme."
|
416 |
msgstr ""
|
417 |
|
418 |
-
|
419 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
msgstr ""
|
421 |
|
422 |
-
|
423 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
msgstr ""
|
1 |
+
# Copyright (C) 2017
|
2 |
+
# This file is distributed under the same license as the package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: \n"
|
6 |
"Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n"
|
7 |
+
"POT-Creation-Date: 2017-03-09 03:54:49+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: StudioPress <translations@studiopress.com>\n"
|
13 |
"Language-Team: English <translations@studiopress.com>\n"
|
14 |
"X-Generator: grunt-wp-i18n 0.4.4\n"
|
24 |
"X-Poedit-SearchPath-0: .\n"
|
25 |
"X-Textdomain-Support: yes\n"
|
26 |
|
27 |
+
#: genesis-simple-hooks.php:87
|
28 |
+
msgid "upgrade to"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: genesis-simple-hooks.php:87
|
32 |
+
msgid "install and activate"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: genesis-simple-hooks.php:89
|
36 |
+
msgid ""
|
37 |
+
"Genesis Simple Hooks requires WordPress %s and Genesis %s, or greater. "
|
38 |
+
"Please %s the latest version of <a href=\"%s\" "
|
39 |
+
"target=\"_blank\">Genesis</a> to use this plugin."
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: includes/class-genesis-simple-hooks-admin.php:82
|
43 |
+
msgid "Genesis - Simple Hooks"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: includes/class-genesis-simple-hooks-admin.php:83
|
47 |
+
msgid "Simple Hooks"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: includes/class-genesis-simple-hooks-admin.php:150
|
51 |
+
msgid "Executes immediately before the closing <code></head></code> tag."
|
52 |
msgstr ""
|
53 |
|
54 |
+
#: includes/class-genesis-simple-hooks-admin.php:154
|
55 |
+
#: includes/class-genesis-simple-hooks-admin.php:176
|
56 |
+
msgid "Executes immediately before the closing <code></body></code> tag."
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: includes/class-genesis-simple-hooks-admin.php:161
|
60 |
+
msgid "Executes in the document head. Genesis uses this to output the doctype."
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: includes/class-genesis-simple-hooks-admin.php:165
|
64 |
+
msgid ""
|
65 |
+
"Executes in the document head. Genesis uses this to output the document "
|
66 |
+
"title."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: includes/class-genesis-simple-hooks-admin.php:169
|
70 |
+
msgid "Executes in the document head. Genesis uses this to output meta tags."
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: includes/class-genesis-simple-hooks-admin.php:173
|
74 |
+
msgid "Executes immediately after the opening <code><body></code> tag."
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: includes/class-genesis-simple-hooks-admin.php:182
|
78 |
+
msgid "Executes immediately before the header."
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: includes/class-genesis-simple-hooks-admin.php:185
|
82 |
+
msgid "Genesis uses this hook to output the default header."
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: includes/class-genesis-simple-hooks-admin.php:189
|
86 |
+
msgid "Executes inside the page header, immediately before the header widget area."
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: includes/class-genesis-simple-hooks-admin.php:192
|
90 |
+
msgid "Executes immediately after the header."
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: includes/class-genesis-simple-hooks-admin.php:195
|
94 |
+
msgid "Executes inside the header. Genesis uses this hook to output the site title."
|
|
|
|
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: includes/class-genesis-simple-hooks-admin.php:199
|
98 |
msgid ""
|
99 |
+
"Executes inside the header. Genesis uses this hook to output the site "
|
100 |
+
"description."
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: includes/class-genesis-simple-hooks-admin.php:206
|
104 |
+
msgid "Executes before the content-sidebar-wrap opening markup."
|
|
|
|
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: includes/class-genesis-simple-hooks-admin.php:209
|
108 |
+
msgid "Executes after the content-sidebar-wrap closing markup."
|
|
|
|
|
109 |
msgstr ""
|
110 |
|
111 |
+
#: includes/class-genesis-simple-hooks-admin.php:212
|
112 |
+
msgid "Executes before the content opening markup."
|
|
|
|
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: includes/class-genesis-simple-hooks-admin.php:215
|
116 |
+
msgid "Executes after the content closing markup."
|
|
|
|
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: includes/class-genesis-simple-hooks-admin.php:221
|
120 |
+
msgid "Executes before the loop."
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: includes/class-genesis-simple-hooks-admin.php:224
|
124 |
+
msgid "Executes in the content section. Genesis uses this hook to output the loop."
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: includes/class-genesis-simple-hooks-admin.php:228
|
128 |
+
msgid "Executes after the loop."
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: includes/class-genesis-simple-hooks-admin.php:231
|
132 |
+
msgid "Executes after the WordPress loop endwhile."
|
|
|
|
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: includes/class-genesis-simple-hooks-admin.php:235
|
136 |
+
msgid "Executes in the loop's else statement."
|
|
|
|
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: includes/class-genesis-simple-hooks-admin.php:239
|
140 |
+
msgid "Executes if the loop actions are reset."
|
|
|
|
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: includes/class-genesis-simple-hooks-admin.php:248
|
144 |
+
msgid "Executes before the entry."
|
|
|
|
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: includes/class-genesis-simple-hooks-admin.php:251
|
148 |
+
msgid ""
|
149 |
+
"Executes as part of the entry. Genesis uses this hook to output the entry "
|
150 |
+
"header."
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: includes/class-genesis-simple-hooks-admin.php:255
|
154 |
+
msgid "Executes before the entry content"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: includes/class-genesis-simple-hooks-admin.php:259
|
158 |
msgid ""
|
159 |
+
"Executes as part of the entry. Genesis uses this hook to output the entry "
|
160 |
+
"content."
|
|
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: includes/class-genesis-simple-hooks-admin.php:263
|
164 |
+
msgid "Executes after the entry content"
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: includes/class-genesis-simple-hooks-admin.php:267
|
168 |
msgid ""
|
169 |
+
"Executes as part of the entry. Genesis uses this hook to output the entry "
|
170 |
+
"footer."
|
|
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: includes/class-genesis-simple-hooks-admin.php:271
|
174 |
+
msgid "Executes after the entry."
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: includes/class-genesis-simple-hooks-admin.php:281
|
178 |
+
msgid "Executes before the post opening markup."
|
|
|
|
|
|
|
179 |
msgstr ""
|
180 |
|
181 |
+
#: includes/class-genesis-simple-hooks-admin.php:284
|
182 |
+
msgid "Executes after the post closing markup."
|
183 |
+
msgstr ""
|
184 |
+
|
185 |
+
#: includes/class-genesis-simple-hooks-admin.php:288
|
186 |
+
msgid "Executes before the post title."
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: includes/class-genesis-simple-hooks-admin.php:292
|
190 |
msgid ""
|
191 |
+
"Executes as part of the post. Genesis uses this hook to output the post "
|
192 |
+
"title."
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: includes/class-genesis-simple-hooks-admin.php:296
|
196 |
+
msgid "Executes after the post title."
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: includes/class-genesis-simple-hooks-admin.php:299
|
200 |
+
msgid "Executes before the post content."
|
|
|
|
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: includes/class-genesis-simple-hooks-admin.php:303
|
204 |
msgid ""
|
205 |
+
"Executes as part of the post. Genesis uses this hook to output the post "
|
206 |
+
"content."
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: includes/class-genesis-simple-hooks-admin.php:307
|
210 |
+
msgid "Executes after the post content."
|
|
|
|
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: includes/class-genesis-simple-hooks-admin.php:314
|
214 |
+
msgid "Executes before the comments section opening markup."
|
|
|
|
|
215 |
msgstr ""
|
216 |
|
217 |
+
#: includes/class-genesis-simple-hooks-admin.php:317
|
218 |
+
msgid ""
|
219 |
+
"Executes after an entry. Genesis uses this hook to output the comments "
|
220 |
+
"section."
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: includes/class-genesis-simple-hooks-admin.php:321
|
224 |
+
msgid ""
|
225 |
+
"Executes in the comments section. Genesis uses this hook to output the "
|
226 |
+
"comment list."
|
227 |
msgstr ""
|
228 |
|
229 |
+
#: includes/class-genesis-simple-hooks-admin.php:325
|
230 |
+
msgid "Executes after the comments section closing markup."
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: includes/class-genesis-simple-hooks-admin.php:328
|
234 |
+
msgid "Executes before the pings section opening markup."
|
|
|
|
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: includes/class-genesis-simple-hooks-admin.php:331
|
238 |
+
msgid "Executes after an entry. Genesis uses this hook to output the pings section."
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: includes/class-genesis-simple-hooks-admin.php:335
|
242 |
msgid ""
|
243 |
+
"Executes in the pings section. Genesis uses this hook to output the ping "
|
244 |
+
"list."
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: includes/class-genesis-simple-hooks-admin.php:339
|
248 |
+
msgid "Executes after the ping section closing markup."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: includes/class-genesis-simple-hooks-admin.php:342
|
252 |
+
msgid "Executes before a single comment."
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: includes/class-genesis-simple-hooks-admin.php:345
|
256 |
msgid ""
|
257 |
+
"Executes in the comment list. Genesis uses this hook to output a single "
|
258 |
+
"comment."
|
|
|
|
|
|
|
|
|
|
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: includes/class-genesis-simple-hooks-admin.php:348
|
262 |
+
msgid "Executes after a single comment."
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: includes/class-genesis-simple-hooks-admin.php:351
|
266 |
+
msgid "Executes before the comment form."
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: includes/class-genesis-simple-hooks-admin.php:354
|
270 |
msgid ""
|
271 |
+
"Executes after the comment and ping list. Genesis uses this hook to output "
|
272 |
+
"the comment form."
|
|
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: includes/class-genesis-simple-hooks-admin.php:358
|
276 |
+
msgid "Executes after the comment form."
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: includes/class-genesis-simple-hooks-admin.php:364
|
280 |
+
msgid "Executes before the primary sidebar."
|
|
|
|
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: includes/class-genesis-simple-hooks-admin.php:367
|
284 |
msgid ""
|
285 |
+
"Executes after the content section in 2+ column layouts. Genesis uses this "
|
286 |
+
"hook to output the primary sidebar."
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: includes/class-genesis-simple-hooks-admin.php:371
|
290 |
+
msgid "Executes after the primary sidebar."
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: includes/class-genesis-simple-hooks-admin.php:374
|
294 |
+
msgid "Executes before the primary sidebar widget area."
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: includes/class-genesis-simple-hooks-admin.php:377
|
298 |
+
msgid "Executes after the primary sidebar widget area."
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: includes/class-genesis-simple-hooks-admin.php:380
|
302 |
+
msgid "Executes before the secondary sidebar."
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: includes/class-genesis-simple-hooks-admin.php:383
|
306 |
msgid ""
|
307 |
+
"Executes after the primary sidebar in 3+ column layouts. Genesis uses this "
|
308 |
+
"hook to output the secondary sidebar."
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: includes/class-genesis-simple-hooks-admin.php:387
|
312 |
+
msgid "Executes after the secondary sidebar."
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: includes/class-genesis-simple-hooks-admin.php:390
|
316 |
+
msgid "Executes before the secondary sidebar widget area."
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: includes/class-genesis-simple-hooks-admin.php:393
|
320 |
+
msgid "Executes after the secondary sidebar widget area."
|
321 |
msgstr ""
|
322 |
|
323 |
+
#: includes/class-genesis-simple-hooks-admin.php:399
|
324 |
+
msgid "Executes before the site footer."
|
325 |
msgstr ""
|
326 |
|
327 |
+
#: includes/class-genesis-simple-hooks-admin.php:402
|
328 |
msgid ""
|
329 |
+
"Executes after the content and sidebars. Genesis uses this hook to output "
|
330 |
+
"the site footer."
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: includes/class-genesis-simple-hooks-admin.php:406
|
334 |
+
msgid "Executes after the site footer."
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: includes/class-genesis-simple-hooks-admin.php:412
|
338 |
+
msgid "Executes after the form on the the import/export screen."
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: includes/class-genesis-simple-hooks-admin.php:415
|
342 |
+
msgid "Executes during the export function."
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: includes/class-genesis-simple-hooks-admin.php:418
|
346 |
+
msgid "Executes during the import function."
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: includes/class-genesis-simple-hooks-admin.php:421
|
350 |
+
msgid "Executes in the function that adds metaboxes to the theme settings screen."
|
351 |
msgstr ""
|
352 |
|
353 |
+
#: includes/class-genesis-simple-hooks-admin.php:424
|
354 |
+
msgid "Executes after Genesis upgrades itself."
|
355 |
msgstr ""
|
356 |
|
357 |
+
#: includes/class-genesis-simple-hooks-admin.php:485
|
358 |
msgid "Hook"
|
359 |
msgstr ""
|
360 |
|
361 |
+
#: includes/class-genesis-simple-hooks-admin.php:497
|
362 |
msgid "Unhook <code>%s()</code> function from this hook?"
|
363 |
msgstr ""
|
364 |
|
365 |
+
#: includes/class-genesis-simple-hooks-admin.php:515
|
366 |
msgid "Execute Shortcodes on this hook?"
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: includes/class-genesis-simple-hooks-admin.php:523
|
370 |
msgid "Execute PHP on this hook?"
|
371 |
msgstr ""
|
372 |
|
373 |
+
#: includes/class-genesis-simple-hooks-admin.php:543
|
374 |
+
msgid "WordPress Hooks"
|
|
|
|
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: includes/class-genesis-simple-hooks-admin.php:544
|
378 |
+
msgid "Document Hooks"
|
379 |
msgstr ""
|
380 |
|
381 |
+
#: includes/class-genesis-simple-hooks-admin.php:545
|
382 |
+
msgid "Header Hooks"
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: includes/class-genesis-simple-hooks-admin.php:546
|
386 |
+
msgid "Content Hooks"
|
|
|
|
|
387 |
msgstr ""
|
388 |
|
389 |
+
#: includes/class-genesis-simple-hooks-admin.php:547
|
390 |
+
msgid "Loop Hooks"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
#: includes/class-genesis-simple-hooks-admin.php:550
|
394 |
+
msgid "Entry Hooks"
|
395 |
+
msgstr ""
|
396 |
+
|
397 |
+
#: includes/class-genesis-simple-hooks-admin.php:552
|
398 |
+
msgid "Post/Page Hooks"
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: includes/class-genesis-simple-hooks-admin.php:554
|
402 |
+
msgid "Comment Hooks"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: includes/class-genesis-simple-hooks-admin.php:555
|
406 |
+
msgid "Sidebar Hooks"
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: includes/class-genesis-simple-hooks-admin.php:556
|
410 |
+
msgid "Footer Hooks"
|
411 |
+
msgstr ""
|
412 |
+
|
413 |
+
#: includes/class-genesis-simple-hooks-admin.php:564
|
414 |
+
#: includes/class-genesis-simple-hooks-admin.php:572
|
415 |
+
#: includes/class-genesis-simple-hooks-admin.php:580
|
416 |
+
#: includes/class-genesis-simple-hooks-admin.php:588
|
417 |
+
#: includes/class-genesis-simple-hooks-admin.php:596
|
418 |
+
#: includes/class-genesis-simple-hooks-admin.php:604
|
419 |
+
#: includes/class-genesis-simple-hooks-admin.php:612
|
420 |
+
#: includes/class-genesis-simple-hooks-admin.php:620
|
421 |
+
#: includes/class-genesis-simple-hooks-admin.php:628
|
422 |
+
#: includes/class-genesis-simple-hooks-admin.php:636
|
423 |
+
#: includes/class-genesis-simple-hooks-admin.php:644
|
424 |
+
msgid "Save Changes"
|
425 |
msgstr ""
|
package.json
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
"description": "Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the Genesis Theme.",
|
30 |
"author": "StudioPress",
|
31 |
"authoruri": "http://www.studiopress.com/",
|
32 |
-
"version": "2.
|
33 |
"license": "GPL-2.0+",
|
34 |
"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
|
35 |
"textdomain": "genesis-simple-hooks"
|
29 |
"description": "Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the Genesis Theme.",
|
30 |
"author": "StudioPress",
|
31 |
"authoruri": "http://www.studiopress.com/",
|
32 |
+
"version": "2.2.0",
|
33 |
"license": "GPL-2.0+",
|
34 |
"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
|
35 |
"textdomain": "genesis-simple-hooks"
|
plugin.php
CHANGED
@@ -1,138 +1,20 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
|
16 |
-
|
17 |
-
|
18 |
*/
|
19 |
|
20 |
-
|
21 |
-
define( 'SIMPLEHOOKS_SETTINGS_FIELD', 'simplehooks-settings' );
|
22 |
-
define( 'SIMPLEHOOKS_PLUGIN_DIR', dirname( __FILE__ ) );
|
23 |
-
|
24 |
-
register_activation_hook( __FILE__, 'simplehooks_activation' );
|
25 |
-
/**
|
26 |
-
* This function runs on plugin activation. It checks to make sure Genesis
|
27 |
-
* or a Genesis child theme is active. If not, it deactivates itself.
|
28 |
-
*
|
29 |
-
* @since 0.1.0
|
30 |
-
*/
|
31 |
-
function simplehooks_activation() {
|
32 |
-
|
33 |
-
if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.1.0', '>=' ) )
|
34 |
-
simplehooks_deactivate( '2.1.0', '3.9.2' );
|
35 |
-
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Deactivate Simple Hooks.
|
40 |
-
*
|
41 |
-
* This function deactivates Simple Hooks.
|
42 |
-
*
|
43 |
-
* @since 1.8.0.2
|
44 |
-
*/
|
45 |
-
function simplehooks_deactivate( $genesis_version = '2.1.0', $wp_version = '3.9.2' ) {
|
46 |
-
|
47 |
-
deactivate_plugins( plugin_basename( __FILE__ ) );
|
48 |
-
wp_die( sprintf( __( 'Sorry, you cannot run Simple Hooks without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'genesis-simple-hooks' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) );
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
add_action( 'plugins_loaded', 'simplehooks_load_textdomain' );
|
53 |
-
/**
|
54 |
-
* Load the plugin textdomain
|
55 |
-
*/
|
56 |
-
function simplehooks_load_textdomain() {
|
57 |
-
load_plugin_textdomain( 'genesis-simple-hooks', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
58 |
-
}
|
59 |
-
|
60 |
-
add_action( 'genesis_init', 'simplehooks_init', 20 );
|
61 |
-
/**
|
62 |
-
* Load admin menu and helper functions. Hooked to `genesis_init`.
|
63 |
-
*
|
64 |
-
* @since 1.8.0
|
65 |
-
*/
|
66 |
-
function simplehooks_init() {
|
67 |
-
|
68 |
-
//* Admin Menu
|
69 |
-
if ( is_admin() )
|
70 |
-
require_once( SIMPLEHOOKS_PLUGIN_DIR . '/admin.php' );
|
71 |
-
|
72 |
-
//* Helper functions
|
73 |
-
require_once( SIMPLEHOOKS_PLUGIN_DIR . '/functions.php' );
|
74 |
-
|
75 |
-
}
|
76 |
-
|
77 |
-
add_action( 'genesis_init', 'simplehooks_execute_hooks', 20 );
|
78 |
-
/**
|
79 |
-
* The following code loops through all the hooks, and attempts to
|
80 |
-
* execute the code in the proper location.
|
81 |
-
*
|
82 |
-
* @uses simplehooks_execute_hook() as a callback.
|
83 |
-
*
|
84 |
-
* @since 0.1
|
85 |
-
*/
|
86 |
-
function simplehooks_execute_hooks() {
|
87 |
-
|
88 |
-
$hooks = get_option( SIMPLEHOOKS_SETTINGS_FIELD );
|
89 |
-
|
90 |
-
foreach ( (array) $hooks as $hook => $array ) {
|
91 |
-
|
92 |
-
//* Add new content to hook
|
93 |
-
if ( simplehooks_get_option( $hook, 'content' ) ) {
|
94 |
-
add_action( $hook, 'simplehooks_execute_hook' );
|
95 |
-
}
|
96 |
-
|
97 |
-
//* Unhook stuff
|
98 |
-
if ( isset( $array['unhook'] ) ) {
|
99 |
-
|
100 |
-
foreach( (array) $array['unhook'] as $function ) {
|
101 |
-
|
102 |
-
remove_action( $hook, $function );
|
103 |
-
|
104 |
-
}
|
105 |
-
|
106 |
-
}
|
107 |
-
|
108 |
-
}
|
109 |
-
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* The following function executes any code meant to be hooked.
|
114 |
-
* It checks to see if shortcodes or PHP should be executed as well.
|
115 |
-
*
|
116 |
-
* @uses simplehooks_get_option()
|
117 |
-
*
|
118 |
-
* @since 0.1
|
119 |
-
*/
|
120 |
-
function simplehooks_execute_hook() {
|
121 |
-
|
122 |
-
$hook = current_filter();
|
123 |
-
$content = simplehooks_get_option( $hook, 'content' );
|
124 |
-
|
125 |
-
if( ! $hook || ! $content )
|
126 |
-
return;
|
127 |
-
|
128 |
-
$shortcodes = simplehooks_get_option( $hook, 'shortcodes' );
|
129 |
-
$php = simplehooks_get_option( $hook, 'php' );
|
130 |
-
|
131 |
-
$value = $shortcodes ? do_shortcode( $content ) : $content;
|
132 |
-
|
133 |
-
if ( $php )
|
134 |
-
eval( "?>$value<?php " );
|
135 |
-
else
|
136 |
-
echo $value;
|
137 |
-
|
138 |
-
}
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: Genesis Simple Hooks
|
4 |
+
Plugin URI: http://www.studiopress.com/plugins/simple-hooks
|
5 |
|
6 |
+
Description: Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the Genesis Theme.
|
7 |
|
8 |
+
Author: Nathan Rice
|
9 |
+
Author URI: http://www.nathanrice.net/
|
10 |
|
11 |
+
Version: 2.2.0
|
12 |
|
13 |
+
Text Domain: genesis-simple-hooks
|
14 |
+
Domain Path: /languages
|
15 |
|
16 |
+
License: GNU General Public License v2.0 (or later)
|
17 |
+
License URI: http://www.opensource.org/licenses/gpl-license.php
|
18 |
*/
|
19 |
|
20 |
+
require_once( plugin_dir_path( __FILE__ ) . 'genesis-simple-hooks.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
6 |
-
Tested up to: 4.3
|
7 |
-
Stable tag: 2.
|
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 |
|
@@ -72,6 +72,13 @@ The most common request from Genesis users is how to properly modify their foote
|
|
72 |
|
73 |
== Changelog ==
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
= 2.1.2 =
|
76 |
* Load textdomain
|
77 |
* Add plugin header i18n
|
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: 4.7.2
|
6 |
+
Tested up to: 4.7.3
|
7 |
+
Stable tag: 2.2.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 |
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 2.2.0 =
|
76 |
+
* Rewrite plugin based on new plugin boilerplate.
|
77 |
+
* Added new hooks.
|
78 |
+
* Require unfiltered_html capability to execute PHP.
|
79 |
+
* Better Genesis dependency handling.
|
80 |
+
* Change activation hook to conditional admin notice.
|
81 |
+
|
82 |
= 2.1.2 =
|
83 |
* Load textdomain
|
84 |
* Add plugin header i18n
|