dozent_question_decode( null $comment_content = null, bool $nl2br = true )
Parameters
- $comment_content
-
(null) (Optional) Json Encoded Text | Content
Default value: null
- $nl2br
-
(bool) (Optional) whether should generate br tag on new line or not. false for textarea
Default value: true
Return
(object)
Source
File: includes/core-functions.php
function dozent_question_decode( $comment_content = null , $nl2br = true ) { $data = [ 'title' => '', 'question' => '', ]; $comment_content = json_decode($comment_content, true); if (dozent_array_get('title', $comment_content)) { $question = dozent_array_get('question', $comment_content); $question = stripslashes( $question ); if ( $nl2br ){ $question = nl2br( $question ); } $comment_content['question'] = $question; $data = $comment_content; } return (object)$data; }
Changelog
Version | Description |
---|---|
DozentLMS 1.0.0 | Introduced. |