@@ -22,6 +22,7 @@ import {
2222import { createHigherOrderComponent } from '@wordpress/compose'
2323import { addFilter } from '@wordpress/hooks'
2424import { select } from '@wordpress/data'
25+ import { semverCompare } from '~stackable/util'
2526
2627// Version 3.0.2 Deprecations
2728const addUndefinedAttributes = ( attributes , version ) => {
@@ -36,10 +37,35 @@ const determineFeatureImage = ( featuredImage, version ) => {
3637 return ( compareVersions ( '3.6.3' , version ) === - 1 ) ? featuredImage : < Image . Content />
3738}
3839
40+ const fixMetaAccessibility = ( output , metaProps , version ) => {
41+ const {
42+ authorShow,
43+ dateShow,
44+ commentsShow,
45+ author,
46+ date,
47+ comments,
48+ separator,
49+ metaClassNames,
50+ } = metaProps
51+ if ( semverCompare ( version , '<' , '3.19.0' ) ) {
52+ return ( authorShow || dateShow || commentsShow ) && < aside className = { metaClassNames } >
53+ { authorShow && author }
54+ { authorShow && author && ( ( dateShow && date ) || ( commentsShow && comments ) ) && separator }
55+ { dateShow && date }
56+ { ( ( authorShow && author ) || ( dateShow && date ) ) && commentsShow && comments && separator }
57+ { commentsShow && comments }
58+ </ aside >
59+ }
60+
61+ return output
62+ }
63+
3964addFilter ( 'stackable.posts.title.typography-content' , 'stackable/3_0_2' , addUndefinedAttributes )
4065addFilter ( 'stackable.posts.title.category-content' , 'stackable/3_0_2' , addUndefinedAttributes )
4166addFilter ( 'stackable.posts.title.readmore-content' , 'stackable/3_0_2' , addUndefinedAttributes )
4267addFilter ( 'stackable.posts.feature-image' , 'stackable/3_6_3' , determineFeatureImage )
68+ addFilter ( 'stackable.posts.meta' , 'stackable/3.19.0' , fixMetaAccessibility )
4369
4470const deprecated = [
4571 {
0 commit comments