Version Description
- Reorganize plugin based on our standard boilerplate.
- Update to match WordPress PHP standards.
- Fix bug where plugin name was empty in the minimum version warning.
- Increase minimum Genesis version to 2.5.0.
Download this release
Release Info
| Developer | nathanrice |
| Plugin | |
| Version | 2.3.0 |
| Comparing to | |
| See all releases | |
Code changes from version 2.2.1 to 2.3.0
- .circleci/config.yml +22 -0
- composer.json +33 -0
- composer.lock +461 -0
- genesis-simple-hooks.php +13 -194
- includes/class-genesis-simple-hooks-admin.php +225 -98
- includes/class-genesis-simple-hooks.php +231 -0
- includes/deprecated.php +5 -0
- includes/functions.php +17 -3
- languages/genesis-simple-hooks.pot +143 -177
- package-lock.json +4 -0
- package.json +3 -17
- plugin.php +19 -19
- readme.txt +11 -13
.circleci/config.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: 2.1
|
| 2 |
+
|
| 3 |
+
jobs:
|
| 4 |
+
test:
|
| 5 |
+
docker:
|
| 6 |
+
- image: circleci/php:7.3.3-stretch-node-browsers
|
| 7 |
+
steps:
|
| 8 |
+
- checkout
|
| 9 |
+
- prepare-environment
|
| 10 |
+
- run: composer phpcs
|
| 11 |
+
|
| 12 |
+
commands:
|
| 13 |
+
prepare-environment:
|
| 14 |
+
description: "Install dependencies."
|
| 15 |
+
steps:
|
| 16 |
+
- run: composer install
|
| 17 |
+
|
| 18 |
+
workflows:
|
| 19 |
+
version: 2
|
| 20 |
+
check-wp-cs:
|
| 21 |
+
jobs:
|
| 22 |
+
- test
|
composer.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "studiopress/genesis-simple-hooks",
|
| 3 |
+
"type": "wordpress-plugin",
|
| 4 |
+
"description": "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.",
|
| 5 |
+
"homepage": "https://github.com/studiopress/genesis-simple-hooks",
|
| 6 |
+
"license": "GPL-2.0-or-later",
|
| 7 |
+
"require": {
|
| 8 |
+
"php": "^5.3 || ^7",
|
| 9 |
+
"composer/installers": "^1"
|
| 10 |
+
},
|
| 11 |
+
"require-dev": {
|
| 12 |
+
"php": "^5.6 || ^7",
|
| 13 |
+
"dealerdirect/phpcodesniffer-composer-installer": "*",
|
| 14 |
+
"squizlabs/php_codesniffer": "^3.3.1",
|
| 15 |
+
"phpcompatibility/phpcompatibility-wp": "*",
|
| 16 |
+
"wp-coding-standards/wpcs": "^1"
|
| 17 |
+
},
|
| 18 |
+
"config": {
|
| 19 |
+
"sort-order": true
|
| 20 |
+
},
|
| 21 |
+
"minimum-stability": "dev",
|
| 22 |
+
"prefer-stable": true,
|
| 23 |
+
"scripts": {
|
| 24 |
+
"phpcs": "phpcs --standard=WordPress --ignore=vendor/,node_modules/,assets/ --extensions=php -p ./",
|
| 25 |
+
"phpcs-compat": "phpcs --extensions=php --standard=PHPCompatibilityWP --ignore=vendor/,node_modules/,assets/ --runtime-set testVersion 5.6- -p ./",
|
| 26 |
+
"phpcbf": "phpcbf --standard=WordPress --ignore=vendor/,node_modules/,assets/ --extensions=php -p ./",
|
| 27 |
+
"makepot": "wp i18n make-pot . languages/genesis-simple-hooks.pot --headers='{ \"Report-Msgid-Bugs-To\": \"StudioPress <translations@studiopress.com>\" }' --exclude=bin/ --quiet"
|
| 28 |
+
},
|
| 29 |
+
"support": {
|
| 30 |
+
"issues": "https://github.com/studiopress/genesis-simple-hooks/issues",
|
| 31 |
+
"source": "https://github.com/studiopress/genesis-simple-hooks"
|
| 32 |
+
}
|
| 33 |
+
}
|
composer.lock
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_readme": [
|
| 3 |
+
"This file locks the dependencies of your project to a known state",
|
| 4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
| 5 |
+
"This file is @generated automatically"
|
| 6 |
+
],
|
| 7 |
+
"content-hash": "c939e1e179a3723b40ed8369820ca4d8",
|
| 8 |
+
"packages": [
|
| 9 |
+
{
|
| 10 |
+
"name": "composer/installers",
|
| 11 |
+
"version": "v1.6.0",
|
| 12 |
+
"source": {
|
| 13 |
+
"type": "git",
|
| 14 |
+
"url": "https://github.com/composer/installers.git",
|
| 15 |
+
"reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b"
|
| 16 |
+
},
|
| 17 |
+
"dist": {
|
| 18 |
+
"type": "zip",
|
| 19 |
+
"url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b",
|
| 20 |
+
"reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b",
|
| 21 |
+
"shasum": ""
|
| 22 |
+
},
|
| 23 |
+
"require": {
|
| 24 |
+
"composer-plugin-api": "^1.0"
|
| 25 |
+
},
|
| 26 |
+
"replace": {
|
| 27 |
+
"roundcube/plugin-installer": "*",
|
| 28 |
+
"shama/baton": "*"
|
| 29 |
+
},
|
| 30 |
+
"require-dev": {
|
| 31 |
+
"composer/composer": "1.0.*@dev",
|
| 32 |
+
"phpunit/phpunit": "^4.8.36"
|
| 33 |
+
},
|
| 34 |
+
"type": "composer-plugin",
|
| 35 |
+
"extra": {
|
| 36 |
+
"class": "Composer\\Installers\\Plugin",
|
| 37 |
+
"branch-alias": {
|
| 38 |
+
"dev-master": "1.0-dev"
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"autoload": {
|
| 42 |
+
"psr-4": {
|
| 43 |
+
"Composer\\Installers\\": "src/Composer/Installers"
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 47 |
+
"license": [
|
| 48 |
+
"MIT"
|
| 49 |
+
],
|
| 50 |
+
"authors": [
|
| 51 |
+
{
|
| 52 |
+
"name": "Kyle Robinson Young",
|
| 53 |
+
"email": "kyle@dontkry.com",
|
| 54 |
+
"homepage": "https://github.com/shama"
|
| 55 |
+
}
|
| 56 |
+
],
|
| 57 |
+
"description": "A multi-framework Composer library installer",
|
| 58 |
+
"homepage": "https://composer.github.io/installers/",
|
| 59 |
+
"keywords": [
|
| 60 |
+
"Craft",
|
| 61 |
+
"Dolibarr",
|
| 62 |
+
"Eliasis",
|
| 63 |
+
"Hurad",
|
| 64 |
+
"ImageCMS",
|
| 65 |
+
"Kanboard",
|
| 66 |
+
"Lan Management System",
|
| 67 |
+
"MODX Evo",
|
| 68 |
+
"Mautic",
|
| 69 |
+
"Maya",
|
| 70 |
+
"OXID",
|
| 71 |
+
"Plentymarkets",
|
| 72 |
+
"Porto",
|
| 73 |
+
"RadPHP",
|
| 74 |
+
"SMF",
|
| 75 |
+
"Thelia",
|
| 76 |
+
"WolfCMS",
|
| 77 |
+
"agl",
|
| 78 |
+
"aimeos",
|
| 79 |
+
"annotatecms",
|
| 80 |
+
"attogram",
|
| 81 |
+
"bitrix",
|
| 82 |
+
"cakephp",
|
| 83 |
+
"chef",
|
| 84 |
+
"cockpit",
|
| 85 |
+
"codeigniter",
|
| 86 |
+
"concrete5",
|
| 87 |
+
"croogo",
|
| 88 |
+
"dokuwiki",
|
| 89 |
+
"drupal",
|
| 90 |
+
"eZ Platform",
|
| 91 |
+
"elgg",
|
| 92 |
+
"expressionengine",
|
| 93 |
+
"fuelphp",
|
| 94 |
+
"grav",
|
| 95 |
+
"installer",
|
| 96 |
+
"itop",
|
| 97 |
+
"joomla",
|
| 98 |
+
"kohana",
|
| 99 |
+
"laravel",
|
| 100 |
+
"lavalite",
|
| 101 |
+
"lithium",
|
| 102 |
+
"magento",
|
| 103 |
+
"majima",
|
| 104 |
+
"mako",
|
| 105 |
+
"mediawiki",
|
| 106 |
+
"modulework",
|
| 107 |
+
"modx",
|
| 108 |
+
"moodle",
|
| 109 |
+
"osclass",
|
| 110 |
+
"phpbb",
|
| 111 |
+
"piwik",
|
| 112 |
+
"ppi",
|
| 113 |
+
"puppet",
|
| 114 |
+
"pxcms",
|
| 115 |
+
"reindex",
|
| 116 |
+
"roundcube",
|
| 117 |
+
"shopware",
|
| 118 |
+
"silverstripe",
|
| 119 |
+
"sydes",
|
| 120 |
+
"symfony",
|
| 121 |
+
"typo3",
|
| 122 |
+
"wordpress",
|
| 123 |
+
"yawik",
|
| 124 |
+
"zend",
|
| 125 |
+
"zikula"
|
| 126 |
+
],
|
| 127 |
+
"time": "2018-08-27T06:10:37+00:00"
|
| 128 |
+
}
|
| 129 |
+
],
|
| 130 |
+
"packages-dev": [
|
| 131 |
+
{
|
| 132 |
+
"name": "dealerdirect/phpcodesniffer-composer-installer",
|
| 133 |
+
"version": "v0.5.0",
|
| 134 |
+
"source": {
|
| 135 |
+
"type": "git",
|
| 136 |
+
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
|
| 137 |
+
"reference": "e749410375ff6fb7a040a68878c656c2e610b132"
|
| 138 |
+
},
|
| 139 |
+
"dist": {
|
| 140 |
+
"type": "zip",
|
| 141 |
+
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132",
|
| 142 |
+
"reference": "e749410375ff6fb7a040a68878c656c2e610b132",
|
| 143 |
+
"shasum": ""
|
| 144 |
+
},
|
| 145 |
+
"require": {
|
| 146 |
+
"composer-plugin-api": "^1.0",
|
| 147 |
+
"php": "^5.3|^7",
|
| 148 |
+
"squizlabs/php_codesniffer": "^2|^3"
|
| 149 |
+
},
|
| 150 |
+
"require-dev": {
|
| 151 |
+
"composer/composer": "*",
|
| 152 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
| 153 |
+
"sensiolabs/security-checker": "^4.1.0"
|
| 154 |
+
},
|
| 155 |
+
"type": "composer-plugin",
|
| 156 |
+
"extra": {
|
| 157 |
+
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
|
| 158 |
+
},
|
| 159 |
+
"autoload": {
|
| 160 |
+
"psr-4": {
|
| 161 |
+
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
|
| 162 |
+
}
|
| 163 |
+
},
|
| 164 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 165 |
+
"license": [
|
| 166 |
+
"MIT"
|
| 167 |
+
],
|
| 168 |
+
"authors": [
|
| 169 |
+
{
|
| 170 |
+
"name": "Franck Nijhof",
|
| 171 |
+
"email": "franck.nijhof@dealerdirect.com",
|
| 172 |
+
"homepage": "http://www.frenck.nl",
|
| 173 |
+
"role": "Developer / IT Manager"
|
| 174 |
+
}
|
| 175 |
+
],
|
| 176 |
+
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
|
| 177 |
+
"homepage": "http://www.dealerdirect.com",
|
| 178 |
+
"keywords": [
|
| 179 |
+
"PHPCodeSniffer",
|
| 180 |
+
"PHP_CodeSniffer",
|
| 181 |
+
"code quality",
|
| 182 |
+
"codesniffer",
|
| 183 |
+
"composer",
|
| 184 |
+
"installer",
|
| 185 |
+
"phpcs",
|
| 186 |
+
"plugin",
|
| 187 |
+
"qa",
|
| 188 |
+
"quality",
|
| 189 |
+
"standard",
|
| 190 |
+
"standards",
|
| 191 |
+
"style guide",
|
| 192 |
+
"stylecheck",
|
| 193 |
+
"tests"
|
| 194 |
+
],
|
| 195 |
+
"time": "2018-10-26T13:21:45+00:00"
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"name": "phpcompatibility/php-compatibility",
|
| 199 |
+
"version": "9.2.0",
|
| 200 |
+
"source": {
|
| 201 |
+
"type": "git",
|
| 202 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
|
| 203 |
+
"reference": "3db1bf1e28123fd574a4ae2e9a84072826d51b5e"
|
| 204 |
+
},
|
| 205 |
+
"dist": {
|
| 206 |
+
"type": "zip",
|
| 207 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/3db1bf1e28123fd574a4ae2e9a84072826d51b5e",
|
| 208 |
+
"reference": "3db1bf1e28123fd574a4ae2e9a84072826d51b5e",
|
| 209 |
+
"shasum": ""
|
| 210 |
+
},
|
| 211 |
+
"require": {
|
| 212 |
+
"php": ">=5.3",
|
| 213 |
+
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
|
| 214 |
+
},
|
| 215 |
+
"conflict": {
|
| 216 |
+
"squizlabs/php_codesniffer": "2.6.2"
|
| 217 |
+
},
|
| 218 |
+
"require-dev": {
|
| 219 |
+
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
|
| 220 |
+
},
|
| 221 |
+
"suggest": {
|
| 222 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
|
| 223 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
| 224 |
+
},
|
| 225 |
+
"type": "phpcodesniffer-standard",
|
| 226 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 227 |
+
"license": [
|
| 228 |
+
"LGPL-3.0-or-later"
|
| 229 |
+
],
|
| 230 |
+
"authors": [
|
| 231 |
+
{
|
| 232 |
+
"name": "Contributors",
|
| 233 |
+
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"name": "Wim Godden",
|
| 237 |
+
"role": "lead",
|
| 238 |
+
"homepage": "https://github.com/wimg"
|
| 239 |
+
},
|
| 240 |
+
{
|
| 241 |
+
"name": "Juliette Reinders Folmer",
|
| 242 |
+
"role": "lead",
|
| 243 |
+
"homepage": "https://github.com/jrfnl"
|
| 244 |
+
}
|
| 245 |
+
],
|
| 246 |
+
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
|
| 247 |
+
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
|
| 248 |
+
"keywords": [
|
| 249 |
+
"compatibility",
|
| 250 |
+
"phpcs",
|
| 251 |
+
"standards"
|
| 252 |
+
],
|
| 253 |
+
"time": "2019-06-27T19:58:56+00:00"
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"name": "phpcompatibility/phpcompatibility-paragonie",
|
| 257 |
+
"version": "1.0.1",
|
| 258 |
+
"source": {
|
| 259 |
+
"type": "git",
|
| 260 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
|
| 261 |
+
"reference": "9160de79fcd683b5c99e9c4133728d91529753ea"
|
| 262 |
+
},
|
| 263 |
+
"dist": {
|
| 264 |
+
"type": "zip",
|
| 265 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/9160de79fcd683b5c99e9c4133728d91529753ea",
|
| 266 |
+
"reference": "9160de79fcd683b5c99e9c4133728d91529753ea",
|
| 267 |
+
"shasum": ""
|
| 268 |
+
},
|
| 269 |
+
"require": {
|
| 270 |
+
"phpcompatibility/php-compatibility": "^9.0"
|
| 271 |
+
},
|
| 272 |
+
"require-dev": {
|
| 273 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4"
|
| 274 |
+
},
|
| 275 |
+
"suggest": {
|
| 276 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
| 277 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
| 278 |
+
},
|
| 279 |
+
"type": "phpcodesniffer-standard",
|
| 280 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 281 |
+
"license": [
|
| 282 |
+
"LGPL-3.0-or-later"
|
| 283 |
+
],
|
| 284 |
+
"authors": [
|
| 285 |
+
{
|
| 286 |
+
"name": "Wim Godden",
|
| 287 |
+
"role": "lead"
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"name": "Juliette Reinders Folmer",
|
| 291 |
+
"role": "lead"
|
| 292 |
+
}
|
| 293 |
+
],
|
| 294 |
+
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
|
| 295 |
+
"homepage": "http://phpcompatibility.com/",
|
| 296 |
+
"keywords": [
|
| 297 |
+
"compatibility",
|
| 298 |
+
"paragonie",
|
| 299 |
+
"phpcs",
|
| 300 |
+
"polyfill",
|
| 301 |
+
"standards"
|
| 302 |
+
],
|
| 303 |
+
"time": "2018-12-16T19:10:44+00:00"
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
"name": "phpcompatibility/phpcompatibility-wp",
|
| 307 |
+
"version": "2.0.0",
|
| 308 |
+
"source": {
|
| 309 |
+
"type": "git",
|
| 310 |
+
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
|
| 311 |
+
"reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd"
|
| 312 |
+
},
|
| 313 |
+
"dist": {
|
| 314 |
+
"type": "zip",
|
| 315 |
+
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/cb303f0067cd5b366a41d4fb0e254fb40ff02efd",
|
| 316 |
+
"reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd",
|
| 317 |
+
"shasum": ""
|
| 318 |
+
},
|
| 319 |
+
"require": {
|
| 320 |
+
"phpcompatibility/php-compatibility": "^9.0",
|
| 321 |
+
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
|
| 322 |
+
},
|
| 323 |
+
"require-dev": {
|
| 324 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
|
| 325 |
+
},
|
| 326 |
+
"suggest": {
|
| 327 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
| 328 |
+
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
| 329 |
+
},
|
| 330 |
+
"type": "phpcodesniffer-standard",
|
| 331 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 332 |
+
"license": [
|
| 333 |
+
"LGPL-3.0-or-later"
|
| 334 |
+
],
|
| 335 |
+
"authors": [
|
| 336 |
+
{
|
| 337 |
+
"name": "Wim Godden",
|
| 338 |
+
"role": "lead"
|
| 339 |
+
},
|
| 340 |
+
{
|
| 341 |
+
"name": "Juliette Reinders Folmer",
|
| 342 |
+
"role": "lead"
|
| 343 |
+
}
|
| 344 |
+
],
|
| 345 |
+
"description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
|
| 346 |
+
"homepage": "http://phpcompatibility.com/",
|
| 347 |
+
"keywords": [
|
| 348 |
+
"compatibility",
|
| 349 |
+
"phpcs",
|
| 350 |
+
"standards",
|
| 351 |
+
"wordpress"
|
| 352 |
+
],
|
| 353 |
+
"time": "2018-10-07T18:31:37+00:00"
|
| 354 |
+
},
|
| 355 |
+
{
|
| 356 |
+
"name": "squizlabs/php_codesniffer",
|
| 357 |
+
"version": "3.4.2",
|
| 358 |
+
"source": {
|
| 359 |
+
"type": "git",
|
| 360 |
+
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
| 361 |
+
"reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8"
|
| 362 |
+
},
|
| 363 |
+
"dist": {
|
| 364 |
+
"type": "zip",
|
| 365 |
+
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
|
| 366 |
+
"reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8",
|
| 367 |
+
"shasum": ""
|
| 368 |
+
},
|
| 369 |
+
"require": {
|
| 370 |
+
"ext-simplexml": "*",
|
| 371 |
+
"ext-tokenizer": "*",
|
| 372 |
+
"ext-xmlwriter": "*",
|
| 373 |
+
"php": ">=5.4.0"
|
| 374 |
+
},
|
| 375 |
+
"require-dev": {
|
| 376 |
+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
| 377 |
+
},
|
| 378 |
+
"bin": [
|
| 379 |
+
"bin/phpcs",
|
| 380 |
+
"bin/phpcbf"
|
| 381 |
+
],
|
| 382 |
+
"type": "library",
|
| 383 |
+
"extra": {
|
| 384 |
+
"branch-alias": {
|
| 385 |
+
"dev-master": "3.x-dev"
|
| 386 |
+
}
|
| 387 |
+
},
|
| 388 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 389 |
+
"license": [
|
| 390 |
+
"BSD-3-Clause"
|
| 391 |
+
],
|
| 392 |
+
"authors": [
|
| 393 |
+
{
|
| 394 |
+
"name": "Greg Sherwood",
|
| 395 |
+
"role": "lead"
|
| 396 |
+
}
|
| 397 |
+
],
|
| 398 |
+
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
| 399 |
+
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
|
| 400 |
+
"keywords": [
|
| 401 |
+
"phpcs",
|
| 402 |
+
"standards"
|
| 403 |
+
],
|
| 404 |
+
"time": "2019-04-10T23:49:02+00:00"
|
| 405 |
+
},
|
| 406 |
+
{
|
| 407 |
+
"name": "wp-coding-standards/wpcs",
|
| 408 |
+
"version": "1.2.1",
|
| 409 |
+
"source": {
|
| 410 |
+
"type": "git",
|
| 411 |
+
"url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
|
| 412 |
+
"reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c"
|
| 413 |
+
},
|
| 414 |
+
"dist": {
|
| 415 |
+
"type": "zip",
|
| 416 |
+
"url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c",
|
| 417 |
+
"reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c",
|
| 418 |
+
"shasum": ""
|
| 419 |
+
},
|
| 420 |
+
"require": {
|
| 421 |
+
"php": ">=5.3",
|
| 422 |
+
"squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2"
|
| 423 |
+
},
|
| 424 |
+
"require-dev": {
|
| 425 |
+
"phpcompatibility/php-compatibility": "^9.0"
|
| 426 |
+
},
|
| 427 |
+
"suggest": {
|
| 428 |
+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
|
| 429 |
+
},
|
| 430 |
+
"type": "phpcodesniffer-standard",
|
| 431 |
+
"notification-url": "https://packagist.org/downloads/",
|
| 432 |
+
"license": [
|
| 433 |
+
"MIT"
|
| 434 |
+
],
|
| 435 |
+
"authors": [
|
| 436 |
+
{
|
| 437 |
+
"name": "Contributors",
|
| 438 |
+
"homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
|
| 439 |
+
}
|
| 440 |
+
],
|
| 441 |
+
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
|
| 442 |
+
"keywords": [
|
| 443 |
+
"phpcs",
|
| 444 |
+
"standards",
|
| 445 |
+
"wordpress"
|
| 446 |
+
],
|
| 447 |
+
"time": "2018-12-18T09:43:51+00:00"
|
| 448 |
+
}
|
| 449 |
+
],
|
| 450 |
+
"aliases": [],
|
| 451 |
+
"minimum-stability": "dev",
|
| 452 |
+
"stability-flags": [],
|
| 453 |
+
"prefer-stable": true,
|
| 454 |
+
"prefer-lowest": false,
|
| 455 |
+
"platform": {
|
| 456 |
+
"php": "^5.3 || ^7"
|
| 457 |
+
},
|
| 458 |
+
"platform-dev": {
|
| 459 |
+
"php": "^5.6 || ^7"
|
| 460 |
+
}
|
| 461 |
+
}
|
genesis-simple-hooks.php
CHANGED
|
@@ -1,213 +1,32 @@
|
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
* Plugin version
|
| 7 |
-
*/
|
| 8 |
-
public $plugin_version = '2.2.1';
|
| 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_admin_init', 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 |
-
$plugin = get_plugin_data( $this->plugin_dir_path . 'plugin.php' );
|
| 88 |
-
|
| 89 |
-
$action = defined( 'PARENT_THEME_VERSION' ) ? __( 'upgrade to', 'plugin-boilerplate' ) : __( 'install and activate', 'plugin-boilerplate' );
|
| 90 |
-
|
| 91 |
-
$message = sprintf( __( '%s requires WordPress %s and <a href="%s" target="_blank">Genesis %s</a>, or greater. Please %s the latest version of Genesis to use this plugin.', 'plugin-boilerplate' ), $plugin['name'], $this->min_wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $this->min_genesis_version, $action );
|
| 92 |
-
echo '<div class="notice notice-warning"><p>' . $message . '</p></div>';
|
| 93 |
-
|
| 94 |
-
}
|
| 95 |
-
|
| 96 |
-
}
|
| 97 |
-
|
| 98 |
-
/**
|
| 99 |
-
* Load the plugin textdomain, for translation.
|
| 100 |
-
*
|
| 101 |
-
* @since 2.2.0
|
| 102 |
-
*/
|
| 103 |
-
public function load_plugin_textdomain() {
|
| 104 |
-
load_plugin_textdomain( 'genesis-simple-hooks', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
| 105 |
-
}
|
| 106 |
-
|
| 107 |
-
/**
|
| 108 |
-
* All general includes.
|
| 109 |
-
*
|
| 110 |
-
* @since 2.2.0
|
| 111 |
-
*/
|
| 112 |
-
public function includes() {
|
| 113 |
-
|
| 114 |
-
require_once( $this->plugin_dir_path . 'includes/functions.php' );
|
| 115 |
-
require_once( $this->plugin_dir_path . 'includes/deprecated.php' );
|
| 116 |
-
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
/**
|
| 120 |
-
* Include the class file, instantiate the classes, create objects.
|
| 121 |
-
*
|
| 122 |
-
* @since 2.2.0
|
| 123 |
-
*/
|
| 124 |
-
public function instantiate() {
|
| 125 |
-
|
| 126 |
-
require_once( $this->plugin_dir_path . 'includes/class-genesis-simple-hooks-admin.php' );
|
| 127 |
-
$this->admin = new Genesis_Simple_Hooks_Admin;
|
| 128 |
-
$this->admin->init();
|
| 129 |
-
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
/**
|
| 133 |
-
* Helper function to retrieve the static object without using globals.
|
| 134 |
-
*
|
| 135 |
-
* @since 2.2.0
|
| 136 |
-
*/
|
| 137 |
-
public function execute_hooks() {
|
| 138 |
-
|
| 139 |
-
$hooks = get_option( $this->settings_field );
|
| 140 |
-
|
| 141 |
-
//print_r( $hooks );
|
| 142 |
-
|
| 143 |
-
foreach ( (array) $hooks as $hook => $array ) {
|
| 144 |
-
|
| 145 |
-
// Add new content to hook
|
| 146 |
-
if ( ! empty( $array['content'] ) ) {
|
| 147 |
-
add_action( $hook, array( $this, 'execute_hook' ) );
|
| 148 |
-
}
|
| 149 |
-
|
| 150 |
-
// Unhook stuff
|
| 151 |
-
if ( isset( $array['unhook'] ) ) {
|
| 152 |
-
|
| 153 |
-
foreach( (array) $array['unhook'] as $function ) {
|
| 154 |
-
remove_action( $hook, $function );
|
| 155 |
-
}
|
| 156 |
-
|
| 157 |
-
}
|
| 158 |
-
|
| 159 |
-
}
|
| 160 |
-
|
| 161 |
-
}
|
| 162 |
-
|
| 163 |
-
/**
|
| 164 |
-
* The following function executes any code meant to be hooked.
|
| 165 |
-
* It checks to see if shortcodes or PHP should be executed as well.
|
| 166 |
-
*
|
| 167 |
-
* @uses simplehooks_get_option()
|
| 168 |
-
*
|
| 169 |
-
* @since 2.2.0
|
| 170 |
-
*/
|
| 171 |
-
public function execute_hook() {
|
| 172 |
-
|
| 173 |
-
$hook = current_filter();
|
| 174 |
-
$content = simplehooks_get_option( $hook, 'content' );
|
| 175 |
-
|
| 176 |
-
if ( ! $hook || ! $content ) {
|
| 177 |
-
return;
|
| 178 |
-
}
|
| 179 |
-
|
| 180 |
-
$shortcodes = simplehooks_get_option( $hook, 'shortcodes' );
|
| 181 |
-
$php = simplehooks_get_option( $hook, 'php' );
|
| 182 |
-
|
| 183 |
-
$value = $shortcodes ? do_shortcode( $content ) : $content;
|
| 184 |
-
|
| 185 |
-
if ( $php ) {
|
| 186 |
-
eval( "?>$value " );
|
| 187 |
-
} else {
|
| 188 |
-
echo $value;
|
| 189 |
-
}
|
| 190 |
-
|
| 191 |
-
}
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
/**
|
| 196 |
* Helper function to retrieve the static object without using globals.
|
| 197 |
*
|
| 198 |
* @since 0.9.0
|
| 199 |
*/
|
| 200 |
-
function
|
| 201 |
|
| 202 |
static $object;
|
| 203 |
|
| 204 |
-
if ( null
|
| 205 |
-
$object = new Genesis_Simple_Hooks;
|
| 206 |
}
|
| 207 |
|
| 208 |
return $object;
|
| 209 |
}
|
| 210 |
/**
|
| 211 |
-
* Initialize the object on
|
| 212 |
*/
|
| 213 |
add_action( 'plugins_loaded', array( Genesis_Simple_Hooks(), 'init' ) );
|
| 1 |
<?php
|
| 2 |
+
/**
|
| 3 |
+
* This file handles the creation of the Simple Hooks admin menu.
|
| 4 |
+
*
|
| 5 |
+
* @package genesis-simple-hooks
|
| 6 |
+
*/
|
| 7 |
|
| 8 |
+
define( 'GENESIS_SIMPLE_HOOKS_DIR', plugin_dir_path( __FILE__ ) );
|
| 9 |
+
define( 'GENESIS_SIMPLE_HOOKS_URL', plugins_url( '', __FILE__ ) );
|
| 10 |
+
define( 'GENESIS_SIMPLE_HOOKS_VERSION', '2.3.0' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
require_once GENESIS_SIMPLE_HOOKS_DIR . '/includes/class-genesis-simple-hooks.php';
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Helper function to retrieve the static object without using globals.
|
| 16 |
*
|
| 17 |
* @since 0.9.0
|
| 18 |
*/
|
| 19 |
+
function genesis_simple_hooks() {
|
| 20 |
|
| 21 |
static $object;
|
| 22 |
|
| 23 |
+
if ( null === $object ) {
|
| 24 |
+
$object = new Genesis_Simple_Hooks();
|
| 25 |
}
|
| 26 |
|
| 27 |
return $object;
|
| 28 |
}
|
| 29 |
/**
|
| 30 |
+
* Initialize the object on `plugins_loaded`.
|
| 31 |
*/
|
| 32 |
add_action( 'plugins_loaded', array( Genesis_Simple_Hooks(), 'init' ) );
|
includes/class-genesis-simple-hooks-admin.php
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 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.
|
|
@@ -16,40 +17,118 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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();
|
|
@@ -80,15 +159,15 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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 |
}
|
|
@@ -97,11 +176,10 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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_scripts()->enqueue_and_localize_admin_scripts();
|
| 107 |
|
|
@@ -111,6 +189,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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 |
|
|
@@ -131,7 +212,6 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 131 |
$newvalue[ $hook ]['php'] = $oldvalue[ $hook ]['php'];
|
| 132 |
|
| 133 |
}
|
| 134 |
-
|
| 135 |
}
|
| 136 |
|
| 137 |
return $newvalue;
|
|
@@ -146,7 +226,7 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 146 |
public function define_hooks() {
|
| 147 |
|
| 148 |
$this->wp_hooks = array(
|
| 149 |
-
'wp_head'
|
| 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 |
),
|
|
@@ -161,42 +241,42 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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'
|
| 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'
|
| 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'
|
| 173 |
'description' => __( 'Executes immediately after the opening <code><body></code> tag.', 'genesis-simple-hooks' ),
|
| 174 |
),
|
| 175 |
-
'genesis_after'
|
| 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'
|
| 182 |
-
'description' => __( 'Executes immediately before the header.', 'genesis-simple-hooks' )
|
| 183 |
),
|
| 184 |
-
'genesis_header'
|
| 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'
|
| 189 |
'description' => __( 'Executes inside the page header, immediately before the header widget area.', 'genesis-simple-hooks' ),
|
| 190 |
),
|
| 191 |
-
'genesis_after_header'
|
| 192 |
-
'description' => __( 'Executes immediately after the header.', 'genesis-simple-hooks' )
|
| 193 |
),
|
| 194 |
-
'genesis_site_title'
|
| 195 |
-
'description' => __( 'Executes inside the header. Genesis uses this hook to output the site title.'
|
| 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.'
|
| 200 |
'unhook' => array( 'genesis_seo_site_description' ),
|
| 201 |
),
|
| 202 |
);
|
|
@@ -205,37 +285,37 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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'
|
| 209 |
'description' => __( 'Executes after the content-sidebar-wrap closing markup.', 'genesis-simple-hooks' ),
|
| 210 |
),
|
| 211 |
-
'genesis_before_content'
|
| 212 |
'description' => __( 'Executes before the content opening markup.', 'genesis-simple-hooks' ),
|
| 213 |
),
|
| 214 |
-
'genesis_after_content'
|
| 215 |
'description' => __( 'Executes after the content closing markup.', 'genesis-simple-hooks' ),
|
| 216 |
),
|
| 217 |
);
|
| 218 |
|
| 219 |
$this->loop_hooks = array(
|
| 220 |
-
'genesis_before_loop'
|
| 221 |
'description' => __( 'Executes before the loop.', 'genesis-simple-hooks' ),
|
| 222 |
),
|
| 223 |
-
'genesis_loop'
|
| 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'
|
| 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'
|
| 235 |
'description' => __( "Executes in the loop's else statement.", 'genesis-simple-hooks' ),
|
| 236 |
'unhook' => array( 'genesis_do_noposts' ),
|
| 237 |
),
|
| 238 |
-
'genesis_reset_loops'
|
| 239 |
'description' => __( 'Executes if the loop actions are reset.', 'genesis-simple-hooks' ),
|
| 240 |
),
|
| 241 |
);
|
|
@@ -244,10 +324,10 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 244 |
* HTML5 entry hooks
|
| 245 |
*/
|
| 246 |
$this->entry_hooks = array(
|
| 247 |
-
'genesis_before_entry'
|
| 248 |
'description' => __( 'Executes before the entry.', 'genesis-simple-hooks' ),
|
| 249 |
),
|
| 250 |
-
'genesis_entry_header'
|
| 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 |
),
|
|
@@ -255,141 +335,141 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 255 |
'description' => __( 'Executes before the entry content', 'genesis-simple-hooks' ),
|
| 256 |
'unhook' => array( 'genesis_do_post_content' ),
|
| 257 |
),
|
| 258 |
-
'genesis_entry_content'
|
| 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'
|
| 263 |
'description' => __( 'Executes after the entry content', 'genesis-simple-hooks' ),
|
| 264 |
'unhook' => array( 'genesis_do_post_content' ),
|
| 265 |
),
|
| 266 |
-
'genesis_entry_footer'
|
| 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'
|
| 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'
|
| 281 |
'description' => __( 'Executes before the post opening markup.', 'genesis-simple-hooks' ),
|
| 282 |
),
|
| 283 |
-
'genesis_after_post'
|
| 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'
|
| 288 |
'description' => __( 'Executes before the post title.', 'genesis-simple-hooks' ),
|
| 289 |
'unhook' => array( 'genesis_do_post_format_image' ),
|
| 290 |
),
|
| 291 |
-
'genesis_post_title'
|
| 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'
|
| 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'
|
| 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'
|
| 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'
|
| 314 |
'description' => __( 'Executes before the comments section opening markup.', 'genesis-simple-hooks' ),
|
| 315 |
),
|
| 316 |
-
'genesis_comments'
|
| 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'
|
| 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'
|
| 325 |
'description' => __( 'Executes after the comments section closing markup.', 'genesis-simple-hooks' ),
|
| 326 |
),
|
| 327 |
-
'genesis_before_pings'
|
| 328 |
'description' => __( 'Executes before the pings section opening markup.', 'genesis-simple-hooks' ),
|
| 329 |
),
|
| 330 |
-
'genesis_pings'
|
| 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'
|
| 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'
|
| 339 |
'description' => __( 'Executes after the ping section closing markup.', 'genesis-simple-hooks' ),
|
| 340 |
),
|
| 341 |
-
'genesis_before_comment'
|
| 342 |
'description' => __( 'Executes before a single comment.', 'genesis-simple-hooks' ),
|
| 343 |
),
|
| 344 |
-
'genesis_comment'
|
| 345 |
'description' => __( 'Executes in the comment list. Genesis uses this hook to output a single comment.', 'genesis-simple-hooks' ),
|
| 346 |
),
|
| 347 |
-
'genesis_after_comment'
|
| 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'
|
| 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'
|
| 358 |
'description' => __( 'Executes after the comment form.', 'genesis-simple-hooks' ),
|
| 359 |
),
|
| 360 |
);
|
| 361 |
|
| 362 |
$this->sidebar_hooks = array(
|
| 363 |
-
'genesis_before_sidebar'
|
| 364 |
'description' => __( 'Executes before the primary sidebar.', 'genesis-simple-hooks' ),
|
| 365 |
),
|
| 366 |
-
'genesis_sidebar'
|
| 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'
|
| 371 |
'description' => __( 'Executes after the primary sidebar.', 'genesis-simple-hooks' ),
|
| 372 |
),
|
| 373 |
-
'genesis_before_sidebar_widget_area'
|
| 374 |
'description' => __( 'Executes before the primary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 375 |
),
|
| 376 |
-
'genesis_after_sidebar_widget_area'
|
| 377 |
'description' => __( 'Executes after the primary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 378 |
),
|
| 379 |
-
'genesis_before_sidebar_alt'
|
| 380 |
'description' => __( 'Executes before the secondary sidebar.', 'genesis-simple-hooks' ),
|
| 381 |
),
|
| 382 |
-
'genesis_sidebar_alt'
|
| 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'
|
| 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'
|
| 393 |
'description' => __( 'Executes after the secondary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 394 |
),
|
| 395 |
);
|
|
@@ -398,29 +478,29 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 398 |
'genesis_before_footer' => array(
|
| 399 |
'description' => __( 'Executes before the site footer.', 'genesis-simple-hooks' ),
|
| 400 |
),
|
| 401 |
-
'genesis_footer'
|
| 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'
|
| 406 |
'description' => __( 'Executes after the site footer.', 'genesis-simple-hooks' ),
|
| 407 |
),
|
| 408 |
);
|
| 409 |
|
| 410 |
$this->admin_hooks = array(
|
| 411 |
-
'genesis_import_export_form'
|
| 412 |
'description' => __( 'Executes after the form on the the import/export screen.', 'genesis-simple-hooks' ),
|
| 413 |
),
|
| 414 |
-
'genesis_export'
|
| 415 |
'description' => __( 'Executes during the export function.', 'genesis-simple-hooks' ),
|
| 416 |
),
|
| 417 |
-
'genesis_import'
|
| 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'
|
| 424 |
'description' => __( 'Executes after Genesis upgrades itself.', 'genesis-simple-hooks' ),
|
| 425 |
'unhook' => array( 'genesis_upgrade_redirect' ),
|
| 426 |
),
|
|
@@ -435,7 +515,14 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 435 |
*/
|
| 436 |
public function get_default_settings() {
|
| 437 |
|
| 438 |
-
return array_fill_keys(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 439 |
|
| 440 |
}
|
| 441 |
|
|
@@ -446,7 +533,7 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 446 |
*/
|
| 447 |
public function get_hooks() {
|
| 448 |
|
| 449 |
-
// Merge all hooks arrays
|
| 450 |
$hooks = array_merge(
|
| 451 |
$this->wp_hooks,
|
| 452 |
$this->document_hooks,
|
|
@@ -461,7 +548,7 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 461 |
$this->admin_hooks
|
| 462 |
);
|
| 463 |
|
| 464 |
-
// Just the keys
|
| 465 |
$hooks = array_keys( $hooks );
|
| 466 |
|
| 467 |
return $hooks;
|
|
@@ -472,55 +559,62 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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 |
-
|
|
|
|
| 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 |
|
|
@@ -533,11 +627,10 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 533 |
}
|
| 534 |
|
| 535 |
/**
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 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' );
|
|
@@ -546,10 +639,11 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 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' );
|
|
@@ -557,6 +651,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 557 |
|
| 558 |
}
|
| 559 |
|
|
|
|
|
|
|
|
|
|
| 560 |
public function wp_hooks_box() {
|
| 561 |
|
| 562 |
$this->generate_form_markup_from_hooks( $this->wp_hooks );
|
|
@@ -565,6 +662,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 565 |
|
| 566 |
}
|
| 567 |
|
|
|
|
|
|
|
|
|
|
| 568 |
public function internal_hooks_box() {
|
| 569 |
|
| 570 |
$this->generate_form_markup_from_hooks( $this->internal_hooks );
|
|
@@ -573,6 +673,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 573 |
|
| 574 |
}
|
| 575 |
|
|
|
|
|
|
|
|
|
|
| 576 |
public function document_hooks_box() {
|
| 577 |
|
| 578 |
$this->generate_form_markup_from_hooks( $this->document_hooks );
|
|
@@ -581,6 +684,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 581 |
|
| 582 |
}
|
| 583 |
|
|
|
|
|
|
|
|
|
|
| 584 |
public function header_hooks_box() {
|
| 585 |
|
| 586 |
$this->generate_form_markup_from_hooks( $this->header_hooks );
|
|
@@ -589,6 +695,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 589 |
|
| 590 |
}
|
| 591 |
|
|
|
|
|
|
|
|
|
|
| 592 |
public function content_hooks_box() {
|
| 593 |
|
| 594 |
$this->generate_form_markup_from_hooks( $this->content_hooks );
|
|
@@ -597,6 +706,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 597 |
|
| 598 |
}
|
| 599 |
|
|
|
|
|
|
|
|
|
|
| 600 |
public function loop_hooks_box() {
|
| 601 |
|
| 602 |
$this->generate_form_markup_from_hooks( $this->loop_hooks );
|
|
@@ -605,6 +717,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 605 |
|
| 606 |
}
|
| 607 |
|
|
|
|
|
|
|
|
|
|
| 608 |
public function html5_entry_hooks_box() {
|
| 609 |
|
| 610 |
$this->generate_form_markup_from_hooks( $this->entry_hooks );
|
|
@@ -613,6 +728,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 613 |
|
| 614 |
}
|
| 615 |
|
|
|
|
|
|
|
|
|
|
| 616 |
public function post_hooks_box() {
|
| 617 |
|
| 618 |
$this->generate_form_markup_from_hooks( $this->post_hooks );
|
|
@@ -621,6 +739,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 621 |
|
| 622 |
}
|
| 623 |
|
|
|
|
|
|
|
|
|
|
| 624 |
public function comment_hooks_box() {
|
| 625 |
|
| 626 |
$this->generate_form_markup_from_hooks( $this->comment_hooks );
|
|
@@ -629,6 +750,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 629 |
|
| 630 |
}
|
| 631 |
|
|
|
|
|
|
|
|
|
|
| 632 |
public function sidebar_hooks_box() {
|
| 633 |
|
| 634 |
$this->generate_form_markup_from_hooks( $this->sidebar_hooks );
|
|
@@ -637,6 +761,9 @@ class Genesis_Simple_Hooks_Admin extends Genesis_Admin_Boxes {
|
|
| 637 |
|
| 638 |
}
|
| 639 |
|
|
|
|
|
|
|
|
|
|
| 640 |
public function footer_hooks_box() {
|
| 641 |
|
| 642 |
$this->generate_form_markup_from_hooks( $this->footer_hooks );
|
| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* This file handles the creation of the Simple Hooks admin menu.
|
| 4 |
+
*
|
| 5 |
+
* @package genesis-simple-hooks
|
| 6 |
*/
|
| 7 |
|
|
|
|
| 8 |
/**
|
| 9 |
* Registers a new admin page, providing content and corresponding menu item
|
| 10 |
* for the Simple Hooks Settings page.
|
| 17 |
* Settings field.
|
| 18 |
*
|
| 19 |
* @since 2.2.0
|
| 20 |
+
*
|
| 21 |
+
* @var $settings_field Settings Field
|
| 22 |
*/
|
| 23 |
public $settings_field = 'simplehooks-settings';
|
| 24 |
|
| 25 |
+
/**
|
| 26 |
+
* WP Hooks.
|
| 27 |
+
*
|
| 28 |
+
* @since 2.2.0
|
| 29 |
+
*
|
| 30 |
+
* @var $wp_hooks WP Hooks
|
| 31 |
+
*/
|
| 32 |
public $wp_hooks;
|
| 33 |
|
| 34 |
+
/**
|
| 35 |
+
* Document Hooks.
|
| 36 |
+
*
|
| 37 |
+
* @since 2.2.0
|
| 38 |
+
*
|
| 39 |
+
* @var $document_hooks Document Hooks
|
| 40 |
+
*/
|
| 41 |
public $document_hooks;
|
| 42 |
|
| 43 |
+
/**
|
| 44 |
+
* Header Hooks.
|
| 45 |
+
*
|
| 46 |
+
* @since 2.2.0
|
| 47 |
+
*
|
| 48 |
+
* @var $header_hooks Header Hooks
|
| 49 |
+
*/
|
| 50 |
public $header_hooks;
|
| 51 |
|
| 52 |
+
/**
|
| 53 |
+
* Content Hooks.
|
| 54 |
+
*
|
| 55 |
+
* @since 2.2.0
|
| 56 |
+
*
|
| 57 |
+
* @var $content_hooks Content Hooks
|
| 58 |
+
*/
|
| 59 |
public $content_hooks;
|
| 60 |
|
| 61 |
+
/**
|
| 62 |
+
* Loop Hooks.
|
| 63 |
+
*
|
| 64 |
+
* @since 2.2.0
|
| 65 |
+
*
|
| 66 |
+
* @var $loop_hooks Loop Hooks
|
| 67 |
+
*/
|
| 68 |
public $loop_hooks;
|
| 69 |
|
| 70 |
+
/**
|
| 71 |
+
* Entry Hooks.
|
| 72 |
+
*
|
| 73 |
+
* @since 2.2.0
|
| 74 |
+
*
|
| 75 |
+
* @var $settings_field Entry Hooks
|
| 76 |
+
*/
|
| 77 |
public $entry_hooks;
|
| 78 |
|
| 79 |
+
/**
|
| 80 |
+
* Post Hooks.
|
| 81 |
+
*
|
| 82 |
+
* @since 2.2.0
|
| 83 |
+
*
|
| 84 |
+
* @var $settings_field Post Hooks
|
| 85 |
+
*/
|
| 86 |
public $post_hooks;
|
| 87 |
|
| 88 |
+
/**
|
| 89 |
+
* Comment Hooks.
|
| 90 |
+
*
|
| 91 |
+
* @since 2.2.0
|
| 92 |
+
*
|
| 93 |
+
* @var $comment_hooks Comment Hooks
|
| 94 |
+
*/
|
| 95 |
public $comment_hooks;
|
| 96 |
|
| 97 |
+
/**
|
| 98 |
+
* Sidebar Hooks.
|
| 99 |
+
*
|
| 100 |
+
* @since 2.2.0
|
| 101 |
+
*
|
| 102 |
+
* @var $sidebar_hooks Sidebar Hooks
|
| 103 |
+
*/
|
| 104 |
public $sidebar_hooks;
|
| 105 |
|
| 106 |
+
/**
|
| 107 |
+
* Footer Hooks.
|
| 108 |
+
*
|
| 109 |
+
* @since 2.2.0
|
| 110 |
+
*
|
| 111 |
+
* @var $footer_hooks Footer Hooks
|
| 112 |
+
*/
|
| 113 |
public $footer_hooks;
|
| 114 |
|
| 115 |
+
/**
|
| 116 |
+
* Admin Hooks.
|
| 117 |
+
*
|
| 118 |
+
* @since 2.2.0
|
| 119 |
+
*
|
| 120 |
+
* @var $admin_hooks Admin Hooks
|
| 121 |
+
*/
|
| 122 |
public $admin_hooks;
|
| 123 |
|
| 124 |
/**
|
| 125 |
* Constructor.
|
| 126 |
*
|
| 127 |
* @since 1.8.0
|
|
|
|
| 128 |
*/
|
| 129 |
public function __construct() {
|
| 130 |
|
| 131 |
+
// For backward compatibility.
|
| 132 |
define( 'SIMPLEHOOKS_SETTINGS_FIELD', $this->settings_field );
|
| 133 |
|
| 134 |
$this->define_hooks();
|
| 159 |
'submenu' => array(
|
| 160 |
'parent_slug' => 'genesis',
|
| 161 |
'page_title' => __( 'Genesis - Simple Hooks', 'genesis-simple-hooks' ),
|
| 162 |
+
'menu_title' => __( 'Simple Hooks', 'genesis-simple-hooks' ),
|
| 163 |
+
),
|
| 164 |
);
|
| 165 |
|
| 166 |
$page_ops = array(
|
| 167 |
'screen_icon' => 'plugins',
|
| 168 |
);
|
| 169 |
|
| 170 |
+
// Create the page.
|
| 171 |
$this->create( $page_id, $menu_ops, $page_ops, $this->settings_field, $this->get_default_settings() );
|
| 172 |
|
| 173 |
}
|
| 176 |
* Load the necessary scripts for this admin page.
|
| 177 |
*
|
| 178 |
* @since 1.8.0
|
|
|
|
| 179 |
*/
|
| 180 |
public function scripts() {
|
| 181 |
|
| 182 |
+
// Load parent scripts as well as Genesis admin scripts.
|
| 183 |
parent::scripts();
|
| 184 |
genesis_scripts()->enqueue_and_localize_admin_scripts();
|
| 185 |
|
| 189 |
* Save method. Allows for data manipulation and sanitization before saving.
|
| 190 |
*
|
| 191 |
* @since 2.2.0
|
| 192 |
+
*
|
| 193 |
+
* @param Array $newvalue New value.
|
| 194 |
+
* @param Array $oldvalue Old value.
|
| 195 |
*/
|
| 196 |
public function save( $newvalue, $oldvalue ) {
|
| 197 |
|
| 212 |
$newvalue[ $hook ]['php'] = $oldvalue[ $hook ]['php'];
|
| 213 |
|
| 214 |
}
|
|
|
|
| 215 |
}
|
| 216 |
|
| 217 |
return $newvalue;
|
| 226 |
public function define_hooks() {
|
| 227 |
|
| 228 |
$this->wp_hooks = array(
|
| 229 |
+
'wp_head' => array(
|
| 230 |
'description' => __( 'Executes immediately before the closing <code></head></code> tag.', 'genesis-simple-hooks' ),
|
| 231 |
'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' ),
|
| 232 |
),
|
| 241 |
'description' => __( 'Executes in the document head. Genesis uses this to output the doctype.', 'genesis-simple-hooks' ),
|
| 242 |
'unhook' => array( 'genesis_do_doctype' ),
|
| 243 |
),
|
| 244 |
+
'genesis_title' => array(
|
| 245 |
'description' => __( 'Executes in the document head. Genesis uses this to output the document title.', 'genesis-simple-hooks' ),
|
| 246 |
'unhook' => array( 'genesis_do_title' ),
|
| 247 |
),
|
| 248 |
+
'genesis_meta' => array(
|
| 249 |
'description' => __( 'Executes in the document head. Genesis uses this to output meta tags.', 'genesis-simple-hooks' ),
|
| 250 |
+
'unhook' => array( 'genesis_seo_meta_description', 'genesis_seo_meta_keywords', 'genesis_robots_meta', 'genesis_responsive_viewport' ),
|
| 251 |
),
|
| 252 |
+
'genesis_before' => array(
|
| 253 |
'description' => __( 'Executes immediately after the opening <code><body></code> tag.', 'genesis-simple-hooks' ),
|
| 254 |
),
|
| 255 |
+
'genesis_after' => array(
|
| 256 |
'description' => __( 'Executes immediately before the closing <code></body></code> tag.', 'genesis-simple-hooks' ),
|
| 257 |
),
|
| 258 |
);
|
| 259 |
|
| 260 |
$this->header_hooks = array(
|
| 261 |
+
'genesis_before_header' => array(
|
| 262 |
+
'description' => __( 'Executes immediately before the header.', 'genesis-simple-hooks' ),
|
| 263 |
),
|
| 264 |
+
'genesis_header' => array(
|
| 265 |
'description' => __( 'Genesis uses this hook to output the default header.', 'genesis-simple-hooks' ),
|
| 266 |
'unhook' => array( 'genesis_do_header' ),
|
| 267 |
),
|
| 268 |
+
'genesis_header_right' => array(
|
| 269 |
'description' => __( 'Executes inside the page header, immediately before the header widget area.', 'genesis-simple-hooks' ),
|
| 270 |
),
|
| 271 |
+
'genesis_after_header' => array(
|
| 272 |
+
'description' => __( 'Executes immediately after the header.', 'genesis-simple-hooks' ),
|
| 273 |
),
|
| 274 |
+
'genesis_site_title' => array(
|
| 275 |
+
'description' => __( 'Executes inside the header. Genesis uses this hook to output the site title.', 'genesis-simple-hooks' ),
|
| 276 |
'unhook' => array( 'genesis_seo_site_title' ),
|
| 277 |
),
|
| 278 |
'genesis_site_description' => array(
|
| 279 |
+
'description' => __( 'Executes inside the header. Genesis uses this hook to output the site description.', 'genesis-simple-hooks' ),
|
| 280 |
'unhook' => array( 'genesis_seo_site_description' ),
|
| 281 |
),
|
| 282 |
);
|
| 285 |
'genesis_before_content_sidebar_wrap' => array(
|
| 286 |
'description' => __( 'Executes before the content-sidebar-wrap opening markup.', 'genesis-simple-hooks' ),
|
| 287 |
),
|
| 288 |
+
'genesis_after_content_sidebar_wrap' => array(
|
| 289 |
'description' => __( 'Executes after the content-sidebar-wrap closing markup.', 'genesis-simple-hooks' ),
|
| 290 |
),
|
| 291 |
+
'genesis_before_content' => array(
|
| 292 |
'description' => __( 'Executes before the content opening markup.', 'genesis-simple-hooks' ),
|
| 293 |
),
|
| 294 |
+
'genesis_after_content' => array(
|
| 295 |
'description' => __( 'Executes after the content closing markup.', 'genesis-simple-hooks' ),
|
| 296 |
),
|
| 297 |
);
|
| 298 |
|
| 299 |
$this->loop_hooks = array(
|
| 300 |
+
'genesis_before_loop' => array(
|
| 301 |
'description' => __( 'Executes before the loop.', 'genesis-simple-hooks' ),
|
| 302 |
),
|
| 303 |
+
'genesis_loop' => array(
|
| 304 |
'description' => __( 'Executes in the content section. Genesis uses this hook to output the loop.', 'genesis-simple-hooks' ),
|
| 305 |
'unhook' => array( 'genesis_do_loop' ),
|
| 306 |
),
|
| 307 |
+
'genesis_after_loop' => array(
|
| 308 |
'description' => __( 'Executes after the loop.', 'genesis-simple-hooks' ),
|
| 309 |
),
|
| 310 |
'genesis_after_endwhile' => array(
|
| 311 |
'description' => __( 'Executes after the WordPress loop endwhile.', 'genesis-simple-hooks' ),
|
| 312 |
'unhook' => array( 'genesis_posts_nav' ),
|
| 313 |
),
|
| 314 |
+
'genesis_loop_else' => array(
|
| 315 |
'description' => __( "Executes in the loop's else statement.", 'genesis-simple-hooks' ),
|
| 316 |
'unhook' => array( 'genesis_do_noposts' ),
|
| 317 |
),
|
| 318 |
+
'genesis_reset_loops' => array(
|
| 319 |
'description' => __( 'Executes if the loop actions are reset.', 'genesis-simple-hooks' ),
|
| 320 |
),
|
| 321 |
);
|
| 324 |
* HTML5 entry hooks
|
| 325 |
*/
|
| 326 |
$this->entry_hooks = array(
|
| 327 |
+
'genesis_before_entry' => array(
|
| 328 |
'description' => __( 'Executes before the entry.', 'genesis-simple-hooks' ),
|
| 329 |
),
|
| 330 |
+
'genesis_entry_header' => array(
|
| 331 |
'description' => __( 'Executes as part of the entry. Genesis uses this hook to output the entry header.', 'genesis-simple-hooks' ),
|
| 332 |
'unhook' => array( 'genesis_do_post_title' ),
|
| 333 |
),
|
| 335 |
'description' => __( 'Executes before the entry content', 'genesis-simple-hooks' ),
|
| 336 |
'unhook' => array( 'genesis_do_post_content' ),
|
| 337 |
),
|
| 338 |
+
'genesis_entry_content' => array(
|
| 339 |
'description' => __( 'Executes as part of the entry. Genesis uses this hook to output the entry content.', 'genesis-simple-hooks' ),
|
| 340 |
'unhook' => array( 'genesis_do_post_content' ),
|
| 341 |
),
|
| 342 |
+
'genesis_after_entry_content' => array(
|
| 343 |
'description' => __( 'Executes after the entry content', 'genesis-simple-hooks' ),
|
| 344 |
'unhook' => array( 'genesis_do_post_content' ),
|
| 345 |
),
|
| 346 |
+
'genesis_entry_footer' => array(
|
| 347 |
'description' => __( 'Executes as part of the entry. Genesis uses this hook to output the entry footer.', 'genesis-simple-hooks' ),
|
| 348 |
'unhook' => array( 'genesis_post_meta' ),
|
| 349 |
),
|
| 350 |
+
'genesis_after_entry' => array(
|
| 351 |
'description' => __( 'Executes after the entry.', 'genesis-simple-hooks' ),
|
| 352 |
'unhook' => array( 'genesis_adjacent_entry_nav', 'genesis_get_comments_template' ),
|
| 353 |
),
|
| 354 |
);
|
| 355 |
|
| 356 |
/**
|
| 357 |
+
* The xHTML post hooks
|
| 358 |
*/
|
| 359 |
$this->post_hooks = array(
|
| 360 |
+
'genesis_before_post' => array(
|
| 361 |
'description' => __( 'Executes before the post opening markup.', 'genesis-simple-hooks' ),
|
| 362 |
),
|
| 363 |
+
'genesis_after_post' => array(
|
| 364 |
'description' => __( 'Executes after the post closing markup.', 'genesis-simple-hooks' ),
|
| 365 |
'unhook' => array( 'genesis_do_author_box_single', 'genesis_get_comments_template' ),
|
| 366 |
),
|
| 367 |
+
'genesis_before_post_title' => array(
|
| 368 |
'description' => __( 'Executes before the post title.', 'genesis-simple-hooks' ),
|
| 369 |
'unhook' => array( 'genesis_do_post_format_image' ),
|
| 370 |
),
|
| 371 |
+
'genesis_post_title' => array(
|
| 372 |
'description' => __( 'Executes as part of the post. Genesis uses this hook to output the post title.', 'genesis-simple-hooks' ),
|
| 373 |
'unhook' => array( 'genesis_do_post_title' ),
|
| 374 |
),
|
| 375 |
+
'genesis_after_post_title' => array(
|
| 376 |
'description' => __( 'Executes after the post title.', 'genesis-simple-hooks' ),
|
| 377 |
),
|
| 378 |
'genesis_before_post_content' => array(
|
| 379 |
'description' => __( 'Executes before the post content.', 'genesis-simple-hooks' ),
|
| 380 |
'unhook' => array( 'genesis_post_info' ),
|
| 381 |
),
|
| 382 |
+
'genesis_post_content' => array(
|
| 383 |
'description' => __( 'Executes as part of the post. Genesis uses this hook to output the post content.', 'genesis-simple-hooks' ),
|
| 384 |
'unhook' => array( 'genesis_do_post_image', 'genesis_do_post_content', 'genesis_do_post_permalink', 'genesis_do_post_content_nav' ),
|
| 385 |
),
|
| 386 |
+
'genesis_after_post_content' => array(
|
| 387 |
'description' => __( 'Executes after the post content.', 'genesis-simple-hooks' ),
|
| 388 |
'unhook' => array( 'genesis_post_meta' ),
|
| 389 |
),
|
| 390 |
);
|
| 391 |
|
| 392 |
$this->comment_hooks = array(
|
| 393 |
+
'genesis_before_comments' => array(
|
| 394 |
'description' => __( 'Executes before the comments section opening markup.', 'genesis-simple-hooks' ),
|
| 395 |
),
|
| 396 |
+
'genesis_comments' => array(
|
| 397 |
'description' => __( 'Executes after an entry. Genesis uses this hook to output the comments section.', 'genesis-simple-hooks' ),
|
| 398 |
'unhook' => array( 'genesis_do_comments' ),
|
| 399 |
),
|
| 400 |
+
'genesis_list_comments' => array(
|
| 401 |
'description' => __( 'Executes in the comments section. Genesis uses this hook to output the comment list.', 'genesis-simple-hooks' ),
|
| 402 |
'unhook' => array( 'genesis_default_list_comments' ),
|
| 403 |
),
|
| 404 |
+
'genesis_after_comments' => array(
|
| 405 |
'description' => __( 'Executes after the comments section closing markup.', 'genesis-simple-hooks' ),
|
| 406 |
),
|
| 407 |
+
'genesis_before_pings' => array(
|
| 408 |
'description' => __( 'Executes before the pings section opening markup.', 'genesis-simple-hooks' ),
|
| 409 |
),
|
| 410 |
+
'genesis_pings' => array(
|
| 411 |
'description' => __( 'Executes after an entry. Genesis uses this hook to output the pings section.', 'genesis-simple-hooks' ),
|
| 412 |
'unhook' => array( 'genesis_do_pings' ),
|
| 413 |
),
|
| 414 |
+
'genesis_list_pings' => array(
|
| 415 |
'description' => __( 'Executes in the pings section. Genesis uses this hook to output the ping list.', 'genesis-simple-hooks' ),
|
| 416 |
'unhook' => array( 'genesis_default_list_pings' ),
|
| 417 |
),
|
| 418 |
+
'genesis_after_pings' => array(
|
| 419 |
'description' => __( 'Executes after the ping section closing markup.', 'genesis-simple-hooks' ),
|
| 420 |
),
|
| 421 |
+
'genesis_before_comment' => array(
|
| 422 |
'description' => __( 'Executes before a single comment.', 'genesis-simple-hooks' ),
|
| 423 |
),
|
| 424 |
+
'genesis_comment' => array(
|
| 425 |
'description' => __( 'Executes in the comment list. Genesis uses this hook to output a single comment.', 'genesis-simple-hooks' ),
|
| 426 |
),
|
| 427 |
+
'genesis_after_comment' => array(
|
| 428 |
'description' => __( 'Executes after a single comment.', 'genesis-simple-hooks' ),
|
| 429 |
),
|
| 430 |
'genesis_before_comment_form' => array(
|
| 431 |
'description' => __( 'Executes before the comment form.', 'genesis-simple-hooks' ),
|
| 432 |
),
|
| 433 |
+
'genesis_comment_form' => array(
|
| 434 |
'description' => __( 'Executes after the comment and ping list. Genesis uses this hook to output the comment form.', 'genesis-simple-hooks' ),
|
| 435 |
'unhook' => array( 'genesis_do_comment_form' ),
|
| 436 |
),
|
| 437 |
+
'genesis_after_comment_form' => array(
|
| 438 |
'description' => __( 'Executes after the comment form.', 'genesis-simple-hooks' ),
|
| 439 |
),
|
| 440 |
);
|
| 441 |
|
| 442 |
$this->sidebar_hooks = array(
|
| 443 |
+
'genesis_before_sidebar' => array(
|
| 444 |
'description' => __( 'Executes before the primary sidebar.', 'genesis-simple-hooks' ),
|
| 445 |
),
|
| 446 |
+
'genesis_sidebar' => array(
|
| 447 |
'description' => __( 'Executes after the content section in 2+ column layouts. Genesis uses this hook to output the primary sidebar.', 'genesis-simple-hooks' ),
|
| 448 |
'unhook' => array( 'genesis_do_sidebar' ),
|
| 449 |
),
|
| 450 |
+
'genesis_after_sidebar' => array(
|
| 451 |
'description' => __( 'Executes after the primary sidebar.', 'genesis-simple-hooks' ),
|
| 452 |
),
|
| 453 |
+
'genesis_before_sidebar_widget_area' => array(
|
| 454 |
'description' => __( 'Executes before the primary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 455 |
),
|
| 456 |
+
'genesis_after_sidebar_widget_area' => array(
|
| 457 |
'description' => __( 'Executes after the primary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 458 |
),
|
| 459 |
+
'genesis_before_sidebar_alt' => array(
|
| 460 |
'description' => __( 'Executes before the secondary sidebar.', 'genesis-simple-hooks' ),
|
| 461 |
),
|
| 462 |
+
'genesis_sidebar_alt' => array(
|
| 463 |
'description' => __( 'Executes after the primary sidebar in 3+ column layouts. Genesis uses this hook to output the secondary sidebar.', 'genesis-simple-hooks' ),
|
| 464 |
'unhook' => array( 'genesis_do_sidebar_alt' ),
|
| 465 |
),
|
| 466 |
+
'genesis_after_sidebar_alt' => array(
|
| 467 |
'description' => __( 'Executes after the secondary sidebar.', 'genesis-simple-hooks' ),
|
| 468 |
),
|
| 469 |
'genesis_before_sidebar_alt_widget_area' => array(
|
| 470 |
'description' => __( 'Executes before the secondary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 471 |
),
|
| 472 |
+
'genesis_after_sidebar_alt_widget_area' => array(
|
| 473 |
'description' => __( 'Executes after the secondary sidebar widget area.', 'genesis-simple-hooks' ),
|
| 474 |
),
|
| 475 |
);
|
| 478 |
'genesis_before_footer' => array(
|
| 479 |
'description' => __( 'Executes before the site footer.', 'genesis-simple-hooks' ),
|
| 480 |
),
|
| 481 |
+
'genesis_footer' => array(
|
| 482 |
'description' => __( 'Executes after the content and sidebars. Genesis uses this hook to output the site footer.', 'genesis-simple-hooks' ),
|
| 483 |
'unhook' => array( 'genesis_do_footer' ),
|
| 484 |
),
|
| 485 |
+
'genesis_after_footer' => array(
|
| 486 |
'description' => __( 'Executes after the site footer.', 'genesis-simple-hooks' ),
|
| 487 |
),
|
| 488 |
);
|
| 489 |
|
| 490 |
$this->admin_hooks = array(
|
| 491 |
+
'genesis_import_export_form' => array(
|
| 492 |
'description' => __( 'Executes after the form on the the import/export screen.', 'genesis-simple-hooks' ),
|
| 493 |
),
|
| 494 |
+
'genesis_export' => array(
|
| 495 |
'description' => __( 'Executes during the export function.', 'genesis-simple-hooks' ),
|
| 496 |
),
|
| 497 |
+
'genesis_import' => array(
|
| 498 |
'description' => __( 'Executes during the import function.', 'genesis-simple-hooks' ),
|
| 499 |
),
|
| 500 |
'genesis_theme_settings_metaboxes' => array(
|
| 501 |
'description' => __( 'Executes in the function that adds metaboxes to the theme settings screen.', 'genesis-simple-hooks' ),
|
| 502 |
),
|
| 503 |
+
'genesis_upgrade' => array(
|
| 504 |
'description' => __( 'Executes after Genesis upgrades itself.', 'genesis-simple-hooks' ),
|
| 505 |
'unhook' => array( 'genesis_upgrade_redirect' ),
|
| 506 |
),
|
| 515 |
*/
|
| 516 |
public function get_default_settings() {
|
| 517 |
|
| 518 |
+
return array_fill_keys(
|
| 519 |
+
$this->get_hooks(),
|
| 520 |
+
array(
|
| 521 |
+
'content' => '',
|
| 522 |
+
'php' => 0,
|
| 523 |
+
'shortcodes' => 0,
|
| 524 |
+
)
|
| 525 |
+
);
|
| 526 |
|
| 527 |
}
|
| 528 |
|
| 533 |
*/
|
| 534 |
public function get_hooks() {
|
| 535 |
|
| 536 |
+
// Merge all hooks arrays.
|
| 537 |
$hooks = array_merge(
|
| 538 |
$this->wp_hooks,
|
| 539 |
$this->document_hooks,
|
| 548 |
$this->admin_hooks
|
| 549 |
);
|
| 550 |
|
| 551 |
+
// Just the keys.
|
| 552 |
$hooks = array_keys( $hooks );
|
| 553 |
|
| 554 |
return $hooks;
|
| 559 |
* Generate form markup from an array of hooks.
|
| 560 |
*
|
| 561 |
* @since 2.2.0
|
| 562 |
+
*
|
| 563 |
+
* @param Array $hooks Hooks.
|
| 564 |
*/
|
| 565 |
public function generate_form_markup_from_hooks( $hooks ) {
|
| 566 |
|
| 567 |
foreach ( (array) $hooks as $hook => $info ) {
|
| 568 |
|
| 569 |
+
// Check for existence in hooks array.
|
| 570 |
+
if ( ! in_array( $hook, $this->get_hooks(), true ) ) {
|
| 571 |
continue;
|
| 572 |
}
|
| 573 |
|
| 574 |
+
printf( '<h4><code>%s</code> %s</h4>', esc_html( $hook ), esc_html( __( 'Hook', 'genesis-simple-hooks' ) ) );
|
| 575 |
+
printf( '<p><span class="description">%s</span></p>', esc_html( $info['description'] ) );
|
| 576 |
|
| 577 |
if ( isset( $info['unhook'] ) ) {
|
| 578 |
+
$allowed_html = array(
|
| 579 |
+
'a' => array(
|
| 580 |
+
'href' => array(),
|
| 581 |
+
'target' => array(),
|
| 582 |
+
),
|
| 583 |
+
);
|
| 584 |
foreach ( (array) $info['unhook'] as $function ) {
|
| 585 |
printf(
|
| 586 |
'<label><input type="checkbox" name="%s" id="%s" value="%s" %s/> %s</label><br />',
|
| 587 |
$this->settings_field . "[{$hook}][unhook][]",
|
| 588 |
$this->settings_field . "[{$hook}][unhook][]",
|
| 589 |
$function,
|
| 590 |
+
in_array( $function, (array) simplehooks_get_option( $hook, 'unhook' ), true ) ? 'checked' : '',
|
| 591 |
+
// Translators: The string is the name of a function.
|
| 592 |
+
sprintf( wp_kses( __( 'Unhook <code>%s()</code> function from this hook?', 'genesis-simple-hooks' ), $allowed_html ), esc_html( $function ) )
|
| 593 |
);
|
| 594 |
}
|
|
|
|
| 595 |
}
|
| 596 |
|
| 597 |
printf(
|
| 598 |
'<p><textarea name="%s" cols="70" rows="5">%s</textarea></p>',
|
| 599 |
+
esc_attr( $this->settings_field . "[{$hook}][content]" ),
|
| 600 |
+
esc_html( htmlentities( simplehooks_get_option( $hook, 'content' ), ENT_QUOTES, 'UTF-8' ) )
|
| 601 |
);
|
| 602 |
|
| 603 |
echo '<p>';
|
| 604 |
|
| 605 |
printf(
|
| 606 |
'<input type="checkbox" name="%1$s" id="%1$s" value="1" %2$s/> <label for="%1$s">%3$s</label><br />',
|
| 607 |
+
esc_attr( $this->settings_field . "[{$hook}][shortcodes]" ),
|
| 608 |
checked( 1, simplehooks_get_option( $hook, 'shortcodes' ), 0 ),
|
| 609 |
+
esc_html( __( 'Execute Shortcodes on this hook?', 'genesis-simple-hooks' ) )
|
| 610 |
);
|
| 611 |
|
| 612 |
if ( current_user_can( 'unfiltered_html' ) ) {
|
| 613 |
printf(
|
| 614 |
'<input type="checkbox" name="%1$s" id="%1$s" value="1" %2$s/> <label for="%1$s">%3$s</label><br />',
|
| 615 |
+
esc_attr( $this->settings_field . "[{$hook}][php]" ),
|
| 616 |
checked( 1, simplehooks_get_option( $hook, 'php' ), 0 ),
|
| 617 |
+
esc_html( __( 'Execute PHP on this hook?', 'genesis-simple-hooks' ) )
|
| 618 |
);
|
| 619 |
}
|
| 620 |
|
| 627 |
}
|
| 628 |
|
| 629 |
/**
|
| 630 |
+
* Register meta boxes on the Simple Hooks Settings page.
|
| 631 |
+
*
|
| 632 |
+
* @since 1.8.0
|
| 633 |
+
*/
|
|
|
|
| 634 |
public function metaboxes() {
|
| 635 |
|
| 636 |
add_meta_box( 'simplehooks-wp-hooks', __( 'WordPress Hooks', 'genesis-simple-hooks' ), array( $this, 'wp_hooks_box' ), $this->pagehook, 'main' );
|
| 639 |
add_meta_box( 'simplehooks-content-hooks', __( 'Content Hooks', 'genesis-simple-hooks' ), array( $this, 'content_hooks_box' ), $this->pagehook, 'main' );
|
| 640 |
add_meta_box( 'simplehooks-loop-hooks', __( 'Loop Hooks', 'genesis-simple-hooks' ), array( $this, 'loop_hooks_box' ), $this->pagehook, 'main' );
|
| 641 |
|
| 642 |
+
if ( current_theme_supports( 'html5' ) ) {
|
| 643 |
add_meta_box( 'simplehooks-entry-hooks', __( 'Entry Hooks', 'genesis-simple-hooks' ), array( $this, 'html5_entry_hooks_box' ), $this->pagehook, 'main' );
|
| 644 |
+
} else {
|
| 645 |
add_meta_box( 'simplehooks-post-hooks', __( 'Post/Page Hooks', 'genesis-simple-hooks' ), array( $this, 'post_hooks_box' ), $this->pagehook, 'main' );
|
| 646 |
+
}
|
| 647 |
|
| 648 |
add_meta_box( 'simplehooks-comment-hooks', __( 'Comment Hooks', 'genesis-simple-hooks' ), array( $this, 'comment_hooks_box' ), $this->pagehook, 'main' );
|
| 649 |
add_meta_box( 'simplehooks-sidebar-hooks', __( 'Sidebar Hooks', 'genesis-simple-hooks' ), array( $this, 'sidebar_hooks_box' ), $this->pagehook, 'main' );
|
| 651 |
|
| 652 |
}
|
| 653 |
|
| 654 |
+
/**
|
| 655 |
+
* WP Hooks Box
|
| 656 |
+
*/
|
| 657 |
public function wp_hooks_box() {
|
| 658 |
|
| 659 |
$this->generate_form_markup_from_hooks( $this->wp_hooks );
|
| 662 |
|
| 663 |
}
|
| 664 |
|
| 665 |
+
/**
|
| 666 |
+
* Internal Hooks Box
|
| 667 |
+
*/
|
| 668 |
public function internal_hooks_box() {
|
| 669 |
|
| 670 |
$this->generate_form_markup_from_hooks( $this->internal_hooks );
|
| 673 |
|
| 674 |
}
|
| 675 |
|
| 676 |
+
/**
|
| 677 |
+
* Document Hooks Box
|
| 678 |
+
*/
|
| 679 |
public function document_hooks_box() {
|
| 680 |
|
| 681 |
$this->generate_form_markup_from_hooks( $this->document_hooks );
|
| 684 |
|
| 685 |
}
|
| 686 |
|
| 687 |
+
/**
|
| 688 |
+
* Header Hooks Box
|
| 689 |
+
*/
|
| 690 |
public function header_hooks_box() {
|
| 691 |
|
| 692 |
$this->generate_form_markup_from_hooks( $this->header_hooks );
|
| 695 |
|
| 696 |
}
|
| 697 |
|
| 698 |
+
/**
|
| 699 |
+
* Content Hooks Box
|
| 700 |
+
*/
|
| 701 |
public function content_hooks_box() {
|
| 702 |
|
| 703 |
$this->generate_form_markup_from_hooks( $this->content_hooks );
|
| 706 |
|
| 707 |
}
|
| 708 |
|
| 709 |
+
/**
|
| 710 |
+
* Loop Hooks Box
|
| 711 |
+
*/
|
| 712 |
public function loop_hooks_box() {
|
| 713 |
|
| 714 |
$this->generate_form_markup_from_hooks( $this->loop_hooks );
|
| 717 |
|
| 718 |
}
|
| 719 |
|
| 720 |
+
/**
|
| 721 |
+
* HTML5 Entry Hooks Box
|
| 722 |
+
*/
|
| 723 |
public function html5_entry_hooks_box() {
|
| 724 |
|
| 725 |
$this->generate_form_markup_from_hooks( $this->entry_hooks );
|
| 728 |
|
| 729 |
}
|
| 730 |
|
| 731 |
+
/**
|
| 732 |
+
* Post Hooks Box
|
| 733 |
+
*/
|
| 734 |
public function post_hooks_box() {
|
| 735 |
|
| 736 |
$this->generate_form_markup_from_hooks( $this->post_hooks );
|
| 739 |
|
| 740 |
}
|
| 741 |
|
| 742 |
+
/**
|
| 743 |
+
* Comment Hooks Box
|
| 744 |
+
*/
|
| 745 |
public function comment_hooks_box() {
|
| 746 |
|
| 747 |
$this->generate_form_markup_from_hooks( $this->comment_hooks );
|
| 750 |
|
| 751 |
}
|
| 752 |
|
| 753 |
+
/**
|
| 754 |
+
* Sidebar Hooks Box
|
| 755 |
+
*/
|
| 756 |
public function sidebar_hooks_box() {
|
| 757 |
|
| 758 |
$this->generate_form_markup_from_hooks( $this->sidebar_hooks );
|
| 761 |
|
| 762 |
}
|
| 763 |
|
| 764 |
+
/**
|
| 765 |
+
* Footer Hooks Box
|
| 766 |
+
*/
|
| 767 |
public function footer_hooks_box() {
|
| 768 |
|
| 769 |
$this->generate_form_markup_from_hooks( $this->footer_hooks );
|
includes/class-genesis-simple-hooks.php
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* This file handles the creation of the Simple Hooks admin menu.
|
| 4 |
+
*
|
| 5 |
+
* @package genesis-simple-hooks
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
/**
|
| 9 |
+
* Plugin Name: Genesis Simple Hooks
|
| 10 |
+
* Plugin URI: http://www.studiopress.com/plugins/simple-hooks
|
| 11 |
+
*
|
| 12 |
+
* Description: Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the Genesis Theme.
|
| 13 |
+
*
|
| 14 |
+
* Author: StudioPress
|
| 15 |
+
* Author URI: http://www.studiopress.com/
|
| 16 |
+
*
|
| 17 |
+
* Version: 2.3.0
|
| 18 |
+
*
|
| 19 |
+
* Text Domain: genesis-simple-hooks
|
| 20 |
+
* Domain Path: /languages
|
| 21 |
+
*
|
| 22 |
+
* License: GNU General Public License v2.0 (or later)
|
| 23 |
+
* License URI: http://www.opensource.org/licenses/gpl-license.php
|
| 24 |
+
*/
|
| 25 |
+
class Genesis_Simple_Hooks {
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Plugin version
|
| 29 |
+
*
|
| 30 |
+
* @var $plugin_version The plugin version
|
| 31 |
+
*/
|
| 32 |
+
public $plugin_version = GENESIS_SIMPLE_HOOKS_VERSION;
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* Minimum WordPress version.
|
| 36 |
+
*
|
| 37 |
+
* @var $min_wp_version The minimum WordPress version
|
| 38 |
+
*/
|
| 39 |
+
public $min_wp_version = '4.7.2';
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* Minimum Genesis version.
|
| 43 |
+
*
|
| 44 |
+
* @var $min_wp_version The minimum WordPress version
|
| 45 |
+
*/
|
| 46 |
+
public $min_genesis_version = '2.5.0';
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* The plugin textdomain, for translations.
|
| 50 |
+
*
|
| 51 |
+
* @var $plugin_textdomain The plugin text domain
|
| 52 |
+
*/
|
| 53 |
+
public $plugin_textdomain = 'genesis-simple-hooks';
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* The url to the plugin directory.
|
| 57 |
+
*
|
| 58 |
+
* @var $plugin_dir_url The plugin directory url
|
| 59 |
+
*/
|
| 60 |
+
public $plugin_dir_url;
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* The path to the plugin directory.
|
| 64 |
+
*
|
| 65 |
+
* @var $plugin_dir_path The plugin directory path
|
| 66 |
+
*/
|
| 67 |
+
public $plugin_dir_path;
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* The main settings field for this plugin.
|
| 71 |
+
*
|
| 72 |
+
* @var $settings_field The minimum settings field
|
| 73 |
+
*/
|
| 74 |
+
public $settings_field = 'simplehooks-settings';
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Admin menu and settings page.
|
| 78 |
+
*
|
| 79 |
+
* @var $admin The minimum WordPress version
|
| 80 |
+
*/
|
| 81 |
+
public $admin;
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* Constructor.
|
| 85 |
+
*
|
| 86 |
+
* @since 2.2.0
|
| 87 |
+
*/
|
| 88 |
+
public function __construct() {
|
| 89 |
+
|
| 90 |
+
$this->plugin_dir_url = GENESIS_SIMPLE_HOOKS_URL;
|
| 91 |
+
$this->plugin_dir_path = GENESIS_SIMPLE_HOOKS_DIR;
|
| 92 |
+
|
| 93 |
+
// For backward compatibility.
|
| 94 |
+
define( 'SIMPLEHOOKS_PLUGIN_DIR', $this->plugin_dir_path );
|
| 95 |
+
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* Initialize.
|
| 100 |
+
*
|
| 101 |
+
* @since 2.2.0
|
| 102 |
+
*/
|
| 103 |
+
public function init() {
|
| 104 |
+
|
| 105 |
+
$this->load_plugin_textdomain();
|
| 106 |
+
|
| 107 |
+
add_action( 'admin_notices', array( $this, 'requirements_notice' ) );
|
| 108 |
+
|
| 109 |
+
// Because this is a Genesis-dependent plugin.
|
| 110 |
+
add_action( 'genesis_setup', array( $this, 'includes' ) );
|
| 111 |
+
add_action( 'genesis_admin_init', array( $this, 'instantiate' ) );
|
| 112 |
+
add_action( 'genesis_setup', array( $this, 'execute_hooks' ) );
|
| 113 |
+
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/**
|
| 117 |
+
* Show admin notice if minimum requirements aren't met.
|
| 118 |
+
*
|
| 119 |
+
* @since 2.2.0
|
| 120 |
+
*/
|
| 121 |
+
public function requirements_notice() {
|
| 122 |
+
|
| 123 |
+
if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, $this->min_genesis_version, '>=' ) ) {
|
| 124 |
+
|
| 125 |
+
$plugin = get_plugin_data( $this->plugin_dir_path . 'includes/class-genesis-simple-hooks.php' );
|
| 126 |
+
|
| 127 |
+
$action = defined( 'PARENT_THEME_VERSION' ) ? __( 'upgrade to', 'plugin-boilerplate' ) : __( 'install and activate', 'plugin-boilerplate' );
|
| 128 |
+
|
| 129 |
+
// Translators: String 1 is the name of the plugin, String 2 is the minimum required version of WordPress, String 3 is a url, String 4 is the minimum required version of Genesis, and String 5 is an expected action.
|
| 130 |
+
$message = sprintf( __( '%1$s requires WordPress %2$s and <a href="%3$s" target="_blank">Genesis %4$s</a>, or greater. Please %5$s the latest version of Genesis to use this plugin.', 'plugin-boilerplate' ), $plugin['Name'], $this->min_wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $this->min_genesis_version, $action );
|
| 131 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- html in $message required for hyperlinks
|
| 132 |
+
echo '<div class="notice notice-warning"><p>' . $message . '</p></div>';
|
| 133 |
+
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* Load the plugin textdomain, for translation.
|
| 140 |
+
*
|
| 141 |
+
* @since 2.2.0
|
| 142 |
+
*/
|
| 143 |
+
public function load_plugin_textdomain() {
|
| 144 |
+
load_plugin_textdomain( 'genesis-simple-hooks', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* All general includes.
|
| 149 |
+
*
|
| 150 |
+
* @since 2.2.0
|
| 151 |
+
*/
|
| 152 |
+
public function includes() {
|
| 153 |
+
|
| 154 |
+
require_once $this->plugin_dir_path . 'includes/functions.php';
|
| 155 |
+
require_once $this->plugin_dir_path . 'includes/deprecated.php';
|
| 156 |
+
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
/**
|
| 160 |
+
* Include the class file, instantiate the classes, create objects.
|
| 161 |
+
*
|
| 162 |
+
* @since 2.2.0
|
| 163 |
+
*/
|
| 164 |
+
public function instantiate() {
|
| 165 |
+
|
| 166 |
+
require_once $this->plugin_dir_path . 'includes/class-genesis-simple-hooks-admin.php';
|
| 167 |
+
$this->admin = new Genesis_Simple_Hooks_Admin();
|
| 168 |
+
$this->admin->init();
|
| 169 |
+
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
/**
|
| 173 |
+
* Helper function to retrieve the static object without using globals.
|
| 174 |
+
*
|
| 175 |
+
* @since 2.2.0
|
| 176 |
+
*/
|
| 177 |
+
public function execute_hooks() {
|
| 178 |
+
|
| 179 |
+
$hooks = get_option( $this->settings_field );
|
| 180 |
+
|
| 181 |
+
foreach ( (array) $hooks as $hook => $array ) {
|
| 182 |
+
|
| 183 |
+
// Add new content to hook.
|
| 184 |
+
if ( ! empty( $array['content'] ) ) {
|
| 185 |
+
add_action( $hook, array( $this, 'execute_hook' ) );
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
// Unhook stuff.
|
| 189 |
+
if ( isset( $array['unhook'] ) ) {
|
| 190 |
+
|
| 191 |
+
foreach ( (array) $array['unhook'] as $function ) {
|
| 192 |
+
remove_action( $hook, $function );
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
/**
|
| 200 |
+
* The following function executes any code meant to be hooked.
|
| 201 |
+
* It checks to see if shortcodes or PHP should be executed as well.
|
| 202 |
+
*
|
| 203 |
+
* @uses simplehooks_get_option()
|
| 204 |
+
*
|
| 205 |
+
* @since 2.2.0
|
| 206 |
+
*/
|
| 207 |
+
public function execute_hook() {
|
| 208 |
+
|
| 209 |
+
$hook = current_filter();
|
| 210 |
+
$content = simplehooks_get_option( $hook, 'content' );
|
| 211 |
+
|
| 212 |
+
if ( ! $hook || ! $content ) {
|
| 213 |
+
return;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
$shortcodes = simplehooks_get_option( $hook, 'shortcodes' );
|
| 217 |
+
$php = simplehooks_get_option( $hook, 'php' );
|
| 218 |
+
|
| 219 |
+
$value = $shortcodes ? do_shortcode( $content ) : $content;
|
| 220 |
+
|
| 221 |
+
if ( $php ) {
|
| 222 |
+
//phpcs:ignore
|
| 223 |
+
eval( "?>$value " );
|
| 224 |
+
} else {
|
| 225 |
+
//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 226 |
+
echo ( $value );
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
}
|
includes/deprecated.php
CHANGED
|
@@ -1,4 +1,9 @@
|
|
| 1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
/**
|
| 4 |
* Deprecated. Instantiate the admin menu.
|
| 1 |
<?php
|
| 2 |
+
/**
|
| 3 |
+
* A deprecated instance of simple hooks
|
| 4 |
+
*
|
| 5 |
+
* @package genesis-simple-hooks
|
| 6 |
+
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Deprecated. Instantiate the admin menu.
|
includes/functions.php
CHANGED
|
@@ -1,9 +1,18 @@
|
|
| 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 |
|
|
@@ -15,10 +24,11 @@ function simplehooks_get_option( $hook = null, $field = null, $all = false ) {
|
|
| 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 |
|
|
@@ -27,9 +37,13 @@ function simplehooks_get_option( $hook = null, $field = null, $all = false ) {
|
|
| 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 |
}
|
| 1 |
<?php
|
| 2 |
+
/**
|
| 3 |
+
* Additional Functions for Simple Hooks
|
| 4 |
+
*
|
| 5 |
+
* @package genesis-simple-hooks
|
| 6 |
+
*/
|
| 7 |
|
| 8 |
/**
|
| 9 |
* Pull an Simple Hooks option from the database, return value
|
| 10 |
*
|
| 11 |
* @since 0.1
|
| 12 |
+
*
|
| 13 |
+
* @param Array $hook Hook.
|
| 14 |
+
* @param Array $field Field.
|
| 15 |
+
* @param Array $all All.
|
| 16 |
*/
|
| 17 |
function simplehooks_get_option( $hook = null, $field = null, $all = false ) {
|
| 18 |
|
| 24 |
return $options;
|
| 25 |
}
|
| 26 |
|
| 27 |
+
if ( ! array_key_exists( $hook, (array) $options ) ) {
|
| 28 |
return '';
|
| 29 |
+
}
|
| 30 |
|
| 31 |
+
$option = isset( $options[ $hook ][ $field ] ) ? $options[ $hook ][ $field ] : '';
|
| 32 |
|
| 33 |
return wp_kses_stripslashes( wp_kses_decode_entities( $option ) );
|
| 34 |
|
| 37 |
* Pull an EasyHook option from the database, echo value
|
| 38 |
*
|
| 39 |
* @since 0.1
|
| 40 |
+
*
|
| 41 |
+
* @param Array $hook Hook.
|
| 42 |
+
* @param Array $field Field.
|
| 43 |
*/
|
| 44 |
+
function simplehooks_option( $hook = null, $field = null ) {
|
| 45 |
|
| 46 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
| 47 |
echo simplehooks_get_option( $hook, $field );
|
| 48 |
|
| 49 |
}
|
languages/genesis-simple-hooks.pot
CHANGED
|
@@ -1,425 +1,391 @@
|
|
| 1 |
-
# Copyright (C)
|
| 2 |
-
# This file is distributed under the same license as the
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
-
"Project-Id-Version: \n"
|
| 6 |
"Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n"
|
| 7 |
-
"
|
|
|
|
| 8 |
"MIME-Version: 1.0\n"
|
| 9 |
-
"Content-Type: text/plain; charset=
|
| 10 |
"Content-Transfer-Encoding: 8bit\n"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"X-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
"
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
"
|
| 22 |
-
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
|
| 23 |
-
"X-Poedit-Bookmarks: \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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
msgid "Genesis - Simple Hooks"
|
| 44 |
msgstr ""
|
| 45 |
|
| 46 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 47 |
msgid "Simple Hooks"
|
| 48 |
msgstr ""
|
| 49 |
|
| 50 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 51 |
msgid "Executes immediately before the closing <code></head></code> tag."
|
| 52 |
msgstr ""
|
| 53 |
|
| 54 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 55 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 56 |
msgid "Executes immediately before the closing <code></body></code> tag."
|
| 57 |
msgstr ""
|
| 58 |
|
| 59 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 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:
|
| 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:
|
| 74 |
msgid "Executes immediately after the opening <code><body></code> tag."
|
| 75 |
msgstr ""
|
| 76 |
|
| 77 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 78 |
msgid "Executes immediately before the header."
|
| 79 |
msgstr ""
|
| 80 |
|
| 81 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 82 |
msgid "Genesis uses this hook to output the default header."
|
| 83 |
msgstr ""
|
| 84 |
|
| 85 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 86 |
msgid "Executes inside the page header, immediately before the header widget area."
|
| 87 |
msgstr ""
|
| 88 |
|
| 89 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 90 |
msgid "Executes immediately after the header."
|
| 91 |
msgstr ""
|
| 92 |
|
| 93 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 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:
|
| 104 |
msgid "Executes before the content-sidebar-wrap opening markup."
|
| 105 |
msgstr ""
|
| 106 |
|
| 107 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 108 |
msgid "Executes after the content-sidebar-wrap closing markup."
|
| 109 |
msgstr ""
|
| 110 |
|
| 111 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 112 |
msgid "Executes before the content opening markup."
|
| 113 |
msgstr ""
|
| 114 |
|
| 115 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 116 |
msgid "Executes after the content closing markup."
|
| 117 |
msgstr ""
|
| 118 |
|
| 119 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 120 |
msgid "Executes before the loop."
|
| 121 |
msgstr ""
|
| 122 |
|
| 123 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 128 |
msgid "Executes after the loop."
|
| 129 |
msgstr ""
|
| 130 |
|
| 131 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 132 |
msgid "Executes after the WordPress loop endwhile."
|
| 133 |
msgstr ""
|
| 134 |
|
| 135 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 136 |
msgid "Executes in the loop's else statement."
|
| 137 |
msgstr ""
|
| 138 |
|
| 139 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 140 |
msgid "Executes if the loop actions are reset."
|
| 141 |
msgstr ""
|
| 142 |
|
| 143 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 144 |
msgid "Executes before the entry."
|
| 145 |
msgstr ""
|
| 146 |
|
| 147 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 154 |
msgid "Executes before the entry content"
|
| 155 |
msgstr ""
|
| 156 |
|
| 157 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 164 |
msgid "Executes after the entry content"
|
| 165 |
msgstr ""
|
| 166 |
|
| 167 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 174 |
msgid "Executes after the entry."
|
| 175 |
msgstr ""
|
| 176 |
|
| 177 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 178 |
msgid "Executes before the post opening markup."
|
| 179 |
msgstr ""
|
| 180 |
|
| 181 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 182 |
msgid "Executes after the post closing markup."
|
| 183 |
msgstr ""
|
| 184 |
|
| 185 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 186 |
msgid "Executes before the post title."
|
| 187 |
msgstr ""
|
| 188 |
|
| 189 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 196 |
msgid "Executes after the post title."
|
| 197 |
msgstr ""
|
| 198 |
|
| 199 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 200 |
msgid "Executes before the post content."
|
| 201 |
msgstr ""
|
| 202 |
|
| 203 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 210 |
msgid "Executes after the post content."
|
| 211 |
msgstr ""
|
| 212 |
|
| 213 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 214 |
msgid "Executes before the comments section opening markup."
|
| 215 |
msgstr ""
|
| 216 |
|
| 217 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 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:
|
| 230 |
msgid "Executes after the comments section closing markup."
|
| 231 |
msgstr ""
|
| 232 |
|
| 233 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 234 |
msgid "Executes before the pings section opening markup."
|
| 235 |
msgstr ""
|
| 236 |
|
| 237 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 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:
|
| 248 |
msgid "Executes after the ping section closing markup."
|
| 249 |
msgstr ""
|
| 250 |
|
| 251 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 252 |
msgid "Executes before a single comment."
|
| 253 |
msgstr ""
|
| 254 |
|
| 255 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 262 |
msgid "Executes after a single comment."
|
| 263 |
msgstr ""
|
| 264 |
|
| 265 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 266 |
msgid "Executes before the comment form."
|
| 267 |
msgstr ""
|
| 268 |
|
| 269 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 276 |
msgid "Executes after the comment form."
|
| 277 |
msgstr ""
|
| 278 |
|
| 279 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 280 |
msgid "Executes before the primary sidebar."
|
| 281 |
msgstr ""
|
| 282 |
|
| 283 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 290 |
msgid "Executes after the primary sidebar."
|
| 291 |
msgstr ""
|
| 292 |
|
| 293 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 294 |
msgid "Executes before the primary sidebar widget area."
|
| 295 |
msgstr ""
|
| 296 |
|
| 297 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 298 |
msgid "Executes after the primary sidebar widget area."
|
| 299 |
msgstr ""
|
| 300 |
|
| 301 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 302 |
msgid "Executes before the secondary sidebar."
|
| 303 |
msgstr ""
|
| 304 |
|
| 305 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 312 |
msgid "Executes after the secondary sidebar."
|
| 313 |
msgstr ""
|
| 314 |
|
| 315 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 316 |
msgid "Executes before the secondary sidebar widget area."
|
| 317 |
msgstr ""
|
| 318 |
|
| 319 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 320 |
msgid "Executes after the secondary sidebar widget area."
|
| 321 |
msgstr ""
|
| 322 |
|
| 323 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 324 |
msgid "Executes before the site footer."
|
| 325 |
msgstr ""
|
| 326 |
|
| 327 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 334 |
msgid "Executes after the site footer."
|
| 335 |
msgstr ""
|
| 336 |
|
| 337 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 338 |
msgid "Executes after the form on the the import/export screen."
|
| 339 |
msgstr ""
|
| 340 |
|
| 341 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 342 |
msgid "Executes during the export function."
|
| 343 |
msgstr ""
|
| 344 |
|
| 345 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 346 |
msgid "Executes during the import function."
|
| 347 |
msgstr ""
|
| 348 |
|
| 349 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 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:
|
| 354 |
msgid "Executes after Genesis upgrades itself."
|
| 355 |
msgstr ""
|
| 356 |
|
| 357 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 358 |
msgid "Hook"
|
| 359 |
msgstr ""
|
| 360 |
|
| 361 |
-
|
|
|
|
| 362 |
msgid "Unhook <code>%s()</code> function from this hook?"
|
| 363 |
msgstr ""
|
| 364 |
|
| 365 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 366 |
msgid "Execute Shortcodes on this hook?"
|
| 367 |
msgstr ""
|
| 368 |
|
| 369 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 370 |
msgid "Execute PHP on this hook?"
|
| 371 |
msgstr ""
|
| 372 |
|
| 373 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 374 |
msgid "WordPress Hooks"
|
| 375 |
msgstr ""
|
| 376 |
|
| 377 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 378 |
msgid "Document Hooks"
|
| 379 |
msgstr ""
|
| 380 |
|
| 381 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 382 |
msgid "Header Hooks"
|
| 383 |
msgstr ""
|
| 384 |
|
| 385 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 386 |
msgid "Content Hooks"
|
| 387 |
msgstr ""
|
| 388 |
|
| 389 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 390 |
msgid "Loop Hooks"
|
| 391 |
msgstr ""
|
| 392 |
|
| 393 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 394 |
msgid "Entry Hooks"
|
| 395 |
msgstr ""
|
| 396 |
|
| 397 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 398 |
msgid "Post/Page Hooks"
|
| 399 |
msgstr ""
|
| 400 |
|
| 401 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 402 |
msgid "Comment Hooks"
|
| 403 |
msgstr ""
|
| 404 |
|
| 405 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 406 |
msgid "Sidebar Hooks"
|
| 407 |
msgstr ""
|
| 408 |
|
| 409 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 410 |
msgid "Footer Hooks"
|
| 411 |
msgstr ""
|
| 412 |
|
| 413 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 414 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 415 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 416 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 417 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 418 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 419 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 420 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 421 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 422 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 423 |
-
#: includes/class-genesis-simple-hooks-admin.php:
|
| 424 |
msgid "Save Changes"
|
| 425 |
-
msgstr ""
|
| 1 |
+
# Copyright (C) 2019 StudioPress
|
| 2 |
+
# This file is distributed under the same license as the Genesis Simple Hooks plugin.
|
| 3 |
msgid ""
|
| 4 |
msgstr ""
|
| 5 |
+
"Project-Id-Version: Genesis Simple Hooks 2.3.0\n"
|
| 6 |
"Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n"
|
| 7 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
| 8 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
| 9 |
"MIME-Version: 1.0\n"
|
| 10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
| 11 |
"Content-Transfer-Encoding: 8bit\n"
|
| 12 |
+
"POT-Creation-Date: 2019-08-02T15:09:40+00:00\n"
|
| 13 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
| 14 |
+
"X-Generator: WP-CLI 2.2.0\n"
|
| 15 |
+
"X-Domain: genesis-simple-hooks\n"
|
| 16 |
+
|
| 17 |
+
#. Plugin Name of the plugin
|
| 18 |
+
msgid "Genesis Simple Hooks"
|
| 19 |
+
msgstr ""
|
| 20 |
+
|
| 21 |
+
#. Plugin URI of the plugin
|
| 22 |
+
msgid "http://www.studiopress.com/plugins/simple-hooks"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
msgstr ""
|
| 24 |
|
| 25 |
+
#. Description of the plugin
|
| 26 |
+
msgid "Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the Genesis Theme."
|
| 27 |
+
msgstr ""
|
| 28 |
+
|
| 29 |
+
#. Author of the plugin
|
| 30 |
+
msgid "StudioPress"
|
| 31 |
+
msgstr ""
|
| 32 |
+
|
| 33 |
+
#. Author URI of the plugin
|
| 34 |
+
msgid "http://www.studiopress.com/"
|
| 35 |
+
msgstr ""
|
| 36 |
+
|
| 37 |
+
#: includes/class-genesis-simple-hooks-admin.php:161
|
| 38 |
msgid "Genesis - Simple Hooks"
|
| 39 |
msgstr ""
|
| 40 |
|
| 41 |
+
#: includes/class-genesis-simple-hooks-admin.php:162
|
| 42 |
msgid "Simple Hooks"
|
| 43 |
msgstr ""
|
| 44 |
|
| 45 |
+
#: includes/class-genesis-simple-hooks-admin.php:230
|
| 46 |
msgid "Executes immediately before the closing <code></head></code> tag."
|
| 47 |
msgstr ""
|
| 48 |
|
| 49 |
+
#: includes/class-genesis-simple-hooks-admin.php:234
|
| 50 |
+
#: includes/class-genesis-simple-hooks-admin.php:256
|
| 51 |
msgid "Executes immediately before the closing <code></body></code> tag."
|
| 52 |
msgstr ""
|
| 53 |
|
| 54 |
+
#: includes/class-genesis-simple-hooks-admin.php:241
|
| 55 |
msgid "Executes in the document head. Genesis uses this to output the doctype."
|
| 56 |
msgstr ""
|
| 57 |
|
| 58 |
+
#: includes/class-genesis-simple-hooks-admin.php:245
|
| 59 |
+
msgid "Executes in the document head. Genesis uses this to output the document title."
|
|
|
|
|
|
|
| 60 |
msgstr ""
|
| 61 |
|
| 62 |
+
#: includes/class-genesis-simple-hooks-admin.php:249
|
| 63 |
msgid "Executes in the document head. Genesis uses this to output meta tags."
|
| 64 |
msgstr ""
|
| 65 |
|
| 66 |
+
#: includes/class-genesis-simple-hooks-admin.php:253
|
| 67 |
msgid "Executes immediately after the opening <code><body></code> tag."
|
| 68 |
msgstr ""
|
| 69 |
|
| 70 |
+
#: includes/class-genesis-simple-hooks-admin.php:262
|
| 71 |
msgid "Executes immediately before the header."
|
| 72 |
msgstr ""
|
| 73 |
|
| 74 |
+
#: includes/class-genesis-simple-hooks-admin.php:265
|
| 75 |
msgid "Genesis uses this hook to output the default header."
|
| 76 |
msgstr ""
|
| 77 |
|
| 78 |
+
#: includes/class-genesis-simple-hooks-admin.php:269
|
| 79 |
msgid "Executes inside the page header, immediately before the header widget area."
|
| 80 |
msgstr ""
|
| 81 |
|
| 82 |
+
#: includes/class-genesis-simple-hooks-admin.php:272
|
| 83 |
msgid "Executes immediately after the header."
|
| 84 |
msgstr ""
|
| 85 |
|
| 86 |
+
#: includes/class-genesis-simple-hooks-admin.php:275
|
| 87 |
msgid "Executes inside the header. Genesis uses this hook to output the site title."
|
| 88 |
msgstr ""
|
| 89 |
|
| 90 |
+
#: includes/class-genesis-simple-hooks-admin.php:279
|
| 91 |
+
msgid "Executes inside the header. Genesis uses this hook to output the site description."
|
|
|
|
|
|
|
| 92 |
msgstr ""
|
| 93 |
|
| 94 |
+
#: includes/class-genesis-simple-hooks-admin.php:286
|
| 95 |
msgid "Executes before the content-sidebar-wrap opening markup."
|
| 96 |
msgstr ""
|
| 97 |
|
| 98 |
+
#: includes/class-genesis-simple-hooks-admin.php:289
|
| 99 |
msgid "Executes after the content-sidebar-wrap closing markup."
|
| 100 |
msgstr ""
|
| 101 |
|
| 102 |
+
#: includes/class-genesis-simple-hooks-admin.php:292
|
| 103 |
msgid "Executes before the content opening markup."
|
| 104 |
msgstr ""
|
| 105 |
|
| 106 |
+
#: includes/class-genesis-simple-hooks-admin.php:295
|
| 107 |
msgid "Executes after the content closing markup."
|
| 108 |
msgstr ""
|
| 109 |
|
| 110 |
+
#: includes/class-genesis-simple-hooks-admin.php:301
|
| 111 |
msgid "Executes before the loop."
|
| 112 |
msgstr ""
|
| 113 |
|
| 114 |
+
#: includes/class-genesis-simple-hooks-admin.php:304
|
| 115 |
msgid "Executes in the content section. Genesis uses this hook to output the loop."
|
| 116 |
msgstr ""
|
| 117 |
|
| 118 |
+
#: includes/class-genesis-simple-hooks-admin.php:308
|
| 119 |
msgid "Executes after the loop."
|
| 120 |
msgstr ""
|
| 121 |
|
| 122 |
+
#: includes/class-genesis-simple-hooks-admin.php:311
|
| 123 |
msgid "Executes after the WordPress loop endwhile."
|
| 124 |
msgstr ""
|
| 125 |
|
| 126 |
+
#: includes/class-genesis-simple-hooks-admin.php:315
|
| 127 |
msgid "Executes in the loop's else statement."
|
| 128 |
msgstr ""
|
| 129 |
|
| 130 |
+
#: includes/class-genesis-simple-hooks-admin.php:319
|
| 131 |
msgid "Executes if the loop actions are reset."
|
| 132 |
msgstr ""
|
| 133 |
|
| 134 |
+
#: includes/class-genesis-simple-hooks-admin.php:328
|
| 135 |
msgid "Executes before the entry."
|
| 136 |
msgstr ""
|
| 137 |
|
| 138 |
+
#: includes/class-genesis-simple-hooks-admin.php:331
|
| 139 |
+
msgid "Executes as part of the entry. Genesis uses this hook to output the entry header."
|
|
|
|
|
|
|
| 140 |
msgstr ""
|
| 141 |
|
| 142 |
+
#: includes/class-genesis-simple-hooks-admin.php:335
|
| 143 |
msgid "Executes before the entry content"
|
| 144 |
msgstr ""
|
| 145 |
|
| 146 |
+
#: includes/class-genesis-simple-hooks-admin.php:339
|
| 147 |
+
msgid "Executes as part of the entry. Genesis uses this hook to output the entry content."
|
|
|
|
|
|
|
| 148 |
msgstr ""
|
| 149 |
|
| 150 |
+
#: includes/class-genesis-simple-hooks-admin.php:343
|
| 151 |
msgid "Executes after the entry content"
|
| 152 |
msgstr ""
|
| 153 |
|
| 154 |
+
#: includes/class-genesis-simple-hooks-admin.php:347
|
| 155 |
+
msgid "Executes as part of the entry. Genesis uses this hook to output the entry footer."
|
|
|
|
|
|
|
| 156 |
msgstr ""
|
| 157 |
|
| 158 |
+
#: includes/class-genesis-simple-hooks-admin.php:351
|
| 159 |
msgid "Executes after the entry."
|
| 160 |
msgstr ""
|
| 161 |
|
| 162 |
+
#: includes/class-genesis-simple-hooks-admin.php:361
|
| 163 |
msgid "Executes before the post opening markup."
|
| 164 |
msgstr ""
|
| 165 |
|
| 166 |
+
#: includes/class-genesis-simple-hooks-admin.php:364
|
| 167 |
msgid "Executes after the post closing markup."
|
| 168 |
msgstr ""
|
| 169 |
|
| 170 |
+
#: includes/class-genesis-simple-hooks-admin.php:368
|
| 171 |
msgid "Executes before the post title."
|
| 172 |
msgstr ""
|
| 173 |
|
| 174 |
+
#: includes/class-genesis-simple-hooks-admin.php:372
|
| 175 |
+
msgid "Executes as part of the post. Genesis uses this hook to output the post title."
|
|
|
|
|
|
|
| 176 |
msgstr ""
|
| 177 |
|
| 178 |
+
#: includes/class-genesis-simple-hooks-admin.php:376
|
| 179 |
msgid "Executes after the post title."
|
| 180 |
msgstr ""
|
| 181 |
|
| 182 |
+
#: includes/class-genesis-simple-hooks-admin.php:379
|
| 183 |
msgid "Executes before the post content."
|
| 184 |
msgstr ""
|
| 185 |
|
| 186 |
+
#: includes/class-genesis-simple-hooks-admin.php:383
|
| 187 |
+
msgid "Executes as part of the post. Genesis uses this hook to output the post content."
|
|
|
|
|
|
|
| 188 |
msgstr ""
|
| 189 |
|
| 190 |
+
#: includes/class-genesis-simple-hooks-admin.php:387
|
| 191 |
msgid "Executes after the post content."
|
| 192 |
msgstr ""
|
| 193 |
|
| 194 |
+
#: includes/class-genesis-simple-hooks-admin.php:394
|
| 195 |
msgid "Executes before the comments section opening markup."
|
| 196 |
msgstr ""
|
| 197 |
|
| 198 |
+
#: includes/class-genesis-simple-hooks-admin.php:397
|
| 199 |
+
msgid "Executes after an entry. Genesis uses this hook to output the comments section."
|
|
|
|
|
|
|
| 200 |
msgstr ""
|
| 201 |
|
| 202 |
+
#: includes/class-genesis-simple-hooks-admin.php:401
|
| 203 |
+
msgid "Executes in the comments section. Genesis uses this hook to output the comment list."
|
|
|
|
|
|
|
| 204 |
msgstr ""
|
| 205 |
|
| 206 |
+
#: includes/class-genesis-simple-hooks-admin.php:405
|
| 207 |
msgid "Executes after the comments section closing markup."
|
| 208 |
msgstr ""
|
| 209 |
|
| 210 |
+
#: includes/class-genesis-simple-hooks-admin.php:408
|
| 211 |
msgid "Executes before the pings section opening markup."
|
| 212 |
msgstr ""
|
| 213 |
|
| 214 |
+
#: includes/class-genesis-simple-hooks-admin.php:411
|
| 215 |
msgid "Executes after an entry. Genesis uses this hook to output the pings section."
|
| 216 |
msgstr ""
|
| 217 |
|
| 218 |
+
#: includes/class-genesis-simple-hooks-admin.php:415
|
| 219 |
+
msgid "Executes in the pings section. Genesis uses this hook to output the ping list."
|
|
|
|
|
|
|
| 220 |
msgstr ""
|
| 221 |
|
| 222 |
+
#: includes/class-genesis-simple-hooks-admin.php:419
|
| 223 |
msgid "Executes after the ping section closing markup."
|
| 224 |
msgstr ""
|
| 225 |
|
| 226 |
+
#: includes/class-genesis-simple-hooks-admin.php:422
|
| 227 |
msgid "Executes before a single comment."
|
| 228 |
msgstr ""
|
| 229 |
|
| 230 |
+
#: includes/class-genesis-simple-hooks-admin.php:425
|
| 231 |
+
msgid "Executes in the comment list. Genesis uses this hook to output a single comment."
|
|
|
|
|
|
|
| 232 |
msgstr ""
|
| 233 |
|
| 234 |
+
#: includes/class-genesis-simple-hooks-admin.php:428
|
| 235 |
msgid "Executes after a single comment."
|
| 236 |
msgstr ""
|
| 237 |
|
| 238 |
+
#: includes/class-genesis-simple-hooks-admin.php:431
|
| 239 |
msgid "Executes before the comment form."
|
| 240 |
msgstr ""
|
| 241 |
|
| 242 |
+
#: includes/class-genesis-simple-hooks-admin.php:434
|
| 243 |
+
msgid "Executes after the comment and ping list. Genesis uses this hook to output the comment form."
|
|
|
|
|
|
|
| 244 |
msgstr ""
|
| 245 |
|
| 246 |
+
#: includes/class-genesis-simple-hooks-admin.php:438
|
| 247 |
msgid "Executes after the comment form."
|
| 248 |
msgstr ""
|
| 249 |
|
| 250 |
+
#: includes/class-genesis-simple-hooks-admin.php:444
|
| 251 |
msgid "Executes before the primary sidebar."
|
| 252 |
msgstr ""
|
| 253 |
|
| 254 |
+
#: includes/class-genesis-simple-hooks-admin.php:447
|
| 255 |
+
msgid "Executes after the content section in 2+ column layouts. Genesis uses this hook to output the primary sidebar."
|
|
|
|
|
|
|
| 256 |
msgstr ""
|
| 257 |
|
| 258 |
+
#: includes/class-genesis-simple-hooks-admin.php:451
|
| 259 |
msgid "Executes after the primary sidebar."
|
| 260 |
msgstr ""
|
| 261 |
|
| 262 |
+
#: includes/class-genesis-simple-hooks-admin.php:454
|
| 263 |
msgid "Executes before the primary sidebar widget area."
|
| 264 |
msgstr ""
|
| 265 |
|
| 266 |
+
#: includes/class-genesis-simple-hooks-admin.php:457
|
| 267 |
msgid "Executes after the primary sidebar widget area."
|
| 268 |
msgstr ""
|
| 269 |
|
| 270 |
+
#: includes/class-genesis-simple-hooks-admin.php:460
|
| 271 |
msgid "Executes before the secondary sidebar."
|
| 272 |
msgstr ""
|
| 273 |
|
| 274 |
+
#: includes/class-genesis-simple-hooks-admin.php:463
|
| 275 |
+
msgid "Executes after the primary sidebar in 3+ column layouts. Genesis uses this hook to output the secondary sidebar."
|
|
|
|
|
|
|
| 276 |
msgstr ""
|
| 277 |
|
| 278 |
+
#: includes/class-genesis-simple-hooks-admin.php:467
|
| 279 |
msgid "Executes after the secondary sidebar."
|
| 280 |
msgstr ""
|
| 281 |
|
| 282 |
+
#: includes/class-genesis-simple-hooks-admin.php:470
|
| 283 |
msgid "Executes before the secondary sidebar widget area."
|
| 284 |
msgstr ""
|
| 285 |
|
| 286 |
+
#: includes/class-genesis-simple-hooks-admin.php:473
|
| 287 |
msgid "Executes after the secondary sidebar widget area."
|
| 288 |
msgstr ""
|
| 289 |
|
| 290 |
+
#: includes/class-genesis-simple-hooks-admin.php:479
|
| 291 |
msgid "Executes before the site footer."
|
| 292 |
msgstr ""
|
| 293 |
|
| 294 |
+
#: includes/class-genesis-simple-hooks-admin.php:482
|
| 295 |
+
msgid "Executes after the content and sidebars. Genesis uses this hook to output the site footer."
|
|
|
|
|
|
|
| 296 |
msgstr ""
|
| 297 |
|
| 298 |
+
#: includes/class-genesis-simple-hooks-admin.php:486
|
| 299 |
msgid "Executes after the site footer."
|
| 300 |
msgstr ""
|
| 301 |
|
| 302 |
+
#: includes/class-genesis-simple-hooks-admin.php:492
|
| 303 |
msgid "Executes after the form on the the import/export screen."
|
| 304 |
msgstr ""
|
| 305 |
|
| 306 |
+
#: includes/class-genesis-simple-hooks-admin.php:495
|
| 307 |
msgid "Executes during the export function."
|
| 308 |
msgstr ""
|
| 309 |
|
| 310 |
+
#: includes/class-genesis-simple-hooks-admin.php:498
|
| 311 |
msgid "Executes during the import function."
|
| 312 |
msgstr ""
|
| 313 |
|
| 314 |
+
#: includes/class-genesis-simple-hooks-admin.php:501
|
| 315 |
msgid "Executes in the function that adds metaboxes to the theme settings screen."
|
| 316 |
msgstr ""
|
| 317 |
|
| 318 |
+
#: includes/class-genesis-simple-hooks-admin.php:504
|
| 319 |
msgid "Executes after Genesis upgrades itself."
|
| 320 |
msgstr ""
|
| 321 |
|
| 322 |
+
#: includes/class-genesis-simple-hooks-admin.php:574
|
| 323 |
msgid "Hook"
|
| 324 |
msgstr ""
|
| 325 |
|
| 326 |
+
#. Translators: The string is the name of a function.
|
| 327 |
+
#: includes/class-genesis-simple-hooks-admin.php:592
|
| 328 |
msgid "Unhook <code>%s()</code> function from this hook?"
|
| 329 |
msgstr ""
|
| 330 |
|
| 331 |
+
#: includes/class-genesis-simple-hooks-admin.php:609
|
| 332 |
msgid "Execute Shortcodes on this hook?"
|
| 333 |
msgstr ""
|
| 334 |
|
| 335 |
+
#: includes/class-genesis-simple-hooks-admin.php:617
|
| 336 |
msgid "Execute PHP on this hook?"
|
| 337 |
msgstr ""
|
| 338 |
|
| 339 |
+
#: includes/class-genesis-simple-hooks-admin.php:636
|
| 340 |
msgid "WordPress Hooks"
|
| 341 |
msgstr ""
|
| 342 |
|
| 343 |
+
#: includes/class-genesis-simple-hooks-admin.php:637
|
| 344 |
msgid "Document Hooks"
|
| 345 |
msgstr ""
|
| 346 |
|
| 347 |
+
#: includes/class-genesis-simple-hooks-admin.php:638
|
| 348 |
msgid "Header Hooks"
|
| 349 |
msgstr ""
|
| 350 |
|
| 351 |
+
#: includes/class-genesis-simple-hooks-admin.php:639
|
| 352 |
msgid "Content Hooks"
|
| 353 |
msgstr ""
|
| 354 |
|
| 355 |
+
#: includes/class-genesis-simple-hooks-admin.php:640
|
| 356 |
msgid "Loop Hooks"
|
| 357 |
msgstr ""
|
| 358 |
|
| 359 |
+
#: includes/class-genesis-simple-hooks-admin.php:643
|
| 360 |
msgid "Entry Hooks"
|
| 361 |
msgstr ""
|
| 362 |
|
| 363 |
+
#: includes/class-genesis-simple-hooks-admin.php:645
|
| 364 |
msgid "Post/Page Hooks"
|
| 365 |
msgstr ""
|
| 366 |
|
| 367 |
+
#: includes/class-genesis-simple-hooks-admin.php:648
|
| 368 |
msgid "Comment Hooks"
|
| 369 |
msgstr ""
|
| 370 |
|
| 371 |
+
#: includes/class-genesis-simple-hooks-admin.php:649
|
| 372 |
msgid "Sidebar Hooks"
|
| 373 |
msgstr ""
|
| 374 |
|
| 375 |
+
#: includes/class-genesis-simple-hooks-admin.php:650
|
| 376 |
msgid "Footer Hooks"
|
| 377 |
msgstr ""
|
| 378 |
|
| 379 |
+
#: includes/class-genesis-simple-hooks-admin.php:661
|
| 380 |
+
#: includes/class-genesis-simple-hooks-admin.php:672
|
| 381 |
+
#: includes/class-genesis-simple-hooks-admin.php:683
|
| 382 |
+
#: includes/class-genesis-simple-hooks-admin.php:694
|
| 383 |
+
#: includes/class-genesis-simple-hooks-admin.php:705
|
| 384 |
+
#: includes/class-genesis-simple-hooks-admin.php:716
|
| 385 |
+
#: includes/class-genesis-simple-hooks-admin.php:727
|
| 386 |
+
#: includes/class-genesis-simple-hooks-admin.php:738
|
| 387 |
+
#: includes/class-genesis-simple-hooks-admin.php:749
|
| 388 |
+
#: includes/class-genesis-simple-hooks-admin.php:760
|
| 389 |
+
#: includes/class-genesis-simple-hooks-admin.php:771
|
| 390 |
msgid "Save Changes"
|
| 391 |
+
msgstr ""
|
package-lock.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "genesis-simple-hooks",
|
| 3 |
+
"lockfileVersion": 1
|
| 4 |
+
}
|
package.json
CHANGED
|
@@ -6,22 +6,8 @@
|
|
| 6 |
"url": "https://github.com/copyblogger/genesis-simple-hooks"
|
| 7 |
},
|
| 8 |
"dependencies": {},
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"grunt-autoprefixer": "*",
|
| 12 |
-
"grunt-checktextdomain": "*",
|
| 13 |
-
"grunt-contrib-cssmin": "*",
|
| 14 |
-
"grunt-contrib-imagemin": "*",
|
| 15 |
-
"grunt-contrib-jshint": "*",
|
| 16 |
-
"grunt-contrib-uglify": "*",
|
| 17 |
-
"grunt-contrib-watch": "*",
|
| 18 |
-
"grunt-csscomb": "*",
|
| 19 |
-
"grunt-jsbeautifier": "*",
|
| 20 |
-
"grunt-jsvalidate": "*",
|
| 21 |
-
"grunt-phplint": "*",
|
| 22 |
-
"grunt-styledocco": "*",
|
| 23 |
-
"grunt-wp-i18n": "*",
|
| 24 |
-
"load-grunt-tasks": "*"
|
| 25 |
},
|
| 26 |
"plugin": {
|
| 27 |
"name": "Genesis Simple Hooks",
|
|
@@ -29,7 +15,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"
|
| 6 |
"url": "https://github.com/copyblogger/genesis-simple-hooks"
|
| 7 |
},
|
| 8 |
"dependencies": {},
|
| 9 |
+
"scripts": {
|
| 10 |
+
"makepot": "composer makepot"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
},
|
| 12 |
"plugin": {
|
| 13 |
"name": "Genesis Simple Hooks",
|
| 15 |
"description": "Genesis Simple Hooks allows you easy access to the 50+ Action Hooks in the Genesis Theme.",
|
| 16 |
"author": "StudioPress",
|
| 17 |
"authoruri": "http://www.studiopress.com/",
|
| 18 |
+
"version": "2.3.0",
|
| 19 |
"license": "GPL-2.0+",
|
| 20 |
"licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
|
| 21 |
"textdomain": "genesis-simple-hooks"
|
plugin.php
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
Plugin Name: Genesis Simple Hooks
|
| 4 |
-
Plugin URI: http://www.studiopress.com/plugins/simple-hooks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
Author: StudioPress
|
| 9 |
-
Author URI: http://www.studiopress.com/
|
| 10 |
-
|
| 11 |
-
Version: 2.2.1
|
| 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' );
|
| 1 |
+
<?php //phpcs:ignore
|
| 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: StudioPress
|
| 9 |
+
* Author URI: http://www.studiopress.com/
|
| 10 |
+
*
|
| 11 |
+
* Version: 2.3.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: 4.
|
| 6 |
-
Tested up to:
|
| 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 |
|
|
@@ -47,14 +47,14 @@ The most common request from Genesis users is how to properly modify their foote
|
|
| 47 |
**Modifying the post-info**
|
| 48 |
`
|
| 49 |
<div class="post-info">
|
| 50 |
-
<span class="time"><?php the_time('F j, Y'); ?></span> <span class="author">by <?php the_author_posts_link(); ?></span> <span class="post-comments"><a href="<?php the_permalink(); ?>#respond"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a></span> <a class="post-edit-link"><?php edit_post_link('(Edit)', '', ''); ?></a>
|
| 51 |
</div>
|
| 52 |
`
|
| 53 |
|
| 54 |
**Modifying the post-meta**
|
| 55 |
`
|
| 56 |
<div class="post-meta">
|
| 57 |
-
<span class="categories">Filed under: <?php the_category(', ') ?></span> <span class="tags">Tagged with <?php the_tags('') ?></span>
|
| 58 |
</div>
|
| 59 |
`
|
| 60 |
|
|
@@ -72,6 +72,12 @@ The most common request from Genesis users is how to properly modify their foote
|
|
| 72 |
|
| 73 |
== Changelog ==
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
= 2.2.1 =
|
| 76 |
* Genesis 2.6+ compatibility (prevents white screen).
|
| 77 |
* Remove reference to deprecated function.
|
|
@@ -149,11 +155,3 @@ The most common request from Genesis users is how to properly modify their foote
|
|
| 149 |
|
| 150 |
= 0.1 =
|
| 151 |
* Initial Release
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 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: 5.2.2
|
| 7 |
+
Stable tag: 2.3.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 |
|
| 47 |
**Modifying the post-info**
|
| 48 |
`
|
| 49 |
<div class="post-info">
|
| 50 |
+
<span class="time"><?php the_time('F j, Y'); ?></span> <span class="author">by <?php the_author_posts_link(); ?></span> <span class="post-comments"><a href="<?php the_permalink(); ?>#respond"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a></span> <a class="post-edit-link"><?php edit_post_link('(Edit)', '', ''); ?></a>
|
| 51 |
</div>
|
| 52 |
`
|
| 53 |
|
| 54 |
**Modifying the post-meta**
|
| 55 |
`
|
| 56 |
<div class="post-meta">
|
| 57 |
+
<span class="categories">Filed under: <?php the_category(', ') ?></span> <span class="tags">Tagged with <?php the_tags('') ?></span>
|
| 58 |
</div>
|
| 59 |
`
|
| 60 |
|
| 72 |
|
| 73 |
== Changelog ==
|
| 74 |
|
| 75 |
+
= 2.3.0 =
|
| 76 |
+
* Reorganize plugin based on our standard boilerplate.
|
| 77 |
+
* Update to match WordPress PHP standards.
|
| 78 |
+
* Fix bug where plugin name was empty in the minimum version warning.
|
| 79 |
+
* Increase minimum Genesis version to 2.5.0.
|
| 80 |
+
|
| 81 |
= 2.2.1 =
|
| 82 |
* Genesis 2.6+ compatibility (prevents white screen).
|
| 83 |
* Remove reference to deprecated function.
|
| 155 |
|
| 156 |
= 0.1 =
|
| 157 |
* Initial Release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
