'', 'layout' => 'layout1', /* ============================ Post Comment Settings ============================*/ // Comments Form Heading 'replyHeading' => true, 'leaveRepText' => 'Leave a Reply', /* ============================ Comments Form Input ============================*/ 'inputPlaceHolder' => 'Express your thoughts, idea or write a feedback by clicking here & start an awesome comment', /* ============================ Comments Form label style ============================*/ 'inputLabel' => true, 'cmntInputText' => "Comment's", 'nameInputText' => 'Name', 'emailInputText' => 'Email', 'webInputText' => 'Website Url', 'cookiesEnable' => true, 'cookiesText' => 'Save my name, email, and website in this browser for the next time I comment.', /* ============================ Submit Button Style ============================*/ 'subBtnText' => 'Post Comment', /* ============================ Comment Reply Style ============================*/ // Title and total Comment Count 'replyText' => 'Comments Text', 'commentCount' => true, // -------------------------- // Advanced Settings // -------------------------- 'advanceId' => '', 'advanceZindex' => '', 'hideExtraLarge' => false, 'hideDesktop' => false, 'hideTablet' => false, 'hideMobile' => false, 'advanceCss' => '', ); } public function register() { register_block_type( 'ultimate-post/post-comments', array( 'editor_script' => 'ultp-blocks-editor-script', 'editor_style' => 'ultp-blocks-editor-css', 'render_callback' => array( $this, 'content' ), ) ); } public function content( $attr, $noAjax ) { $attr = wp_parse_args( $attr, $this->get_attributes() ); $block_name = 'post-comments'; $wrapper_before = $wrapper_after = $wrapper_content = ''; if ( is_single() ) { $attr['className'] = isset( $attr['className'] ) && $attr['className'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['className'] ) : ''; $attr['align'] = isset( $attr['align'] ) && $attr['align'] ? preg_replace( '/[^A-Za-z0-9_ -]/', '', $attr['align'] ) : ''; $attr['advanceId'] = isset( $attr['advanceId'] ) ? sanitize_html_class( $attr['advanceId'] ) : ''; $attr['blockId'] = isset( $attr['blockId'] ) ? sanitize_html_class( $attr['blockId'] ) : ''; $attr['layout'] = sanitize_html_class( $attr['layout'] ); $allowed_html_tags = ultimate_post()->ultp_allowed_html_tags(); $attr['nameInputText'] = wp_kses( $attr['nameInputText'], $allowed_html_tags ); $attr['emailInputText'] = wp_kses( $attr['emailInputText'], $allowed_html_tags ); $attr['webInputText'] = wp_kses( $attr['webInputText'], $allowed_html_tags ); $attr['cmntInputText'] = wp_kses( $attr['cmntInputText'], $allowed_html_tags ); $attr['cookiesText'] = wp_kses( $attr['cookiesText'], $allowed_html_tags ); $attr['inputPlaceHolder'] = wp_kses( $attr['inputPlaceHolder'], $allowed_html_tags ); $attr['subBtnText'] = wp_kses( $attr['subBtnText'], $allowed_html_tags ); $attr['leaveRepText'] = wp_kses( $attr['leaveRepText'], $allowed_html_tags ); $attr['replyText'] = wp_kses( $attr['replyText'], $allowed_html_tags ); $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); $auth_label = $attr['inputLabel'] ? '' : ''; $email_label = $attr['inputLabel'] ? '' : ''; $url_label = $attr['inputLabel'] ? '' : ''; $comment_label = $attr['inputLabel'] ? '' : ''; $cookies_label = $attr['cookiesEnable'] ? '
' : ''; $comments_args = array( 'comment_field' => '