Skip to content

Commit 7d79a2b

Browse files
committed
Trigger a PHP notice when no callback function is associated to a given handle
1 parent 7bdf98c commit 7d79a2b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ protected function get_compiled_styles( $printed )
141141
$compiled_css = '';
142142
foreach( $this->stylesheets as $style )
143143
{
144+
if( !array_key_exists( $style['handle'], $this->callbacks ) )
145+
{
146+
trigger_error( 'There is no callback function associated with the handle "'.$style['handle'].'". Use <b>wp_dynamic_css_set_callback()</b> to register a callback function for this handle.' );
147+
continue;
148+
}
149+
144150
if( $style['print'] === $printed )
145151
{
146152
$compiled_css .= $this->get_compiled_style( $style )."\n";

0 commit comments

Comments
 (0)