Skip to content

Commit

Permalink
Page creation UI integration
Browse files Browse the repository at this point in the history
- Create a new paragraph as a pattern
  • Loading branch information
dantovbein committed Jun 29, 2022
1 parent eaba4dd commit 7c6d630
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions classes/patterns/class-block-pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function register_all() {
}

$patterns = [
Paragraph::class,
SideImageWithTextAndCta::class,
HighlightedCta::class,
RealityCheck::class,
Expand Down
42 changes: 42 additions & 0 deletions classes/patterns/class-paragraph.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Paragraph class.
*
* @package P4GBKS
* @since 0.1
*/

namespace P4GBKS\Patterns;

/**
* Post Content
*
* @package P4GBKS\Patterns
*/
class Paragraph extends Block_Pattern {

/**
* Returns the pattern name.
*/
public static function get_name(): string {
return 'p4/paragraph';
}

/**
* Returns the pattern config.
*
* @param array $params Optional array of parameters for the config.
*/
public static function get_config( $params = [] ): array {
return [
'title' => __( 'Paragraph', 'planet4-blocks-backend' ),
'blockTypes' => [ 'core/post-content' ],
'categories' => [ 'planet4' ],
'content' => '
<!-- wp:paragraph {"placeholder":"' . __( 'Enter text', 'planet4-blocks-backend' ) . '"} -->
<p>This paragraph has been added through the modal</p>
<!-- /wp:paragraph -->
',
];
}
}

0 comments on commit 7c6d630

Please sign in to comment.