array( 'blockName' => array( 'type' => 'string', 'default' => 'post-timeline', ), 'align' => array( 'type' => 'string', 'default' => '', ), 'alignTablet' => array( 'type' => 'string', 'default' => '', ), 'alignMobile' => array( 'type' => 'string', 'default' => '', ), 'headingColor' => array( 'type' => 'string', 'default' => '#333', ), 'subHeadingColor' => array( 'type' => 'string', 'default' => '#333', ), 'separatorBg' => array( 'type' => 'string', 'default' => '#eee', ), 'backgroundColor' => array( 'type' => 'string', 'default' => '#eee', ), 'separatorColor' => array( 'type' => 'string', 'default' => '#eee', ), 'separatorFillColor' => array( 'type' => 'string', 'default' => '#0693e3', ), 'separatorBorder' => array( 'type' => 'string', 'default' => '#eee', ), 'borderFocus' => array( 'type' => 'string', 'default' => '#5cb85c', ), 'headingTag' => array( 'type' => 'string', 'default' => 'h3', ), 'horizontalSpace' => array( 'type' => 'number', 'default' => 10, ), 'horizontalSpaceTablet' => array( 'type' => 'number', ), 'horizontalSpaceMobile' => array( 'type' => 'number', ), 'horizontalSpaceUnit' => array( 'type' => 'string', 'default' => 'px', ), 'horizontalSpaceUnitTablet' => array( 'type' => 'string', 'default' => 'px', ), 'horizontalSpaceUnitMobile' => array( 'type' => 'string', 'default' => 'px', ), 'verticalSpace' => array( 'type' => 'number', 'default' => 15, ), 'verticalSpaceTablet' => array( 'type' => 'number', ), 'verticalSpaceMobile' => array( 'type' => 'number', ), 'verticalSpaceUnit' => array( 'type' => 'string', 'default' => 'px', ), 'verticalSpaceUnitTablet' => array( 'type' => 'string', 'default' => 'px', ), 'verticalSpaceUnitMobile' => array( 'type' => 'string', 'default' => 'px', ), 'timelinAlignment' => array( 'type' => 'string', 'default' => 'center', ), 'timelinAlignmentTablet' => array( 'type' => 'string', ), 'timelinAlignmentMobile' => array( 'type' => 'string', ), 'arrowlinAlignment' => array( 'type' => 'string', 'default' => 'center', ), 'subHeadFontSizeType' => array( 'type' => 'string', 'default' => 'px', ), 'subHeadFontSize' => array( 'type' => 'number', ), 'subHeadFontSizeTablet' => array( 'type' => 'number', ), 'subHeadFontSizeMobile' => array( 'type' => 'number', ), 'subHeadFontFamily' => array( 'type' => 'string', 'default' => '', ), 'subHeadFontWeight' => array( 'type' => 'string', ), 'subHeadFontStyle' => array( 'type' => 'string', ), 'subHeadLineHeightType' => array( 'type' => 'string', 'default' => 'em', ), 'subHeadLineHeight' => array( 'type' => 'number', ), 'subHeadLineHeightTablet' => array( 'type' => 'number', ), 'subHeadLineHeightMobile' => array( 'type' => 'number', ), 'subHeadLoadGoogleFonts' => array( 'type' => 'boolean', 'default' => false, ), 'headSpace' => array( 'type' => 'number', 'default' => 5, ), 'headSpaceTablet' => array( 'type' => 'number', ), 'headSpaceMobile' => array( 'type' => 'number', ), 'authorSpace' => array( 'type' => 'number', 'default' => 5, ), 'authorSpaceTablet' => array( 'type' => 'number', ), 'authorSpaceMobile' => array( 'type' => 'number', ), 'contentSpace' => array( 'type' => 'number', 'default' => 15, ), 'separatorwidth' => array( 'type' => 'number', 'default' => 3, ), 'borderwidth' => array( 'type' => 'number', 'default' => 0, ), 'iconColor' => array( 'type' => 'string', 'default' => '#333', ), 'iconFocus' => array( 'type' => 'string', 'default' => '#fff', ), 'iconBgFocus' => array( 'type' => 'string', 'default' => '#0693e3', ), 'authorColor' => array( 'type' => 'string', 'default' => '#333', ), 'authorFontSizeType' => array( 'type' => 'string', 'default' => 'px', ), 'authorFontSize' => array( 'type' => 'number', 'default' => 11, ), 'authorFontSizeTablet' => array( 'type' => 'number', ), 'authorFontSizeMobile' => array( 'type' => 'number', ), 'authorFontFamily' => array( 'type' => 'string', 'default' => '', ), 'authorFontWeight' => array( 'type' => 'string', ), 'authorFontStyle' => array( 'type' => 'string', ), 'authorLineHeightType' => array( 'type' => 'string', 'default' => 'em', ), 'authorLineHeight' => array( 'type' => 'number', ), 'authorLineHeightTablet' => array( 'type' => 'number', ), 'authorLineHeightMobile' => array( 'type' => 'number', ), 'authorLoadGoogleFonts' => array( 'type' => 'boolean', 'default' => false, ), 'ctaFontSizeType' => array( 'type' => 'string', 'default' => 'px', ), 'ctaFontSize' => array( 'type' => 'number', 'default' => '', ), 'ctaFontSizeTablet' => array( 'type' => 'number', ), 'ctaFontSizeMobile' => array( 'type' => 'number', ), 'ctaFontFamily' => array( 'type' => 'string', 'default' => '', ), 'ctaFontWeight' => array( 'type' => 'string', ), 'ctaFontStyle' => array( 'type' => 'string', ), 'ctaLineHeightType' => array( 'type' => 'string', 'default' => 'em', ), 'ctaLineHeight' => array( 'type' => 'number', ), 'ctaLineHeightTablet' => array( 'type' => 'number', ), 'ctaLineHeightMobile' => array( 'type' => 'number', ), 'ctaLoadGoogleFonts' => array( 'type' => 'boolean', 'default' => false, ), 'dateColor' => array( 'type' => 'string', 'default' => '#333', ), 'dateFontsizeType' => array( 'type' => 'string', 'default' => 'px', ), 'dateFontsize' => array( 'type' => 'number', 'default' => 12, ), 'dateFontsizeTablet' => array( 'type' => 'number', ), 'dateFontsizeMobile' => array( 'type' => 'number', ), 'dateFontFamily' => array( 'type' => 'string', 'default' => '', ), 'dateFontWeight' => array( 'type' => 'string', ), 'dateFontStyle' => array( 'type' => 'string', ), 'dateLineHeightType' => array( 'type' => 'string', 'default' => 'em', ), 'dateLineHeight' => array( 'type' => 'number', ), 'dateLineHeightTablet' => array( 'type' => 'number', ), 'dateLineHeightMobile' => array( 'type' => 'number', ), 'dateLoadGoogleFonts' => array( 'type' => 'boolean', 'default' => false, ), 'connectorBgsize' => array( 'type' => 'number', 'default' => 35, ), 'dateBottomspace' => array( 'type' => 'number', 'default' => 5, ), 'dateBottomspaceMobile' => array( 'type' => 'number', ), 'dateBottomspaceTablet' => array( 'type' => 'number', ), 'headFontSizeType' => array( 'type' => 'string', 'default' => 'px', ), 'headFontSize' => array( 'type' => 'number', ), 'headFontSizeTablet' => array( 'type' => 'number', ), 'headFontSizeMobile' => array( 'type' => 'number', ), 'headFontFamily' => array( 'type' => 'string', 'default' => '', ), 'headFontWeight' => array( 'type' => 'string', ), 'headFontStyle' => array( 'type' => 'string', ), 'headLineHeightType' => array( 'type' => 'string', 'default' => 'em', ), 'headLineHeight' => array( 'type' => 'number', ), 'headLineHeightTablet' => array( 'type' => 'number', ), 'headLineHeightMobile' => array( 'type' => 'number', ), 'headLoadGoogleFonts' => array( 'type' => 'boolean', 'default' => false, ), 'categories' => array( 'type' => 'string', ), 'postType' => array( 'type' => 'string', 'default' => 'post', ), 'taxonomyType' => array( 'type' => 'string', 'default' => 'category', ), 'postsToShow' => array( 'type' => 'number', 'default' => 6, ), 'postsOffset' => array( 'type' => 'number', 'default' => 0, ), 'displayPostDate' => array( 'type' => 'boolean', 'default' => true, ), 'dateFormat' => array( 'type' => 'string', 'default' => 'F j, Y', ), 'displayPostExcerpt' => array( 'type' => 'boolean', 'default' => true, ), 'displayPostAuthor' => array( 'type' => 'boolean', 'default' => true, ), 'displayPostImage' => array( 'type' => 'boolean', 'default' => true, ), 'displayPostLink' => array( 'type' => 'boolean', 'default' => true, ), 'exerptLength' => array( 'type' => 'number', 'default' => 15, ), 'postLayout' => array( 'type' => 'string', 'default' => 'grid', ), 'columns' => array( 'type' => 'number', 'default' => 2, ), 'width' => array( 'type' => 'string', 'default' => 'wide', ), 'order' => array( 'type' => 'string', 'default' => 'desc', ), 'orderBy' => array( 'type' => 'string', 'default' => 'date', ), 'imageSize' => array( 'type' => 'string', 'default' => 'large', ), 'readMoreText' => array( 'type' => 'string', 'default' => __( 'Read More', 'ultimate-addons-for-gutenberg' ), ), 'block_id' => array( 'type' => 'string', 'default' => 'not_set', ), 'icon' => array( 'type' => 'string', 'default' => 'calendar-days', ), 'borderRadius' => array( 'type' => 'number', 'default' => 2, ), 'borderRadiusTablet' => array( 'type' => 'number', ), 'borderRadiusMobile' => array( 'type' => 'number', ), 'bgPadding' => array( 'type' => 'number', 'default' => 20, ), 'contentPadding' => array( 'type' => 'number', 'default' => 10, ), 'ctaBottomSpacing' => array( 'type' => 'number', 'default' => 0, ), 'ctaBottomSpacingTablet' => array( 'type' => 'number', ), 'ctaBottomSpacingMobile' => array( 'type' => 'number', ), 'headTopSpacing' => array( 'type' => 'number', 'default' => 0, ), 'headTopSpacingTablet' => array( 'type' => 'number', ), 'headTopSpacingMobile' => array( 'type' => 'number', ), 'iconSize' => array( 'type' => 'number', 'default' => 15, ), 'ctaColor' => array( 'type' => 'string', ), 'ctaBackground' => array( 'type' => 'string', ), 'stack' => array( 'type' => 'string', 'default' => 'tablet', ), 'linkTarget' => array( 'type' => 'boolean', 'default' => false, ), // Exclude Current Post. 'excludeCurrentPost' => array( 'type' => 'boolean', 'default' => false, ), 'leftMargin' => array( 'type' => 'number', ), 'rightMargin' => array( 'type' => 'number', ), 'topMargin' => array( 'type' => 'number', ), 'bottomMargin' => array( 'type' => 'number', ), 'leftMarginTablet' => array( 'type' => 'number', ), 'rightMarginTablet' => array( 'type' => 'number', ), 'topMarginTablet' => array( 'type' => 'number', ), 'bottomMarginTablet' => array( 'type' => 'number', ), 'leftMarginMobile' => array( 'type' => 'number', ), 'rightMarginMobile' => array( 'type' => 'number', ), 'topMarginMobile' => array( 'type' => 'number', ), 'bottomMarginMobile' => array( 'type' => 'number', ), 'marginUnit' => array( 'type' => 'string', 'default' => 'px', ), 'mobileMarginUnit' => array( 'type' => 'string', 'default' => 'px', ), 'tabletMarginUnit' => array( 'type' => 'string', 'default' => 'px', ), 'marginLink' => array( 'type' => 'boolean', 'default' => false, ), 'leftPadding' => array( 'type' => 'number', ), 'rightPadding' => array( 'type' => 'number', ), 'topPadding' => array( 'type' => 'number', ), 'bottomPadding' => array( 'type' => 'number', ), 'leftPaddingTablet' => array( 'type' => 'number', ), 'rightPaddingTablet' => array( 'type' => 'number', ), 'topPaddingTablet' => array( 'type' => 'number', ), 'bottomPaddingTablet' => array( 'type' => 'number', ), 'leftPaddingMobile' => array( 'type' => 'number', ), 'rightPaddingMobile' => array( 'type' => 'number', ), 'topPaddingMobile' => array( 'type' => 'number', ), 'bottomPaddingMobile' => array( 'type' => 'number', ), 'paddingUnit' => array( 'type' => 'string', 'default' => 'px', ), 'mobilePaddingUnit' => array( 'type' => 'string', 'default' => 'px', ), 'tabletPaddingUnit' => array( 'type' => 'string', 'default' => 'px', ), 'paddingLink' => array( 'type' => 'boolean', 'default' => false, ), 'headTransform' => array( 'type' => 'string', ), 'authorTransform' => array( 'type' => 'string', ), 'subHeadTransform' => array( 'type' => 'string', ), 'dateTransform' => array( 'type' => 'string', ), 'ctaTransform' => array( 'type' => 'string', ), 'headDecoration' => array( 'type' => 'string', ), 'authorDecoration' => array( 'type' => 'string', ), 'subHeadDecoration' => array( 'type' => 'string', ), 'dateDecoration' => array( 'type' => 'string', ), 'ctaDecoration' => array( 'type' => 'string', ), 'isPreview' => array( 'type' => 'boolean', 'default' => false, ), 'headLetterSpacing' => array( 'type' => 'number', 'default' => '', ), 'headLetterSpacingType' => array( 'type' => 'string', 'default' => 'px', ), 'headLetterSpacingMobile' => array( 'type' => 'number', ), 'headLetterSpacingTablet' => array( 'type' => 'number', ), 'subHeadLetterSpacing' => array( 'type' => 'number', 'default' => '', ), 'subHeadLetterSpacingType' => array( 'type' => 'string', 'default' => 'px', ), 'subHeadLetterSpacingMobile' => array( 'type' => 'number', ), 'subHeadLetterSpacingTablet' => array( 'type' => 'number', ), 'ctaLetterSpacing' => array( 'type' => 'number', 'default' => '', ), 'ctaLetterSpacingType' => array( 'type' => 'string', 'default' => 'px', ), 'ctaLetterSpacingMobile' => array( 'type' => 'number', ), 'ctaLetterSpacingTablet' => array( 'type' => 'number', ), 'dateLetterSpacing' => array( 'type' => 'number', 'default' => '', ), 'dateLetterSpacingType' => array( 'type' => 'string', 'default' => 'px', ), 'dateLetterSpacingMobile' => array( 'type' => 'number', ), 'dateLetterSpacingTablet' => array( 'type' => 'number', ), 'authorLetterSpacing' => array( 'type' => 'number', 'default' => '', ), 'authorLetterSpacingType' => array( 'type' => 'string', 'default' => 'px', ), 'authorLetterSpacingMobile' => array( 'type' => 'number', ), 'authorLetterSpacingTablet' => array( 'type' => 'number', ), ), 'render_callback' => array( $this, 'post_timeline_callback' ), ) ); } /** * Renders the post grid block on server. * * @param array $attributes Array of block attributes. * * @since 0.0.1 */ public function post_timeline_callback( $attributes ) { $attributes['post_type'] = 'timeline'; $recent_posts = UAGB_Helper::get_query( $attributes, 'timeline' ); $block_id = 'uagb-block-' . $attributes['block_id']; $desktop_class = ''; $tab_class = ''; $mob_class = ''; if ( array_key_exists( 'UAGHideDesktop', $attributes ) || array_key_exists( 'UAGHideTab', $attributes ) || array_key_exists( 'UAGHideMob', $attributes ) ) { $desktop_class = ( isset( $attributes['UAGHideDesktop'] ) ) ? 'uag-hide-desktop' : ''; $tab_class = ( isset( $attributes['UAGHideTab'] ) ) ? 'uag-hide-tab' : ''; $mob_class = ( isset( $attributes['UAGHideMob'] ) ) ? 'uag-hide-mob' : ''; } $zindex_desktop = ''; $zindex_tablet = ''; $zindex_mobile = ''; $zindex_wrap = array(); $zindex_extention_enabled = ( isset( $attributes['zIndex'] ) || isset( $attributes['zIndexTablet'] ) || isset( $attributes['zIndexMobile'] ) ); if ( $zindex_extention_enabled ) { $zindex_desktop = ( isset( $attributes['zIndex'] ) ) ? '--z-index-desktop:' . $attributes['zIndex'] . ';' : false; $zindex_tablet = ( isset( $attributes['zIndexTablet'] ) ) ? '--z-index-tablet:' . $attributes['zIndexTablet'] . ';' : false; $zindex_mobile = ( isset( $attributes['zIndexMobile'] ) ) ? '--z-index-mobile:' . $attributes['zIndexMobile'] . ';' : false; if ( $zindex_desktop ) { array_push( $zindex_wrap, $zindex_desktop ); } if ( $zindex_tablet ) { array_push( $zindex_wrap, $zindex_tablet ); } if ( $zindex_mobile ) { array_push( $zindex_wrap, $zindex_mobile ); } } $outer_class = 'uagb-timeline__outer-wrap'; $main_classes = array( 'wp-block-uagb-post-timeline', $outer_class, $block_id, $desktop_class, $tab_class, $mob_class, $zindex_extention_enabled ? 'uag-blocks-common-selector' : '', ); ob_start(); ?>
get_post_html( $attributes, $recent_posts ); } ?>
have_posts() ) { $query->the_post(); global $post; $this->render_single( $attributes, $index, $post ); $index++; } wp_reset_postdata(); ?> get_align_classes( $attributes, $index ); $day_align_class = $this->get_day_align_classes( $attributes, $index ); ?>
get_icon( $attributes ); ?>
get_date( $attributes, 'uagb-timeline__date-hide uagb-timeline__inner-date-new' ); ?> get_image( $attributes ) : ''; ?> get_title( $attributes ); $this->get_author( $attributes, $post->post_author ); $this->get_excerpt( $attributes ); $this->get_cta( $attributes ); ?>
get_date( $attributes, 'uagb-timeline__date-new' ); ?>
" target="" rel="noopener noreferrer"> ID; ?>
< class="uagb-timeline__heading" > " target="" rel="noopener noreferrer"> > ID, $post->post_content, $excerpt_length_fallback ); if ( ! $excerpt ) { $excerpt = null; } $excerpt = apply_filters( "uagb_single_post_excerpt_{$attributes['post_type']}", $excerpt, get_the_ID(), $attributes ); do_action( "uagb_single_post_before_excerpt_{$attributes['post_type']}", get_the_ID(), $attributes ); ?>