8
8
9
9
namespace WordPressdotorg \Theme \Main_2022 \Remembers_List_Block ;
10
10
11
- use function WordPressdotorg \MemorialProfiles \get_memorial_profiles ;
12
-
13
11
add_action ( 'init ' , __NAMESPACE__ . '\init ' );
14
12
15
13
/**
@@ -39,11 +37,11 @@ function init() {
39
37
*/
40
38
function render ( $ attributes , $ content , $ block ) {
41
39
42
- if ( ! function_exists ( 'get_memorial_profiles ' ) ) {
43
- return __ ( 'Memorial Profiles plugin is not active . ' , 'wporg ' );
40
+ if ( ! function_exists ( '\WordPressdotorg\MemorialProfiles\get_profiles ' ) ) {
41
+ return __ ( 'Memorial Profiles mu- plugin is missing . ' , 'wporg ' );
44
42
}
45
43
46
- $ profiles = get_memorial_profiles ();
44
+ $ profiles = \ WordPressdotorg \ MemorialProfiles \get_profiles ();
47
45
48
46
$ columns = $ attributes ['columns ' ];
49
47
$ group_count = ceil ( count ( $ profiles ) / $ columns );
@@ -55,7 +53,8 @@ function render( $attributes, $content, $block ) {
55
53
56
54
$ block_content = '' ;
57
55
foreach ( $ groups as $ group ) {
58
- $ block_content .= '<!-- wp:columns --><div class="wp-block-columns"> ' ;
56
+ // Set isStackedOnMobile to false so that the columns are not stacked on mobile. We override this in CSS to stack them.
57
+ $ block_content .= '<!-- wp:columns {"isStackedOnMobile":false} --><div class="wp-block-columns is-not-stacked-on-mobile"> ' ;
59
58
60
59
foreach ( $ group as $ profile ) {
61
60
$ block_content .= '<!-- wp:column --><div class="wp-block-column"> ' ;
0 commit comments