Skip to content

Instantly share code, notes, and snippets.

@alanef
Created July 28, 2023 10:40
Show Gist options
  • Save alanef/7f79f05e2b7a9c145feea8e70724617f to your computer and use it in GitHub Desktop.
Save alanef/7f79f05e2b7a9c145feea8e70724617f to your computer and use it in GitHub Desktop.
Custom Filter to hide events from front end
<?php
/*
* Plugin Name: Quick Event Manager - Hide Events from front end and search
* Plugin Description: Custom filter to hide events from front end and search
*/
add_filter( 'qem_event_register_event_cpt', function ( $args ) {
$args['$publicly_queryable'] = false;
$args['$exclude_from_search'] = true;
return $args;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment