Title: Error loading block: Invalid parameter(s): attributes
Last modified: July 2, 2020

---

# Error loading block: Invalid parameter(s): attributes

 *  Resolved [Natalya](https://wordpress.org/support/users/nalitana/)
 * (@nalitana)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/)
 * Hello! I can’t use the plugin due to an error:
    `Error loading block: Invalid
   parameter(s): attributes` Conflict with the Conditional Blocks plugin. I tried
   to apply this code, but the result remains the same:
 *     ```
       /**
        * Add the "Blocks CSS: CSS Editor for Gutenberg Blocks" plugin attributes to the Flex Posts attributes so the WordPress
        * REST API schema validates.
        *
        * @hooked flex_posts_attributes
   
        * @see https://wordpress.org/plugins/conditional-blocks/
        * @see flex_posts_register_block() block.php:31
        * @see register_block_type()
        *
        * @param  array    $attributes The validation schema as registered with register_block_type().
        * @return array    $attributes
        */
       add_filter( 'flex_posts_attributes', function( $attributes ) {
   
       	include_once ABSPATH . 'wp-admin/includes/plugin.php';
       	if( is_plugin_active( 'conditional-blocks/conditional-blocks.php' ) ) {
   
       		$attributes['hasCustomCSS'] = array(
       			'type'    => 'boolean',
       			'default' => false,
       		);
       		$attributes['customCSS']    = array(
       			'type'    => 'string',
       			'default' => '',
       		);
   
       	}
   
       	return $attributes;
       });
       ```
   
 * Please help!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [Natalya](https://wordpress.org/support/users/nalitana/)
 * (@nalitana)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/#post-13072600)
 * Hello! I have another question: how can I exclude a post by ID from the widget?
   Is there a function that I can apply to all widgets at once, because I use them
   on the main page?
 *  Plugin Author [Tajam](https://wordpress.org/support/users/tajam/)
 * (@tajam)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/#post-13080376)
 * Hi, the code you posted is only for a specific plugin. It’s not a solution for
   Conditional Blocks plugin. We will try the conditional blocks plugin and find
   the fix if it’s possible.
 *  Plugin Author [Tajam](https://wordpress.org/support/users/tajam/)
 * (@tajam)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/#post-13080378)
 * Sorry, currently there is no feature to exclude post ID.
 *  Plugin Author [Tajam](https://wordpress.org/support/users/tajam/)
 * (@tajam)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/#post-13099263)
 * Please use this code to fix the error message above:
 *     ```
       add_filter(
       	'flex_posts_attributes',
       	function( $attr ) {
       		$attr['conditionalBlocksAttributes']['type'] = 'object';
       		return $attr;
       	}
       );
       ```
   
 * You can add this code in your own plugin, or in functions.php file in your theme/
   child theme.
 *  Thread Starter [Natalya](https://wordpress.org/support/users/nalitana/)
 * (@nalitana)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/#post-13199126)
 * Hi! I’m sorry I didn’t answer right away. Your code solved the problem. Thank
   you very much for your help!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error loading block: Invalid parameter(s): attributes’ is closed to new
replies.

 * ![](https://ps.w.org/flex-posts/assets/icon-128x128.png?rev=1871802)
 * [Flex Posts - Widget and Gutenberg Block](https://wordpress.org/plugins/flex-posts/)
 * [Support Threads](https://wordpress.org/support/plugin/flex-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/flex-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flex-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flex-posts/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Natalya](https://wordpress.org/support/users/nalitana/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/error-loading-block-invalid-parameters-attributes-4/#post-13199126)
 * Status: resolved