Rest API: Register and Login errors aren’t specific

The problem I was having is that I wasn’t receiving the full error object. To do that I changed the code to: const { username, password, email } = this.state; axios .post(`${Config.apiUrl}/wp/v2/users/register`, { username: username, password: password, email: email, }) .catch(err => { console.log({err}) }); Which then allowed me to figure out that the error … Read more

rest api add post meta

You’ll want to use the field and the post type. You’ll add the following to your functions.php add_action( ‘rest_api_init’, function () { register_rest_field( ‘<post-type>’, ‘folder_path’, array( ‘get_callback’ => function( $post_arr ) { return get_post_meta( $post_arr[‘id’], ‘folder_path’, true ); }, ) ); register_rest_field( ‘<post-type>’, ‘file_name’, array( ‘get_callback’ => function( $post_arr ) { return get_post_meta( $post_arr[‘id’], ‘file_name’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)