array( 'tracking' => apply_filters( 'happy_blocks_pricing_plans_tracking', true ), ), 'locale' => get_user_locale(), ); } /** * Render happy-tools/pricing-plans block view placeholder. * * @param array $attributes Block attributes. * @return string */ function happyblocks_pricing_plans_render_callback( $attributes ) { // The domain should be set to false instead of null when not available, see https://github.com/Automattic/wp-calypso/pull/70402#discussion_r1033299970. $attributes['domain'] = happyblocks_pricing_plans_is_author() ? $attributes['domain'] : false; $json_attributes = htmlspecialchars( wp_json_encode( $attributes ), ENT_QUOTES, 'UTF-8' ); return << HTML; } /** * Register happy-blocks. */ function happyblocks_pricing_plan_register() { register_block_type( __DIR__ . ( is_rtl() ? '/build/rtl' : '/build' ), array( 'render_callback' => 'happyblocks_pricing_plans_render_callback', ) ); } add_action( 'init', 'happyblocks_pricing_plan_register' );