# polylang/3.8/src/modules/Blocks/load.php

Polylang, version 3.8. 24 lines.

- Page: https://pluginprobe.com/plugins/polylang/3.8/code/src/modules/Blocks/load.php
- Raw: https://pluginprobe.com/plugins/polylang/3.8/raw/src/modules/Blocks/load.php
- Modified: 2026-02-23T14:05:20+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/polylang/3.8/code/src/modules/Blocks/load.php#L10-L20`.

```php
<?php
/**
 * @package Polylang
 */

namespace WP_Syntex\Polylang\Blocks;

use WP_Syntex\Polylang\Blocks\Language_Switcher\Standard\Block as Standard_Block;
use WP_Syntex\Polylang\Blocks\Language_Switcher\Navigation\Block as Navigation_Block;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Don't access directly.
}

add_action(
	'pll_init',
	function ( $polylang ) {
		if ( $polylang->model->has_languages() ) {
			$polylang->switcher_block   = ( new Standard_Block( $polylang ) )->init();
			$polylang->navigation_block = ( new Navigation_Block( $polylang ) )->init();
		}
	}
);

```
