In my plugin I hooked my function to wp_loaded and there is a call to the function comment_exists() which fires a Fatal Error. In which hook in the loading process I can be sure that the function would exist?

P.S.: I should hook my function to an action in loading process and before site is loaded completely.

  • 1
    How are you using this / could this be a namespace issue? – kero Sep 4 '18 at 13:05
  • comment_exists() is definitely loaded before the wp_loaded hook. wp_loaded is fired on line 484 of wp-settings.php and comment_exists() is defined in a file that's loaded on line 180. So it sounds like either a namespace issue or you're using the function in a file outside WordPress. – Jacob Peattie Sep 4 '18 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.