$my_php_value ) );*/ // Scripts. wp_enqueue_script( 'algori_pdf_viewer-cgb-block-js', // Handle. plugins_url( '/dist/blocks.build.js', dirname( __FILE__ ) ), // Block.build.js: We register the block here. Built with Webpack. array( 'wp-blocks', 'wp-i18n', 'wp-element' ), // Dependencies, defined above. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.build.js' ), // Version: filemtime — Gets file modification time. true // Enqueue the script in the footer. ); // Localize path for Plugin Directory, so that I can acess it in JavaScript attached to 'algori_pdf_viewer-cgb-block-js' above. $algori_pdf_viewer_plugin_directory_path = plugins_url(); wp_localize_script( 'algori_pdf_viewer-cgb-block-js', 'algoriPDFViewerPluginDirectoryPath', $algori_pdf_viewer_plugin_directory_path ); // Styles. wp_enqueue_style( 'algori_pdf_viewer-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: filemtime — Gets file modification time. ); } // End function algori_pdf_viewer_cgb_editor_assets(). // Hook: Editor assets. add_action( 'enqueue_block_editor_assets', 'algori_pdf_viewer_cgb_editor_assets' );