skip to Main Content

I installed latest versions of apache2, wordpress (4.9.8), php (7.2). Then installed a plugin from wpbooking.org. The minimum requirements for their plugin is 4.9.8. As soon as it is enabled, these warnings appear:

Warning: Use of undefined constant STYLESHEETPATH - assumed 'STYLESHEETPATH' (this will throw an Error in a future version of PHP) in /home/jamie/websites/italy/wp-includes/template.php on line 634

Warning: Use of undefined constant TEMPLATEPATH - assumed 'TEMPLATEPATH' (this will throw an Error in a future version of PHP) in /home/jamie/websites/italy/wp-includes/template.php on line 637

I’ve disabled php errors (or so I think) in wp-config.php error_reporting(0);, but they still persist. There are some suggestions that child template themes has issues, but not really a whole lot. The wpbooking.org has a support forum, but this error is not mentioned. Not a lot googling either, so I figured I’d ask here to see if:

  1. Anyone knows how to disable these errors?
  2. Anyone knows if these are wordpress or plugin errors?

2

Answers


  1. Obviously the quotes around those two constants are missing somewhere (i.e. they have to be used with quotes, like'STYLESHEETPATH' and 'TEMPLATEPATH' when using newer PHP versions) . If you didn’t use those yourself in a file you created or edited, that error has to be somewhere in the plugin files. You can search for that and change it, but basically is up to the plugin author to fix that since any plugin update would overwrite it again.

    Login or Signup to reply.
  2. I was having this same issue. Many warnings in the log.

    I discovered it was a bug in one of my own custom plugins.

    You cannot call this: is_child_theme() before this function is called: wp_templating_constants() in wp-settings.php

    I was calling is_child_theme() in the plugin. This happens before the theme (and/or child theme) is loaded.

    The Solution: HOOK = after_setup_theme

    add_action( 'after_setup_theme', 'your_function_here' ); 
    
    function your_function_here()
    {
      if(is_child_theme()) // now it works, not warnings (soon to be an Error)
      {
        //do things..
      }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search