Changeset 3760851 for ai-engine/trunk/classes/modules/workspace.php
- Timestamp:
- 10/23/2026 03:27:20 AM (13 days ago)
- File:
-
- 1 edited
-
ai-engine/trunk/classes/modules/workspace.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ai-engine/trunk/classes/modules/workspace.php
r3711046 r3760851 810 810 public const DOC_MOBILE_URL = 'https://meowapps.com/fix-mcp-wordpress-connection/#workspace-mobile'; 811 811 812 /** 813 * How many phones are paired with Workspace on this site, across every user. 814 * Application Passwords live in one serialized user meta row per user, so the 815 * LIKE narrows it to the users who have a Workspace device at all. 816 */ 817 public static function count_paired_devices() { 818 if ( !class_exists( 'WP_Application_Passwords' ) ) { 819 return 0; 820 } 821 global $wpdb; 822 $rows = $wpdb->get_col( $wpdb->prepare( 823 "SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key = %s AND meta_value LIKE %s", 824 WP_Application_Passwords::USERMETA_KEY_APPLICATION_PASSWORDS, 825 '%' . $wpdb->esc_like( self::PAIR_APP_PREFIX ) . '%' 826 ) ); 827 $count = 0; 828 foreach ( (array) $rows as $row ) { 829 foreach ( (array) maybe_unserialize( $row ) as $p ) { 830 if ( isset( $p['name'] ) && strpos( $p['name'], self::PAIR_APP_PREFIX ) === 0 ) { 831 $count++; 832 } 833 } 834 } 835 return $count; 836 } 837 812 838 private function pairing_available( $user = null ) { 813 839 if ( !class_exists( 'WP_Application_Passwords' ) || !function_exists( 'wp_is_application_passwords_available' ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)