'ultp-blocks-editor-script', 'editor_style' => 'ultp-blocks-editor-css', 'render_callback' => array( $this, 'content' ), ) ); } public function get_attributes() { return array( 'blockId' => '', 'layout' => 'layout1', /* ============================ Author Box Settings ============================*/ 'imgShow' => true, 'writtenByShow' => true, 'authorBioShow' => true, 'metaShow' => true, 'allPostLinkShow' => true, 'authorBoxAlign' => 'center', /* ============================ Author Image Settings ============================*/ 'imgSize' => (object) array( 'lg' => '100' ), 'imgRatio' => '100', /* ============================ Written by Settings ============================*/ 'writtenByText' => 'Written by', /* ============================ Author Name Settings ============================*/ 'authorNameTag' => 'h4', /* ============================ Meta Setting/Style Settings ============================*/ 'metaPosition' => 'bottom', /* ============================ View all Post Button Settings ============================*/ 'viewAllPostText' => 'View All Posts', /* ============================ Advanced Settings ============================*/ 'advanceId' => '', 'advanceZindex' => '', 'hideExtraLarge' => false, 'hideDesktop' => false, 'hideTablet' => false, 'hideMobile' => false, 'advanceCss' => '', ); } public function content( $attr, $noAjax ) { $attr = wp_parse_args( $attr, $this->get_attributes() ); $block_name = 'author_box'; $author_bio = $wrapper_before = $wrapper_after = $content = ''; $page_post_id = get_the_ID(); if ( $page_post_id ) { $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['authorNameTag'] = in_array( $attr['authorNameTag'], ultimate_post()->ultp_allowed_block_tags() ) ? $attr['authorNameTag'] : 'h4'; $attr['layout'] = sanitize_html_class( $attr['layout'] ); $attr['writtenByText'] = wp_kses( $attr['writtenByText'], ultimate_post()->ultp_allowed_html_tags() ); $_post = get_post( $page_post_id ); $post_author = get_userdata( $_post->post_author ); // Author Image $author_image = '
'; // Author Meta $author_meta = ''; // Author Description if ( $post_author->description ) { $author_bio .= ''; } // Author Url if ( get_author_posts_url( $_post->post_author ) ) { $all_post_link = ''; } $wrapper_before .= '