<?php | |
/** | |
* Change the brightness of the passed in color | |
* | |
* $diff should be negative to go darker, positive to go lighter and | |
* is subtracted from the decimal (0-255) value of the color | |
* | |
* @param string $hex color to be modified | |
* @param string $diff amount to change the color |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
/** | |
* Set Post Status by Field Value (Advanced) | |
* http://gravitywiz.com/2012/05/04/set-post-status-by-field-value-advanced/ | |
*/ | |
// update "3" to the ID of your form | |
add_filter('gform_post_data_3', 'gform_dynamic_post_status', 10, 3); | |
function gform_dynamic_post_status($post_data, $form, $entry) { | |
// update "5" to the ID of your custom post status field |
<?php | |
/* | |
* Plugin Name: Exclude the asmodeus category from Jetpack Subscriptions | |
* Plugin URI: http://wordpress.org/plugins/jetpack/ | |
* Description: Exclude the asmodeus category from Jetpack Subscriptions | |
* Author: Jeremy Herve | |
* Version: 1.0 | |
* Author URI: http://jeremyherve.com | |
* License: GPL2+ | |
*/ |
This is a WORK IN PROGRESS intended for fleshing out and feedback
It's very common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, the plugin will add a <link>
element to that CSS. If the plugin needs JavaScript, it will add a <script>
to that JavaScript.
Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions. They rightfully want good ratings and little customer support.
But this comes at the cost of additional HTTP requests. In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. Front end developers want to decide and control how front end resources are being handled, and WordPress plugins don't typically make this easy on them.
<?php | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-manual-notifications.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Send Manual Notifications | |
* | |
* Provides a custom notification event that allows you to create notifications that can be sent |
<?php | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-manual-entries.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Manual Entries | |
* | |
* Create entries manually for Gravity Forms. Adds an "Add New" button next to the page title on all entry-related pages. |
array( | |
// Require WordPress version 4.6.2 or higher. | |
'wordpress' => array( | |
'version' => '4.6.2' | |
), | |
// Require PHP version 5.3 or higher. | |
'php' => array( | |
'version' => '5.3', | |
<?php | |
/** | |
* Payment subscriptions and updating billing and cancelling subscriptions takes place with these hooks | |
* We need the stripe customer user id for updating billing | |
* we need the entry id of subscription so we can cancel it. | |
*/ | |
/** | |
* @param $entry |