Skip to content

Commit

Permalink
Transfer oik/content-block from oik-blocks #180
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Aug 16, 2021
1 parent 9ad01df commit b14a3ea
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions oik.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ function oik_register_dynamic_blocks() {
$registered = register_block_type_from_metadata( __DIR__ .'/src/oik-address', $args );
$args = [ 'render_callback' => 'oik_dynamic_block_contact_form' ];
$registered = register_block_type_from_metadata( __DIR__ .'/src/oik-contact-form', $args );
$args = [ 'render_callback' => 'oik_dynamic_block_content_block' ];
$registered = register_block_type_from_metadata( __DIR__ .'/src/oik-content', $args );
$args = [ 'render_callback' => 'oik_dynamic_block_countdown' ];
$registered = register_block_type_from_metadata( __DIR__ .'/src/oik-countdown', $args );
$args = [ 'render_callback' => 'oik_dynamic_block_follow_me' ];
Expand Down Expand Up @@ -699,6 +701,21 @@ function oik_dynamic_block_shortcode_block( $attributes ) {
return $html;

}

/**
* Server rendering dynamic content block
*
* @param array $attributes
* @return string generated HTML
*/
function oik_dynamic_block_content_block( $attributes ) {
$html = \oik\oik_blocks\oik_blocks_check_server_func( 'shortcodes/oik-content.php', 'oik', 'oik_content_block' );
if ( ! $html ) {
$html = oik_content_block( $attributes );
}
//oik_require( "shortcodes/oik-shortcode.php", "oik-blocks" );
return $html;
}

/**
* Initiate oik processing
Expand Down

0 comments on commit b14a3ea

Please sign in to comment.