Trigger an event on specific URL
<?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