PluginProbe
Polylang / trunk
Polylang vtrunk
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / src / integrations / twenty-seventeen / twenty-seven-teen.php

twenty-seven-teen.php in Polylang trunk, at src/integrations/twenty-seventeen/twenty-seven-teen.php

31 lines 838 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 */
5
6 /**
7 * Manages the compatibility with Twenty_Seventeen.
8 *
9 * @since 2.8
10 */
11 class PLL_Twenty_Seventeen {
12 /**
13 * Translates the front page panels and the header video.
14 *
15 * @since 2.0.10
16 */
17 public function init() {
18 if ( 'twentyseventeen' === get_template() && did_action( 'pll_init' ) ) {
19 if ( function_exists( 'twentyseventeen_panel_count' ) && PLL() instanceof PLL_Frontend ) {
20 $num_sections = twentyseventeen_panel_count();
21 for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) {
22 add_filter( 'theme_mod_panel_' . $i, 'pll_get_post' );
23 }
24 }
25
26 $theme_slug = get_option( 'stylesheet' ); // In case we are using a child theme.
27 new PLL_Translate_Option( "theme_mods_$theme_slug", array( 'external_header_video' => 1 ), array( 'context' => 'Twenty Seventeen' ) );
28 }
29 }
30 }
31