= 0 ) { add_filter( 'wp_check_filetype_and_ext', [$this, 'wpCheckFiletypeAndExt'], 10, 5 ); } else { add_filter( 'wp_check_filetype_and_ext', [$this, 'wpCheckFiletypeAndExt'], 10, 4 ); } } function enqueueBlockAssets(){ echo wp_get_script_tag( [ 'src' => TDVB_ASSETS_DIR . 'js/model-viewer.min.js', 'type' => 'module', ] ); } function onInit() { wp_register_style( 'tdvb-td-viewer-editor-style', plugins_url( 'dist/editor.css', __FILE__ ), [ 'wp-edit-blocks' ], TDVB_PLUGIN_VERSION ); // Backend Style wp_register_style( 'tdvb-td-viewer-style', plugins_url( 'dist/style.css', __FILE__ ), [ 'wp-editor' ], TDVB_PLUGIN_VERSION ); // Both Style register_block_type( __DIR__, [ 'editor_style' => 'tdvb-td-viewer-editor-style', 'style' => 'tdvb-td-viewer-style', 'render_callback' => [$this, 'render'], ] ); // Register Block wp_set_script_translations( 'tdvb_editor_script', '3d-viewer-block', plugin_dir_path( __FILE__ ) . 'languages' ); // Translate } function render( $attributes ){ extract( $attributes ); ob_start(); ?>