| 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 |
|