Skip to content

Commit

Permalink
Use __return_empty_string instead of custom function
Browse files Browse the repository at this point in the history
  • Loading branch information
merkushin committed Jul 28, 2024
1 parent d0bb904 commit 65b05b6
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions includes/blocks/class-sensei-block-quiz-question.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ public function __construct() {
Sensei_Blocks::register_sensei_block(
'sensei-lms/quiz-question',
[
'render_callback' => [ $this, 'render_empty_string' ],
'render_callback' => [ $this, '__return_empty_string' ],
],
Sensei()->assets->src_path( 'blocks/quiz/question-block' )
);
Sensei_Blocks::register_sensei_block(
'sensei-lms/question-description',
[
'render_callback' => [ $this, 'render_empty_string' ],
'render_callback' => [ $this, '__return_empty_string' ],
],
Sensei()->assets->src_path( 'blocks/quiz/question-description-block' )
);
Sensei_Blocks::register_sensei_block(
'sensei-lms/question-answers',
[
'render_callback' => [ $this, 'render_empty_string' ],
'render_callback' => [ $this, '__return_empty_string' ],
],
Sensei()->assets->src_path( 'blocks/quiz/question-answers-block' )
);
Expand All @@ -53,22 +53,8 @@ public function __construct() {
* @return string The block HTML.
*/
public function render_quiz_question( array $attributes, string $content ): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
_deprecated_function( __METHOD__, '$$next-version$$', 'Sensei_Block_Quiz_Question::render_empty_string' );
_deprecated_function( __METHOD__, '$$next-version$$', '__return_empty_string' );

return '';
}

/**
* Renders the block as an empty string.
*
* @since $$next-version$$
*
* @param array $attributes The block attributes.
* @param string $content The block content.
*
* @return string The block HTML.
*/
public function render_empty_string( array $attributes, string $content ): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
return '';
}
}

0 comments on commit 65b05b6

Please sign in to comment.