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 ); 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

© 2020 Jakob Helmer - Powered by WordPress - @trails&tribulations