| 1 |
<?php |
| 2 |
/** |
| 3 |
* Load API functions, register scripts and actions, etc. |
| 4 |
* |
| 5 |
* @package gutenberg |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
die( 'Silence is golden.' ); |
| 10 |
} |
| 11 |
|
| 12 |
// These files only need to be loaded if within a rest server instance |
| 13 |
// which this class will exist if that is the case. |
| 14 |
if ( class_exists( 'WP_REST_Controller' ) ) { |
| 15 |
require dirname( __FILE__ ) . '/rest-api.php'; |
| 16 |
} |
| 17 |
|
| 18 |
require dirname( __FILE__ ) . '/client-assets.php'; |
| 19 |
require dirname( __FILE__ ) . '/i18n.php'; |
| 20 |
require dirname( __FILE__ ) . '/register.php'; |
| 21 |
require dirname( __FILE__ ) . '/demo.php'; |
| 22 |
require dirname( __FILE__ ) . '/widgets-page.php'; |
| 23 |
|
| 24 |
// Register server-side code for individual blocks. |
| 25 |
if ( ! function_exists( 'render_block_core_archives' ) ) { |
| 26 |
require dirname( __FILE__ ) . '/../packages/block-library/src/archives/index.php'; |
| 27 |
} |
| 28 |
if ( ! function_exists( 'render_block_core_block' ) ) { |
| 29 |
require dirname( __FILE__ ) . '/../packages/block-library/src/block/index.php'; |
| 30 |
} |
| 31 |
if ( ! function_exists( 'render_block_core_categories' ) ) { |
| 32 |
require dirname( __FILE__ ) . '/../packages/block-library/src/categories/index.php'; |
| 33 |
} |
| 34 |
// Currently merged in core as `gutenberg_render_block_core_latest_comments`, |
| 35 |
// expected to change soon. |
| 36 |
if ( ! function_exists( 'render_block_core_calendar' ) ) { |
| 37 |
require dirname( __FILE__ ) . '/../packages/block-library/src/calendar/index.php'; |
| 38 |
} |
| 39 |
if ( ! function_exists( 'render_block_core_latest_comments' ) |
| 40 |
&& ! function_exists( 'gutenberg_render_block_core_latest_comments' ) ) { |
| 41 |
require dirname( __FILE__ ) . '/../packages/block-library/src/latest-comments/index.php'; |
| 42 |
} |
| 43 |
if ( ! function_exists( 'render_block_core_latest_posts' ) ) { |
| 44 |
require dirname( __FILE__ ) . '/../packages/block-library/src/latest-posts/index.php'; |
| 45 |
} |
| 46 |
if ( ! function_exists( 'render_block_core_rss' ) ) { |
| 47 |
require dirname( __FILE__ ) . '/../packages/block-library/src/rss/index.php'; |
| 48 |
} |
| 49 |
if ( ! function_exists( 'render_block_core_shortcode' ) ) { |
| 50 |
require dirname( __FILE__ ) . '/../packages/block-library/src/shortcode/index.php'; |
| 51 |
} |
| 52 |
if ( ! function_exists( 'render_block_core_tag_cloud' ) ) { |
| 53 |
require dirname( __FILE__ ) . '/../packages/block-library/src/tag-cloud/index.php'; |
| 54 |
} |
| 55 |
if ( ! function_exists( 'render_block_core_search' ) ) { |
| 56 |
require dirname( __FILE__ ) . '/../packages/block-library/src/search/index.php'; |
| 57 |
} |
| 58 |
|