Skip to content

Commit

Permalink
Enable Live Schedule and Live Post blocks (#305)
Browse files Browse the repository at this point in the history
This removes the site filter on Live Schedule & the live Latest Posts block, so these features are available to all sites.
  • Loading branch information
ryelle authored Jan 7, 2020
1 parent 711e3c0 commit 4210e51
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions public_html/wp-content/mu-plugins/blocks/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,10 @@ function load_includes() {
require_once $blocks_dir . 'sessions/controller.php';
require_once $blocks_dir . 'speakers/controller.php';
require_once $blocks_dir . 'sponsors/controller.php';
require_once $blocks_dir . 'live-schedule/controller.php';

$blocks_test_sites = array(
928, // 2017.testing
1190, // 2019.dublin
1028, // 2019.us
1134, // 2019.stuttgart
);

if (
( defined( 'WORDCAMP_ENVIRONMENT' ) && 'production' !== WORDCAMP_ENVIRONMENT )
|| in_array( get_current_blog_id(), $blocks_test_sites, true )
) {
require_once $blocks_dir . 'live-schedule/controller.php';

// Hooks.
require_once $hooks_dir . 'latest-posts/controller.php';
}

// Hooks.
require_once $hooks_dir . 'latest-posts/controller.php';
}

add_action( 'plugins_loaded', __NAMESPACE__ . '\load_includes' );
Expand Down Expand Up @@ -95,7 +81,7 @@ function register_assets() {
wp_register_style(
'wordcamp-blocks',
PLUGIN_URL . 'build/blocks.min.css',
[],
array(),
filemtime( PLUGIN_DIR . 'build/blocks.min.css' )
);

Expand All @@ -112,7 +98,7 @@ function register_assets() {
*
* @param array $data Associative multidimensional array of data.
*/
$data = apply_filters( 'wordcamp_blocks_script_data', [] );
$data = apply_filters( 'wordcamp_blocks_script_data', array() );

wp_add_inline_script(
'wordcamp-blocks',
Expand Down

0 comments on commit 4210e51

Please sign in to comment.