| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * @package Polylang | |
| 4 | + */ | |
| 2 | 5 | |
| 3 | 6 | /** |
| 4 | 7 | * Manages filters and actions related to the classic editor |
| 5 | 8 | * |
| @@ -111,9 +114,13 @@ | ||
| 111 | 114 | do_action( 'pll_before_post_translations', $post_type ); |
| 112 | 115 | |
| 113 | 116 | echo '<div id="post-translations" class="translations">'; |
| 114 | 117 | if ( $lang ) { |
| 115 | - include PLL_ADMIN_INC . '/view-translations-' . ( 'attachment' == $post_type ? 'media' : 'post' ) . '.php'; | |
| 118 | + if ( 'attachment' === $post_type ) { | |
| 119 | + include __DIR__ . '/view-translations-media.php'; | |
| 120 | + } else { | |
| 121 | + include __DIR__ . '/view-translations-post.php'; | |
| 122 | + } | |
| 116 | 123 | } |
| 117 | 124 | echo '</div>' . "\n"; |
| 118 | 125 | } |
| 119 | 126 | |
| @@ -151,9 +158,13 @@ | ||
| 151 | 158 | $this->model->post->save_translations( $post_ID, $translations ); |
| 152 | 159 | |
| 153 | 160 | ob_start(); |
| 154 | 161 | if ( $lang ) { |
| 155 | - include PLL_ADMIN_INC . '/view-translations-' . ( 'attachment' == $post_type ? 'media' : 'post' ) . '.php'; | |
| 162 | + if ( 'attachment' === $post_type ) { | |
| 163 | + include __DIR__ . '/view-translations-media.php'; | |
| 164 | + } else { | |
| 165 | + include __DIR__ . '/view-translations-post.php'; | |
| 166 | + } | |
| 156 | 167 | } |
| 157 | 168 | $x = new WP_Ajax_Response( array( 'what' => 'translations', 'data' => ob_get_contents() ) ); |
| 158 | 169 | ob_end_clean(); |
| 159 | 170 | |