esc_url_raw( rest_url() ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'blockSettings' => get_option( 'advanced-block-settings' ), 'settingsURL' => admin_url( 'options-general.php?page=advanced-blocks#settings' ), 'countdownSrc' => plugins_url( 'src/assets/js/jquery.countdown.min.js', dirname( __FILE__ ) ), ) ); // Styles. wp_enqueue_style( 'advanced-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. ); wp_enqueue_script( 'advanced-fontawesome-json', plugins_url( 'dist/fa-icons-raw.js', dirname( __FILE__ ) ), array(), '5.2.0', true ); } // Hook: Editor assets. add_action( 'enqueue_block_editor_assets', 'advanced_block_progress_editor_assets' ); if ( !function_exists( 'advanced_block_category' ) ) { /** * Add our custom block category for Stackable blocks. * * @since 0.6 */ function advanced_block_category( $categories, $post ) { return array_merge( $categories, array( array( 'slug' => 'advanced-blocks', 'title' => __( 'advanced Blocks - Gutenberg Blocks', 'advanced-blocks' ), ) ) ); } add_filter( 'block_categories', 'advanced_block_category', 10, 2 ); } function advanced_frontend_assets() { wp_register_script( 'jquery-countdown', plugins_url( 'src/assets/js/jquery.countdown.min.js', dirname( __FILE__ ) ), array( 'jquery' ), '2.2.0', true ); if ( is_singular() ) { $post_id = get_the_ID(); $content = get_post_field( 'post_content', $post_id, 'display' ); preg_match( '~