MT | TEC | Fix for Single Event 404s with attachment set in WP Query
<?php | |
/* | |
* Possible solution for Single Event page 404 errors where the WP_Query has an attachment set | |
* IMPORTANT: Flush permalinks after pasting this code: http://tri.be/support/documentation/troubleshooting-404-errors/ | |
*/ | |
function tribe_attachment_404_fix () { | |
if (class_exists('TribeEvents')) { | |
remove_action( 'init', array( TribeEvents::instance(), 'init' ), 10 ); | |
add_action( 'init', array( TribeEvents::instance(), 'init' ), 1 ); | |
} | |
} | |
add_action( 'after_setup_theme', 'tribe_attachment_404_fix' ); |
This comment has been minimized.
This comment has been minimized.
I agree that this snippet is incorrect. I get the following PHP Notice
|
This comment has been minimized.
This comment has been minimized.
Thanks for sharing that info @incredimike. I have forked the snippet and adjusted it. You can find it here: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
I think this is incorrect and causes a deprecation warning as of 3.10. Limited testing shows that changing
TribeEvents
toTribe__Events__Main
seems to fix it. YMMV.