Store large dataset in WordPress installation temporary

Transient names are limited to 172 characters; the data held in a transient can be much, much larger. set_transient() documentation Under the hood, transients are stored in the same table as options, and some WordPress code manages their lifetimes and expiry. You should easily be able to store 1MB of data in a transient. Autoloading … Read more

Create custom API endpoint to change custom header image

The header image falls under what WordPress calls theme modification values. To update that type of value, use the function set_theme_mod() function cs_set_logo($request) { set_theme_mod(‘header_image’, $request->get_param(‘new_header_image’)); return new WP_REST_Response(null, 200); } add_action(‘rest_api_init’, function() { register_rest_route(‘cs/v1’, ‘changelogo’, [ ‘methods’ => ‘POST’, ‘callback’ => ‘cs_set_logo’ ]) });