PluginProbe
ActivityPub / trunk
ActivityPub vtrunk
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / patterns / profile-page.php

profile-page.php in ActivityPub trunk, at patterns/profile-page.php

60 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Fediverse Profile Page pattern.
4 *
5 * @package Activitypub
6 */
7
8 $selected_user = ! \Activitypub\is_user_type_disabled( 'blog' ) ? 'blog' : 'inherit';
9
10 $following_block = '';
11 if ( '1' === \get_option( 'activitypub_following_ui', '0' ) ) {
12 $following_block = '
13 <!-- wp:spacer {"height":"32px"} -->
14 <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
15 <!-- /wp:spacer -->
16 <!-- wp:activitypub/following {"selectedUser":"' . $selected_user . '"} -->
17 <div class="wp-block-activitypub-following"><!-- wp:heading {"level":3} -->
18 <h3 class="wp-block-heading">' . esc_html_x( 'Following', 'Block pattern content', 'activitypub' ) . '</h3>
19 <!-- /wp:heading --></div>
20 <!-- /wp:activitypub/following -->';
21 }
22
23 \register_block_pattern(
24 'activitypub/profile-page',
25 array(
26 'title' => _x( 'Fediverse Profile Page', 'Block pattern title', 'activitypub' ),
27 'categories' => array( 'activitypub' ),
28 'keywords' => array(
29 _x( 'profile', 'Block pattern keyword', 'activitypub' ),
30 _x( 'fediverse', 'Block pattern keyword', 'activitypub' ),
31 _x( 'page', 'Block pattern keyword', 'activitypub' ),
32 _x( 'extra fields', 'Block pattern keyword', 'activitypub' ),
33 _x( 'followers', 'Block pattern keyword', 'activitypub' ),
34 ),
35 'description' => '1' === \get_option( 'activitypub_following_ui', '0' )
36 ? _x( 'Full profile page with extra fields, followers, and following lists.', 'Block pattern description', 'activitypub' )
37 : _x( 'Full profile page with extra fields and followers list.', 'Block pattern description', 'activitypub' ),
38 'viewportWidth' => 1200,
39 'postTypes' => array( 'page' ),
40 'blockTypes' => array( 'core/post-content' ),
41 'content' => '<!-- wp:group {"layout":{"type":"constrained"}} -->
42 <div class="wp-block-group">
43 <!-- wp:activitypub/follow-me {"selectedUser":"' . $selected_user . '","className":"is-style-profile"} /-->
44 <!-- wp:spacer {"height":"32px"} -->
45 <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
46 <!-- /wp:spacer -->
47 <!-- wp:activitypub/extra-fields {"selectedUser":"' . $selected_user . '"} /-->
48 <!-- wp:spacer {"height":"32px"} -->
49 <div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
50 <!-- /wp:spacer -->
51 <!-- wp:activitypub/followers {"selectedUser":"' . $selected_user . '"} -->
52 <div class="wp-block-activitypub-followers"><!-- wp:heading {"level":3} -->
53 <h3 class="wp-block-heading">' . esc_html_x( 'Followers', 'Block pattern content', 'activitypub' ) . '</h3>
54 <!-- /wp:heading --></div>
55 <!-- /wp:activitypub/followers -->' . $following_block . '
56 </div>
57 <!-- /wp:group -->',
58 )
59 );
60