# b-blocks/2.1.0/build/section-heading/render.php

bBlocks – Essential Gutenberg Blocks &amp; Patterns Collection, version 2.1.0. 56 lines.

- Page: https://pluginprobe.com/plugins/b-blocks/2.1.0/code/build/section-heading/render.php
- Raw: https://pluginprobe.com/plugins/b-blocks/2.1.0/raw/build/section-heading/render.php
- Modified: 2026-07-27T10:48:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/b-blocks/2.1.0/code/build/section-heading/render.php#L10-L20`.

```php
<?php
$prefix = 'bBlocksSectionHeading';
$id = wp_unique_id( "$prefix-" );
$planClass = BBlocks\Inc\Utils::isPro() ? 'pro' : 'free';

use BBlocks\Inc\GetCSS as GetCSS;

// Generate Styles
if( !function_exists( 'bBlocksSectionHeadingStyle' ) ) {
	function bBlocksSectionHeadingStyle($attributes, $id, $prefix){
		extract( $attributes );

		$headingSl = "#$id .$prefix";

		$sectionHeadingStyle = new BBlocksStyleGenerator();
		$sectionHeadingStyle::addStyle( "$headingSl", [
			'text-align' => $textAlign
		] );
		$sectionHeadingStyle::addStyle( "$headingSl .sectionHeadingTitle", [
			'color' => $titleColor,
			'margin' => GetCSS::getSpaceCSS( $titleMargin )
		] );
		$sectionHeadingStyle::addStyle( "$headingSl .sectionHeadingSeparator", [
			GetCSS::getSeparatorCSS( $separator ) => '',
			'margin' => GetCSS::getSpaceCSS( $sepMargin )
		] );
		$sectionHeadingStyle::addStyle( "$headingSl .sectionHeadingDescription", [
			'color' => $descColor,
			'margin' => GetCSS::getSpaceCSS( $descMargin )
		] );

		return GetCSS::getTypoCSS( '', $titleTypo )['googleFontLink'] .
			GetCSS::getTypoCSS( '', $descTypo )['googleFontLink'] .
			GetCSS::getTypoCSS( "$headingSl .sectionHeadingTitle", $titleTypo )['styles'] .
			GetCSS::getTypoCSS( "$headingSl .sectionHeadingDescription", $descTypo )['styles'] .
			$sectionHeadingStyle::renderStyle();
	}
}

extract( $attributes );
?>
<div
	<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- get_block_wrapper_attributes() is properly escaped ?>
	<?php echo get_block_wrapper_attributes( [ 'class' => $planClass ] ); ?>
	id='<?php echo esc_attr( $id ); ?>'
>
	<style>
		<?php echo esc_html( bBlocksSectionHeadingStyle( $attributes, $id, $prefix ) ); ?>
	</style>

	<div class='bBlocksSectionHeading'>
		<h2 class='sectionHeadingTitle'><?php echo wp_kses_post( $title ); ?></h2>
		<?php echo $isSep ? "<span class='sectionHeadingSeparator'></span>" : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static markup, no user input. ?>
		<?php echo $isDesc ? "<p class='sectionHeadingDescription'>". wp_kses_post( $desc ) ."</p>" : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static wrapper tags with wp_kses_post-escaped content. ?>
	</div>
</div>
```
