diff --git a/CHANGELOG.md b/CHANGELOG.md index 598493dc..6e6cc8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Demo: Prevent spaces in theme-info link * Fix newtheme-popos.sh script location detection +* Check if pll_translatable is set ### 9.4.5: 2024-10-25 diff --git a/inc/includes/post-type.php b/inc/includes/post-type.php index 6b99e8de..3b269138 100644 --- a/inc/includes/post-type.php +++ b/inc/includes/post-type.php @@ -59,7 +59,7 @@ abstract protected function register(); */ public function register_wp_post_type( $slug, $args ) { // Register PolyLang translatable only if it's private - if ( $args['pll_translatable'] && false === $args['public'] ) { + if ( isset( $args['pll_translatable'] ) && $args['pll_translatable'] && false === $args['public'] ) { add_filter( 'pll_get_post_types', function( $cpts ) use ( $slug ) { $cpts[ $slug ] = $slug;