Making WordPress.org


Ignore:
Timestamp:
07/03/2024 10:55:23 PM (22 months ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@e0208b2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/blocks.php

    r13754 r13873  
    2626add_action( 'init', __NAMESPACE__ . '\register_types' );
    2727add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\enqueue_block_style_assets' );
    28 add_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\enqueue_course_grid_assets' );
    2928add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_block_style_assets' );
    3029
     
    451450
    452451/**
    453  * Enqueue course grid assets.
    454  *
    455  * @throws Error If the build files are not found.
    456  */
    457 function enqueue_course_grid_assets() {
    458     $script_asset_path = get_build_path() . 'course-grid.asset.php';
    459     if ( ! is_readable( $script_asset_path ) ) {
    460         throw new Error(
    461             'You need to run `npm start` or `npm run build` for the "wporg-learn/course-grid" block first.'
    462         );
    463     }
    464 
    465     $script_asset = require $script_asset_path;
    466     wp_enqueue_script(
    467         'wporg-learn-course-grid',
    468         get_build_url() . 'course-grid.js',
    469         $script_asset['dependencies'],
    470         $script_asset['version'],
    471         true
    472     );
    473 }
    474 
    475 /**
    476452 * Register the learning duration block.
    477453 */
Note: See TracChangeset for help on using the changeset viewer.