Created
September 4, 2022 08:18
-
-
Save alanef/b20b9d4cfc8d51417ea958aea52099b3 to your computer and use it in GitHub Desktop.
custom filter
This file contains hidden or 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 | |
| /** | |
| * Plugin Name: My Custom Code Snippets | |
| * Description: Custom Filters | |
| * Version: 1.0 | |
| */ | |
| // just a check to make sure no hacker tries this file | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| die(); | |
| } | |
| /** | |
| * Add all you custom code after here | |
| */ | |
| add_filter( | |
| 'wfea_api_results', | |
| function ( $events, $query_vars ) { | |
| $events = array_filter( | |
| $events, | |
| function ( $e ) { | |
| if ( '402301072337' === $e->ID ) { | |
| return false; | |
| } | |
| return true; | |
| } | |
| ); | |
| return $events; | |
| }, | |
| 10, | |
| 2 | |
| ); | |
| // the end - add your custom code before here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment