select any user to be credited as author (Gutenberg Rest-Api)

/******************************************************
 * Lets you select any user to be credited as author.
 * this filter works with the Gutenberg Rest-Api
 ******************************************************/

    // define the rest_user_query callback 
    function filter_rest_user_query( $prepared_args, $request ) { 
        $prepared_args['who'] = '';
        return $prepared_args; 
    }; 
             
    // add the filter 
    add_filter( 'rest_user_query', 'filter_rest_user_query', 10, 2 ); 

Author: Jakob

Wordpress & bicycle enthusiast

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *