3, 'title' => __( 'Freight Calculator', 'acs-freight-calculator' ), 'category' => 'widgets', 'editor_script' => 'acsfc-block-editor', 'render_callback' => 'acsfc_block_render', 'attributes' => array( 'region' => array( 'type' => 'string', 'default' => '', ), 'vehicle' => array( 'type' => 'string', 'default' => '', ), ), ) ); } add_action( 'init', 'acsfc_register_block', 20 ); /** * Render the block on the front end. * * @param array $attributes Block attributes. * @return string Markup. */ function acsfc_block_render( $attributes ) { return acsfc_shortcode( array( 'region' => isset( $attributes['region'] ) ? $attributes['region'] : '', 'vehicle' => isset( $attributes['vehicle'] ) ? $attributes['vehicle'] : '', ) ); }