Application passwords not working on localhost?

That error could happen if wp_is_application_passwords_available() returns a false, and the docs says: By default, Application Passwords is available to all sites using SSL or to local environments. Use ‘wp_is_application_passwords_available’ to adjust its availability. So, to enable the Application Passwords: Enable SSL on your localhost, Or define WP_ENVIRONMENT_TYPE either as a global system variable or … Read more

403 Forbidden with gutenberg

In case anybody comes across this, I had the following in my apache config <Directory “/home/*/Sites”> AllowOverride All FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Require method GET POST OPTIONS </Directory> The WP API was trying to use the method PUT. I also believe it sometimes uses the method DELETE. Changing above code … Read more

Custom Post Type and API REST is not working

Put this code in function.php add_action( ‘init’, ‘my_customer_cpt’ ); function my_customer_cpt() { $labels = array( ‘name’ => _x( ‘Customers’, ‘post type general name’, ‘your-plugin-textdomain’ ), ‘singular_name’ => _x( ‘Customer’, ‘post type singular name’, ‘your-plugin-textdomain’ ), ‘menu_name’ => _x( ‘Customers’, ‘admin menu’, ‘your-plugin-textdomain’ ), ‘name_admin_bar’ => _x( ‘Customer’, ‘add new on admin bar’, ‘your-plugin-textdomain’ ), ‘add_new’ … Read more

How to generate HMAC-SHA1 signature to use with WP REST API and OAuth1

I have same problem but for auto generate time and nonce you can do this: <?php $nonce = md5(mt_rand()); // Set headers curl_setopt($ch, CURLOPT_HTTPHEADER, [‘ Authorization: OAuth oauth_consumer_key=”zfksKSt8m7Bk”, oauth_nonce=”.$nonce.”, oauth_signature=”%2BOy0fDsKilNymYOOZRqjJN5q3tg%3D”, oauth_signature_method=”HMAC-SHA1″, oauth_timestamp=’.time().’, oauth_token=”IG6x6jIjboVhmyzFtjzn1fGT”, oauth_version=”1.0″ ‘, ‘Content-Type: application/json; charset=utf-8′, ] ); I’m study for generate signature. I think It Can Be Useful To generate the signature … Read more

WP API ignores filter parameter

WP API will ignore filter values it doesn’t understand, so the following are essentially identical: curl -gv “myamazingsite.co.uk/wp-json/wp/v2/media/?filter[id]=123” curl -gv “myamazingsite.co.uk/wp-json/wp/v2/media/” Any filter keys that are valid, however, will be used to filter the results, so if there are no images for the year 2015, the following will return nothing ([]). curl -gv “myamazingsite.co.uk/wp-json/wp/v2/media/?filter[year]=2015” I’m … Read more

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