elete_application_password( $user_id, $uuid ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as $key => $item ) { if ( $item['uuid'] === $uuid ) { unset( $passwords[ $key ] ); $saved = static::set_user_application_passwords( $user_id, $passwords ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not delete application password.' ) ); } /** * Fires when an application password is deleted. * * @since 5.6.0 * * @param int $user_id The user ID. * @param array $item The data about the application password. */ do_action( 'wp_delete_application_password', $user_id, $item ); return true; } } return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) ); } /** * Deletes all application passwords for the given user. * * @since 5.6.0 * * @param int $user_id User ID. * @return int|WP_Error The number of passwords that were deleted or a WP_Error on failure. */ public static function delete_all_application_passwords( $user_id ) { $passwords = static::get_user_application_passwords( $user_id ); if ( $passwords ) { $saved = static::set_user_application_passwords( $user_id, array() ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) ); } foreach ( $passwords as $item ) { /** This action is documented in wp-includes/class-wp-application-passwords.php */ do_action( 'wp_delete_application_password', $user_id, $item ); } return count( $passwords ); } return 0; } /** * Sets a users application passwords. * * @since 5.6.0 * * @param int $user_id User ID. * @param array $passwords Application passwords. * * @return bool */ protected static function set_user_application_passwords( $user_id, $passwords ) { return update_user_meta( $user_id, static::USERMETA_KEY_APPLICATION_PASSWORDS, $passwords ); } /** * Sanitizes and then splits a password into smaller chunks. * * @since 5.6.0 * * @param string $raw_password The raw application password. * @return string The chunked password. */ public static function chunk_password( $raw_password ) { $raw_password = preg_replace( '/[^a-z\d]/i', '', $raw_password ); return trim( chunk_split( $raw_password, 4, ' ' ) ); } } 1.0Partelechttp://partelec.frbellethttp://partelec.fr/actualite/author/bellet/Accueilrich600338<blockquote class="wp-embedded-content"><a href="http://partelec.fr/">Accueil</a></blockquote> <script type='text/javascript'> <!--//--><![CDATA[//><!-- /*! This file is auto-generated */ !function(d,l){"use strict";var e=!1,n=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,i,a,s=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=new RegExp("^https?:$","i"),c=0;c<n.length;c++)n[c].style.display="none";for(c=0;c<s.length;c++)if(r=s[c],e.source===r.contentWindow){if(r.removeAttribute("style"),"height"===t.message){if(1e3<(a=parseInt(t.value,10)))a=1e3;else if(~~a<200)a=200;r.height=a}if("link"===t.message)if(i=l.createElement("a"),a=l.createElement("a"),i.href=r.getAttribute("src"),a.href=t.value,o.test(a.protocol))if(a.host===i.host)if(l.activeElement===r)d.top.location.href=t.value}}},e)d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",t,!1),d.addEventListener("load",t,!1);function t(){if(!n){n=!0;for(var e,t,r=-1!==navigator.appVersion.indexOf("MSIE 10"),i=!!navigator.userAgent.match(/Trident.*rv:11\./),a=l.querySelectorAll("iframe.wp-embedded-content"),s=0;s<a.length;s++){if(!(e=a[s]).getAttribute("data-secret"))t=Math.random().toString(36).substr(2,10),e.src+="#?secret="+t,e.setAttribute("data-secret",t);if(r||i)(t=e.cloneNode(!0)).removeAttribute("security"),e.parentNode.replaceChild(t,e)}}}}(window,document); //--><!]]> </script><iframe sandbox="allow-scripts" security="restricted" src="http://partelec.fr/embed/" width="600" height="338" title="“Accueil” — Partelec" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe>