Skip to content

Commit 98ae37f

Browse files
committed
HTML API: Use more universal syntax to call Closure variable.
Replace `( $fn )( ...$args )` syntax with equivalent `call_user_func( $fn, ...$args )` to prevent an issue with the WordPress documentation parser. The parser would fail when encountering this syntax, preventing documentation generation. Developed in WordPress#10907. Follow-up to [58304]. Props dmsnell, jonsurrell. See #64224, #61348. git-svn-id: https://develop.svn.wordpress.org/trunk@61624 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6f6337b commit 98ae37f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-includes/html-api/class-wp-html-open-elements.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ public function after_element_push( WP_HTML_Token $item ): void {
715715
}
716716

717717
if ( null !== $this->push_handler ) {
718-
( $this->push_handler )( $item );
718+
call_user_func( $this->push_handler, $item );
719719
}
720720
}
721721

@@ -763,7 +763,7 @@ public function after_element_pop( WP_HTML_Token $item ): void {
763763
}
764764

765765
if ( null !== $this->pop_handler ) {
766-
( $this->pop_handler )( $item );
766+
call_user_func( $this->pop_handler, $item );
767767
}
768768
}
769769

0 commit comments

Comments
 (0)