function set_breadcrumbs() { \register_rest_route( 'genesis/v1', '/breadcrumbs', [ 'methods' => 'PUT', 'callback' => function( $request ) { $types = $request->get_json_params(); $genesis_options = get_option( GENESIS_SETTINGS_FIELD ); foreach ( $types as $type => $value ) { // Prevent updates of non-breadcrumb options via this endpoint. if ( strpos( $type, 'breadcrumb_' ) !== 0 ) { continue; } $genesis_options[ $type ] = $value; } update_option( GENESIS_SETTINGS_FIELD, $genesis_options ); return \genesis_breadcrumb_options_enabled(); }, 'permission_callback' => function() { return current_user_can( 'edit_theme_options' ); }, ] ); }