Skip to content

Instantly share code, notes, and snippets.

@danieliser
Last active June 3, 2016 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danieliser/086acb7ac597425a9c5e to your computer and use it in GitHub Desktop.
Save danieliser/086acb7ac597425a9c5e to your computer and use it in GitHub Desktop.
Filter example: remove a modal when user is logged in.
<?php
add_filter('emodal_print_modals', 'remove_my_modal');
function remove_my_modal($modals)
{
$id_of_hidden_modal = 2;//The id of your modal.
if(is_user_logged_in())
{
unset($modals[$id_of_hidden_modal]);
}
return $modals;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment