Skip to content

Commit

Permalink
Filter excluded types in qtranslate_admin_block_editor (#1210)
Browse files Browse the repository at this point in the history
By default, excluded post types are filtered out.
  • Loading branch information
EarthlingDavey authored Aug 7, 2022
1 parent f9556d5 commit cf1af2a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/qtx_admin_gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ public function rest_request_after_callbacks( $response, $handler, $request ) {
* Enqueue the JS script
*/
public function enqueue_block_editor_assets() {
// By default, excluded post types are filtered out.
global $q_config;
$post_type = qtranxf_post_type();
$post_type_excluded = isset( $q_config['post_type_excluded'] ) && isset( $post_type ) && in_array( $post_type, $q_config['post_type_excluded'] );

// Filter to allow qTranslate-XT to manage the block editor (single language mode)
$admin_block_editor = apply_filters( 'qtranslate_admin_block_editor', true );
$admin_block_editor = apply_filters( 'qtranslate_admin_block_editor', ! $post_type_excluded );
if ( ! $admin_block_editor ) {
return;
}
Expand Down

0 comments on commit cf1af2a

Please sign in to comment.