Apparently the above code seems to work now. Had to do with a cache? Or maybe the code does not work when you try to connect with an earlier Application Password (a password that was generated before the code was added).
EDIT: For anyone also using the Woocommerce app on the mobile.
The above function will not work, once authenticated. This means it is not possible to obtain the stats with the function above. You can use this function to check the user by ID. This works, if you only want to allow the admin to use Application Passwords and your user ID is 1:
function my_prefix_customize_app_password_availability(
$available,
$user
) {
if ( $user !== 1 ) {
$available = false;
}
return $available;
}
add_filter(
'wp_is_application_passwords_available_for_user',
'my_prefix_customize_app_password_availability',
10,
2
);
Related Posts:
- Frontend in WP , backend in Laravel. Some level of integration needed
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- Application password header not checked in REST API
- How to add product in woocommerce with php code [closed]
- What’s the best way to use the Featured Image for responsive web design?
- Uploading media with the REST API
- How to correctly submit a search form and display the result in an independent page
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Creating custom Woocommerce attribute taxonomies from a plugin
- What is the most efficient way to search users by their display name?
- Passing JSON data from WP Query into AJAX causing NULL errors
- How to redirect users to custom lostpassword page?
- Get used terms by an author as array of strings
- Can I write ‘RewriteCond’ using ‘functions.php’?
- Multiple do_shortcode($content) within one shortcode
- Index showing source code
- Overriding a theme redux file in child theme
- Validate a users email address when using gmail to register
- Advanced Custom Fields Image Field returning ID instead of URL [closed]
- selected menu item
- How to show only a certain part of the entry title?
- Programmatically add and remove woocommerce product category
- allow subscribers to see private posts without plug in
- How to securely provide a $_POST var in WP_Query with PHP 7?
- If Query In Sidebar
- Unreadable pagination
- Is there any risk setting WordPress file permissions and FS method to ‘direct’ on localhost?
- remove wp floating submenu in wp dashboard
- Add a product to checkout via form
- My page.php shows the index.php
- Posting and image insertion problems after EasyApache4 and PHP 7 upgrade
- Remove from shortcode
- Login to wordpress by clicking a link and specifying usernaname and password in url
- WordPress SQL injection
- How to change menu labels
- How to get all author posts outside of author templates
- How to obtain the current website URL in my theme?
- Function returns text instead of html [closed]
- How can I display a div ONLY if it is not a certain term page
- Next post link on a bootstrap button
- Echo title attribute php
- Is it possible to display a DIV to not logged in users and then change it for users who are logged in?
- how to serialize() mysql update data
- Get a value inside a get_post_meta Array
- admin-ajax GET response bad request
- Using rules in Posts
- How to make a cookie be on the whole site instead of being on a specific page/
- php – Plugin/theme relative PATH/URI
- Save the value of a wp_dropdown_pages
- Search only working on front page (index) , not working on other pages
- Live search from database table
- wpdb getting avatars and author url
- Dynamically generating an ” reference with PHP
- How to create Loop code for Menu using WordPress?
- Display custom field value in woocommerce variable product via jQurey
- Tag title not being returned in page title of tag archives
- Allow a user or role to view drafts and previews, but not other admin privileges?
- get orders of today’s date
- foreach not returning expected results
- Preventing direct access to a page in WordPress
- How to use data URL in WordPress?
- Load WordPress core but with specific plugins
- Change user metadata on registration (show_admin_bar_front = false)
- How to insert multiple rows and columns in database using array
- I am facing error in the wordpress single page php coding
- How to output values from a loop into a javascript array
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- Cron not sending wp-mail()
- How do I wrap this?
- Adding body class to html tag that already has language attrubutes?
- Admin backend, show post from a category and exclude the posts from subcategories
- Notice: Undefined index: post_title error
- How to send Ajax Call from frontend without using wp_localize_script in Theme
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- Load admin bar without wp_head or wp_footer [duplicate]
- How can get all users by current user meta (array)?
- Latest Post Thumbnail Alt Text Missing
- Add Alt attribute to image served with php
- All content deleted when WP was reinstalled in another machine
- Relationship between custom post type and page/single templates
- str_replace not responding in functions.php [closed]
- Force string into signup form
- PHP Warning missing Argument 1 for __()
- Error in php code
- How can i give a download link to the thumbnail or featured image
- Log in and Register link should disappear after a user log in successfully into the dashboard page
- Display all categories (with link) of custom post type – WordPress
- Modify meta data before saving to database
- Add a custom user meta data on registration based on user email
- Error resetting database index using ALTER TABLE in $wpdb->query
- 500 Internal Server Error PHP 8.1 Array with wordpress
- why css file not link?how to create permalink?
- How to add different menu items on different menus?
- Nav menù doesn’t display selected pages
- To perform the requested action, WordPress needs to access your web server
- Modify the permalink structure for a specific category
- WooCommerce / Elementor change Add To Cart button text and link for variable products
- How to insert crm php code in wordpress?
- Display posts in correct month order using single date custom field