[wp-trac] [WordPress Trac] #30459: is_child_theme() cannot be used during plugin activation as is

WordPress Trac noreply at wordpress.org
Sun Nov 23 00:58:48 UTC 2014


#30459: is_child_theme() cannot be used during plugin activation as is
--------------------------+-----------------------------
 Reporter:  cais          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I was developing a plugin that was based on a specific theme (or any
 child-theme of the theme) and tried to use `is_child_theme()` as part of
 the activation/compatibility tests.

 It appears `is_child_theme()` is trying to use undefined constants at this
 point, this being the case the easiest solution I am seeing is to use the
 constant definitions in `is_child_theme()` versus using the constants
 themselves.

 With the constants an error is thrown when the plugin is activated, with
 the function calls no errors are thrown.

 See simple patch to change `is_child_theme()` from using constants to
 using the actual function calls.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30459>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list