$form_data ) { $title = ! empty( $form_data['title'] ) ? $form_data['title'] : __( '(untitled)', 'contact-forms' ); $form_list[] = array( 'text' => $title, 'value' => (string) $fid, ); } usort( $form_list, function( $a, $b ) { return (int) $b['value'] - (int) $a['value']; } ); wp_add_inline_script( 'contact-forms-block-editor', 'var accua_forms_block_data = ' . wp_json_encode( array( 'forms' => $form_list ) ) . ';', 'before' ); register_block_type( plugin_dir_path( ACCUA_FORMS_FILE ) . 'block-editor' ); } add_action( 'init', 'accua_forms_register_block' );