is_active( 'related-posts' ) && ! current_user_can( 'jetpack_activate_modules' ) ) { return; } if ( ( new Host() )->is_wpcom_simple() || ( \Jetpack::is_connection_ready() && ! ( new Status() )->is_offline_mode() ) ) { Blocks::jetpack_register_block( __DIR__, array( 'render_callback' => __NAMESPACE__ . '\render_block', ) ); } } add_action( 'init', __NAMESPACE__ . '\register_block', 9 ); /** * Related Posts block render callback. * * The render implementation lives in render.php and is only loaded when the * block is actually rendered, keeping it out of the eager front-end path. * * @param array $attributes Array containing the Button block attributes. * @param string $content The block content. * @param WP_Block $block The block object. * * @return string */ function render_block( $attributes, $content, $block ) { require_once __DIR__ . '/render.php'; return render_block_implementation( $attributes, $content, $block ); }