/functions.php Secret
Created
December 30, 2016 09:21
Trigger an event on specific URL
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 | |
// add this to your functions.php in your child theme | |
add_action( 'the_post', 'trigger_my_page_view' ); | |
function trigger_my_page_view(){ | |
// check if is single to avoid archive | |
if( is_single() && 'https://mydomain/path/' == get_the_permalink() ){ | |
do_action( 'trigger_slack_event' ); // can be anything you feel like. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment