| @@ -109,8 +109,13 @@ | ||
| 109 | 109 | if ( ( 'Divi' === get_template() || defined( 'ET_BUILDER_PLUGIN_VERSION' ) ) && class_exists( 'PLL_Divi_Builder' ) ) { |
| 110 | 110 | $this->divi_builder = new PLL_Divi_Builder(); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | + // Admin Columns & Admin Columns Pro | |
| 114 | + if ( ( defined( 'AC_FILE' ) || defined( 'ACP_FILE' ) ) && class_exists( 'PLL_CPAC' ) ) { | |
| 115 | + add_action( 'admin_init', array( $this->cpac = new PLL_CPAC(), 'init' ) ); | |
| 116 | + } | |
| 117 | + | |
| 113 | 118 | // WP Offload Media Lite |
| 114 | 119 | if ( function_exists( 'as3cf_init' ) && class_exists( 'PLL_AS3CF' ) ) { |
| 115 | 120 | add_action( 'pll_init', array( $this->as3cf = new PLL_AS3CF(), 'init' ) ); |
| 116 | 121 | } |
| @@ -127,16 +132,12 @@ | ||
| 127 | 132 | * @since 2.3.8 |
| 128 | 133 | */ |
| 129 | 134 | public function after_setup_theme() { |
| 130 | 135 | // Advanced Custom Fields Pro |
| 131 | - if ( defined( 'ACF_VERSION' ) && version_compare( ACF_VERSION, '5.7.11', '>=' ) && class_exists( 'PLL_ACF' ) ) { | |
| 136 | + // The function acf_get_value() is not defined in ACF 4 | |
| 137 | + if ( class_exists( 'acf' ) && function_exists( 'acf_get_value' ) && class_exists( 'PLL_ACF' ) ) { | |
| 132 | 138 | add_action( 'init', array( $this->acf = new PLL_ACF(), 'init' ) ); |
| 133 | 139 | } |
| 134 | - | |
| 135 | - // Admin Columns & Admin Columns Pro | |
| 136 | - if ( did_action( 'pll_init' ) && ( defined( 'AC_FILE' ) || defined( 'ACP_FILE' ) ) && class_exists( 'PLL_CPAC' ) ) { | |
| 137 | - add_action( 'admin_init', array( $this->cpac = new PLL_CPAC(), 'init' ) ); | |
| 138 | - } | |
| 139 | 140 | } |
| 140 | 141 | |
| 141 | 142 | /** |
| 142 | 143 | * WordPress Importer |
| @@ -265,20 +266,12 @@ | ||
| 265 | 266 | * |
| 266 | 267 | * @since 2.0.10 |
| 267 | 268 | */ |
| 268 | 269 | public function twenty_seventeen_init() { |
| 269 | - if ( 'twentyseventeen' === get_template() && did_action( 'pll_init' ) ) { | |
| 270 | - if ( function_exists( 'twentyseventeen_panel_count' ) && PLL() instanceof PLL_Frontend ) { | |
| 271 | - $num_sections = twentyseventeen_panel_count(); | |
| 272 | - for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { | |
| 273 | - add_filter( 'theme_mod_panel_' . $i, 'pll_get_post' ); | |
| 274 | - } | |
| 275 | - } | |
| 276 | - | |
| 277 | - if ( PLL() instanceof PLL_Frontend ) { | |
| 278 | - add_filter( 'theme_mod_external_header_video', 'pll__' ); | |
| 279 | - } else { | |
| 280 | - pll_register_string( __( 'Header video', 'polylang' ), get_theme_mod( 'external_header_video' ), 'Twenty Seventeen', false ); | |
| 270 | + if ( 'twentyseventeen' === get_template() && function_exists( 'twentyseventeen_panel_count' ) && did_action( 'pll_init' ) && PLL() instanceof PLL_Frontend ) { | |
| 271 | + $num_sections = twentyseventeen_panel_count(); | |
| 272 | + for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { | |
| 273 | + add_filter( 'theme_mod_panel_' . $i, 'pll_get_post' ); | |
| 281 | 274 | } |
| 282 | 275 | } |
| 283 | 276 | } |
| 284 | 277 | |