This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
| <?php | |
| // Add new Discount setting the to discount add and edit forms | |
| add_action( 'edd_add_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_add_form' ) ); | |
| add_action( 'edd_edit_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_edit_form' ) ); | |
| // Handle saving the settings on form submission | |
| add_filter( 'edd_update_discount', 'edd_perpetual_discounts_add_meta' ); | |
| add_filter( 'edd_insert_discount', 'edd_perpetual_discounts_add_meta' ); |
| /** | |
| * Add a weekly email report that summarizes which domains that | |
| * your products are being used on. | |
| */ | |
| add_filter( 'cron_schedules', function( $schedules ) { | |
| $schedules['weekly'] = array( | |
| 'interval' => 604800, | |
| 'display' => __('Once Weekly') | |
| ); |
| #!/bin/bash | |
| # | |
| # Prints all hooks in a dir to a .log file. | |
| # | |
| # Permissions issues: | |
| # run: chmod +x gethooks | |
| # | |
| # gist: https://gist.github.com/ramiabraham/e8356e00130351ddcbe2c62125e6c52a | |
| # | |
| # Easy usage: |
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
| <?php | |
| /** | |
| * Gravity Wiz // Gravity Forms // Exclude Forms from Form List | |
| * http://gravitywiz.com | |
| */ | |
| add_filter( 'query', function( $query ) { | |
| if( rgget( 'page' ) != 'gf_edit_forms' ) { | |
| return $query; | |
| } |
| <?php | |
| add_filter( 'searchwp_term_in', 'my_find_synonyms', 10, 2 ); | |
| add_filter( 'searchwp_and_logic', '__return_false' ); | |
| function my_find_synonyms( $term, $engine ) { | |
| global $searchwp; | |
| if( ! class_exists( 'SearchWP' ) || version_compare( $searchwp->version, '2.0.3', '<' ) ) { | |
| return $term; |
| <?php | |
| /** | |
| * This function will see if a PDF or other "attachment" post-type returned by SearchWP | |
| * is present in a custom field in a regular post, and will return that post instead. Note | |
| * this will only process documents which are referenced via the "attachment" post type. | |
| * | |
| * For example, you may have a product specification PDF and would like it in the search | |
| * results, but would rather people got to it by visiting the product page itself. | |
| * |
| <?php | |
| use Rarst\Profiler\Handler; | |
| global $wp; | |
| if ( Handler::$profiling && empty( $wp ) ) { | |
| Handler::close(); | |
| } |
| <?php | |
| /** | |
| * Post-style permalinks for your custom post types | |
| * e.g. %year%/%monthnum%/%day%/%postname% | |
| */ | |
| function dbx_get_post_types() { | |
| return array( | |
| // replace with your custom post types | |
| 'my-custom-post-type' | |
| ); |
| <?php | |
| // pause the indexer for 1s in between passes | |
| function my_searchwp_indexer_throttle() { | |
| return 1; | |
| } | |
| add_filter( 'searchwp_indexer_throttle', 'my_searchwp_indexer_throttle' ); | |