__NAMESPACE__ . '\load_assets' ) ); } add_action( 'init', __NAMESPACE__ . '\register_block' ); /** * Goodreads block registration/dependency declaration. * * @param array $attr Array containing the Goodreads block attributes. * * @return string */ function load_assets( $attr ) { Jetpack_Gutenberg::load_assets_as_required( __DIR__ ); if ( isset( $attr['id'] ) ) { if ( isset( $attr['link'] ) ) { wp_enqueue_script( 'jetpack-goodreads-' . esc_attr( $attr['id'] ), esc_url_raw( $attr['link'] ), array(), JETPACK__VERSION, true ); } $id = esc_attr( $attr['id'] ); } else { $id = ''; } $classes = esc_attr( Blocks::classes( Blocks::get_block_feature( __DIR__ ), $attr ) ); return sprintf( '
', $id, $classes ); }