This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_loaded', 'bhww_remove_subscriber_users_not_enrolled' ); | |
/** | |
* Remove users who are only subscribers and who are not yet enrolled in the course. | |
* Only runs when a WordPress admin page loads. | |
*/ | |
function bhww_remove_subscriber_users_not_enrolled() { | |
// If this is not the WP admin, return early | |
if ( ! is_admin() ) | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Block spam registrations (wp-login.php?action=register) | |
# Why? Server overloads and bounced emails | |
RewriteEngine On | |
#RewriteCond %{HTTP_REFERER} !^https://settigang.com/portal-access/?ld_register_id=580.*$ [NC] | |
RewriteCond %{HTTP_REFERER} !^https://settigang.com/portal-access/.*$ [NC] | |
RewriteCond %{THE_REQUEST} ^.*(wp-login.php\?action=register).* [NC] | |
RewriteRule ^(.*)$ - [F,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Block spam registrations (wp-login.php?action=register) | |
RewriteEngine On | |
RewriteCond %{THE_REQUEST} ^.*(wp-login.php\?action=register).* [NC] | |
RewriteRule ^(.*)$ - [F,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds "failed" status to Action Scheduler cleanup action. | |
* | |
* Default is "complete" and "canceled," leaving "failed" actions | |
* in the Action Scheduler to pile up indefinitely. | |
* | |
* Filter located in action-scheduler/classes/ActionScheduler_QueueCleaner.php | |
* | |
* @see https://wpcodebook.com/woocommerce-action-scheduler-cleanup-php/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Convert the standard WooCommerce products list into a modern responsive grid. */ | |
ul.products { | |
--grid-gap: 32px; | |
--auto-grid-min-size: 200px; | |
grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr)); | |
grid-gap: var(--grid-gap); | |
display: grid; | |
} | |
ul.products:before{ | |
content:unset!important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'admin_post_nopriv_process_postmark_events', 'bhww_core_postmark_events_webhook' ); | |
/** | |
* Add a webhook to enable automated MailPoet bounce (or spam complaint or unsubscribe) | |
* handling from Postmark events JSON data | |
* | |
* Change this webhook URL for each site, and copy/paste into Postmark Webhook URL form: | |
* https://[YOUR WEBSITE URL]/wp-admin/admin-post.php?action=process_postmark_events | |
* | |
* Make sure there is not an admin redirect active, | |
* or if there is, modify it to allow webhook access |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Wiz // Gravity Forms // User Registration // Skip Registration if Email Exists | |
* | |
* If submitted email is already registered, skip registration. | |
* | |
* @version 0.4 | |
* @author David Smith <david@gravitywiz.com> | |
* @license GPL-2.0+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This code snippet removes JavaScript and CSS files loaded from WooCommerce if they are not necessary. | |
* | |
* Please test this on a staging copy of your website before putting this into the functions.php of your live website. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'my_remove_woo_assets', 99 ); | |
function my_remove_woo_assets() { | |
if ( function_exists( 'is_woocommerce' ) ) { // Check if Woo is installed. | |
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { // Only run on non-Woo pages. | |
// Remove unnecessary stylesheets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* to exclude field from notification add 'exclude[ID]' option to {all_fields} tag | |
* 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification | |
* see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options | |
* example: {all_fields:exclude[2,3]} | |
* example: {all_fields:include[6]} | |
* example: {all_fields:include[6],exclude[2,3]} | |
*/ | |
add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 ); | |
function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Execute late to catch 'clone' and 'new draft' (Duplicate Post plugin) | |
add_filter( 'post_row_actions', 'bhww_core_remove_quick_edit_options', 100, 2 ); | |
add_filter( 'page_row_actions', 'bhww_core_remove_quick_edit_options', 100, 2 ); | |
function bhww_core_remove_quick_edit_options( $actions, $post ) { | |
if ( current_user_can( 'update_core' ) ) | |
return $actions; | |
global $post; |
NewerOlder