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?
- How to declare a global variable in php?
- Undefined variable in functions.php file [closed]
- Mega Menu Walker
- How to add a class to the attachment images
- How to export/import theme customizer settings?
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- Why can I not use setup_postdata($post) in the sidebar?
- load/require specific php files for specific pages/templates/post types
- Drop down+sort blog posts date added/most popular
- Activate different theme for temporary preview
- Store loop into array
- Get WooCommerce shipping methods programmatically
- Add a custom text field to WooCommerce admin product data “Variations”
- Show Specific Footer Widget for Specific Pages
- How do I output a database option that is an array into a get_posts array?
- Why is it necessary to prevent direct access to included files?
- Run a Parallel PHP Application with WordPress
- Passing jQuery value using Ajax to a page template
- Change logo based on incoming domain
- Why can’t I use “%s” format value in the WordPress function checked?
- Password protecting content in custom template
- Creating login session via CURL
- WordPress vs. Custom PHP [closed]
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- How to make drop down post title
- how to delete 30 day old data using PHP [closed]
- Remove meta description on certain pages
- Image media upload metabox
- Is there CSS to expand the gallery limit on Index Pages?
- Hide categories that are not used in the post type
- esc_html_e() is not translating string in wordpress [closed]
- Limit 1 global comment per minute
- How can I add an area/option for a custom page description?
- Menu jumping when calling it via PHP
- Problem custom control Customizer
- Running code before object-cache.php runs
- If has $title in widgets
- get href content [closed]
- Illegal string offset in PHP function
- Displaying text if post was within 5 hours
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- How to say if meta_value is greater than 0 in an array?
- Adding a tag_ID column into Categories inside the admin dashboard?
- How to get category name or ID by post?
- ACF Repeater Pagination stopped working since upgrade to php7.2
- Using featured image of blog archive page
- Best Way to Change a String in a WordPress Post
- Highlight the links without using dropdown
- Show get_sub_field value if it exists [closed]
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- Dividing the loop to style post differently
- How to Display a List of Child Pages For a Parent Page in WordPress
- Why, when moving a WordPress multisite network, have my theme customisations stopped working?
- include content within conditional statement?
- How to change the author box selection on a post to a custom taxonomy
- How to send a php var to jQuery Ajax call with two different file
- User meta needed in query is serialized – how to unserialize safely?
- PHP calling AJAX function that relies on passed PHP function values not working
- Order by title Child Pages displayed in a Parent Page
- not outputting medium size image URL
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Intermittent problem can the debug log give any clues?
- Echo short code syntax
- WordPress recent post
- Show subcategory name selected in specific category woocoommerce
- Posts Per Page with a button to add more Posts
- How to get total gross revenue for current month in the woocommerce dashboard status widget
- Add custom attribute to product’s HTML to woocommerce cart page
- Change WooCommerce template for PDF – access to custom field
- Decoding an array in PHP (from the Shopify API) [closed]
- PHP is_embed error showing up
- How fix error in the WordPress loop?
- PHP Session Variable to WordPress Error
- Run code before WordPress loads and insert data into WP if need be
- Editing existing pre-created menus in PHP
- need help to arabic text in wordpress
- Sorting Meta Fields?
- Themes with variable width or single columns? I want to display source code
- Category List in Theme Options Page
- Showing all post from all post type in admin backstage
- Or operators in PHP [closed]
- upload images on front by user using form
- how to iterate through xml data?
- Adding slides to an existing carousel manually
- What does this if-statement do?: if($pages=’ ‘) {}
- Really slow WordPress site [closed]
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- understanding wp_next_scheduled
- WordPress 6.1.1 UTF8 Slug Limit Increase
- WordPress directories not writable after PHP version upgrade
- How do I unset category from a product in wordpress by code
- php 8 compability admin interface
- How can I make below code to show grouping by country ranks in same div, example if in second loop rank 2nd must be show in same 2nd class div
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end