Skip to content

Instantly share code, notes, and snippets.

@alanef
Created September 4, 2022 08:18
Show Gist options
  • Select an option

  • Save alanef/b20b9d4cfc8d51417ea958aea52099b3 to your computer and use it in GitHub Desktop.

Select an option

Save alanef/b20b9d4cfc8d51417ea958aea52099b3 to your computer and use it in GitHub Desktop.
custom filter
<?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