• Resolved Matt Cromwell

    (@webdevmattcrom)


    Other plugins often will use the same filter “the_title” in a more generic way, without defining the post id. Your main function is requiring the $post_id which will end up throwing warnings.

    The simple fix is to define your $post_id as empty so that it can be passed to your function without throwing errors. So, go to the “title-remover.php” file, on line 16, the main function, update that line to this:

    function wptr_supress_title($title, $post_id = '') {

    Then all will be fine.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Throws PHP Errors because $post_id is not defined’ is closed to new replies.