| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * Manages filters and actions related to the block editor |
| 8 | 5 | * |
| @@ -8,21 +5,11 @@ | ||
| 8 | 5 | * |
| 9 | 6 | * @since 2.5 |
| 10 | 7 | */ |
| 11 | 8 | class PLL_Admin_Block_Editor { |
| 12 | - /** | |
| 13 | - * @var PLL_Model | |
| 14 | - */ | |
| 15 | - protected $model; | |
| 9 | + public $model; | |
| 16 | 10 | |
| 17 | 11 | /** |
| 18 | - * Preferred language to assign to a new post. | |
| 19 | - * | |
| 20 | - * @var PLL_Language | |
| 21 | - */ | |
| 22 | - protected $pref_lang; | |
| 23 | - | |
| 24 | - /** | |
| 25 | 12 | * Constructor: setups filters and actions |
| 26 | 13 | * |
| 27 | 14 | * @since 2.5 |
| 28 | 15 | * |
| @@ -35,17 +22,17 @@ | ||
| 35 | 22 | add_filter( 'block_editor_preload_paths', array( $this, 'preload_paths' ), 10, 2 ); |
| 36 | 23 | } |
| 37 | 24 | |
| 38 | 25 | /** |
| 39 | - * Filters the preload REST requests by the current language of the post. | |
| 40 | - * Necessary otherwise subsequent REST requests, all filtered by the language, | |
| 41 | - * would not hit the preloaded requests. | |
| 26 | + * Filter the preload REST requests by the current language of the post | |
| 27 | + * Necessary otherwise subsequent REST requests all filtered by the language | |
| 28 | + * would not hit the preloaded requests | |
| 42 | 29 | * |
| 43 | 30 | * @since 2.5 |
| 44 | 31 | * |
| 45 | - * @param (string|string[])[] $preload_paths Array of paths to preload. | |
| 46 | - * @param WP_Post $post The post resource data. | |
| 47 | - * @return (string|string[])[] | |
| 32 | + * @param array $preload_paths Array of paths to preload. | |
| 33 | + * @param object $post The post resource data. | |
| 34 | + * @return array | |
| 48 | 35 | */ |
| 49 | 36 | public function preload_paths( $preload_paths, $post ) { |
| 50 | 37 | if ( $this->model->is_translated_post_type( $post->post_type ) ) { |
| 51 | 38 | $lang = $this->model->post->get_language( $post->ID ); |