block_name = 'column'; $this->styles = array( 'sp_smart_post_blocks_css', ); } /** * Render Column block. * * @param array $attributes attributes. * @param mixed $content Content to be rendered. * @param array $blocks Blocks to be rendered. * @return string Rendered HTML content. */ public function render_block( $attributes, $content = '', $blocks = array() ) { if ( Helper::is_editor_page() ) { return $content; } $attributes['page_id'] = get_the_ID(); unset( $attributes['dynamicCss'], $attributes['fontListsEditPage'], $attributes['fontLists'] ); $unique_id = $attributes['uniqueId'] ?? ''; $column_additional_class = $attributes['columnAdditionalClass'] ?? ''; $column_additional_id = $attributes['columnAdditionalID'] ?? ''; $column_wrapper_link_enable = isset( $attributes['columnWrapperLink'] ) ? $attributes['columnWrapperLink'] : false; $column_wrapper_link_url = $attributes['columnWrapperLinkUrl'] ?? ''; $column_wrapper_link_newtab = isset( $attributes['columnWrapperLinkNewTab'] ) && $attributes['columnWrapperLinkNewTab'] ? '_blank' : '_self'; // Video Background Attributes. $background_style = isset( $attributes['columnBg']['color']['style'] ) ? $attributes['columnBg']['color']['style'] : ''; $background_video = $attributes['columnBgVideo'] ?? ''; $background_video_url = isset( $background_video['url'] ) ? $background_video['url'] : ''; // Column Class. $column_class = array( $unique_id, 'sp-smart-post-container-column' ); if ( ! empty( $column_additional_class ) ) { $column_class[] = $column_additional_class; } $column_class_output = implode( ' ', $column_class ); ob_start(); ?>