PluginProbe
Polylang / 3.2.8
Polylang v3.2.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / js / build / user.js

user.js in Polylang 3.2.8, at js/build/user.js

36 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var __webpack_exports__ = {};
2 /**
3 * Adds one biography input field per language in the user profile.
4 *
5 * @package Polylang
6 */
7
8 jQuery(
9 function( $ ) {
10 // biography
11 // FIXME there is probably a more efficient way to do this
12 var td = $( '#description' ).parent();
13 var d = $( '#description' ).clone();
14 var span = td.children( '.description' ).clone();
15 td.children().remove();
16
17 $( '.biography' ).each(
18 function(){
19 lang = $( this ).attr( 'name' ).split( '___' );
20 desc = d.clone();
21 desc.attr( 'name', 'description_' + lang[0] );
22 desc.attr( 'id', 'description_' + lang[0] );
23 // Whitelist because description and lang value is already escaped by the side of PHP
24 desc.html( $( this ).val() ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html
25 td.append( $( '<div></div>' ).text( lang[1] ) ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.append
26 td.append( desc ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.append
27 }
28 );
29
30 td.append( '<br />' );
31 // Whitelist because description come from html code generated by WordPress
32 td.append( span ); // phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.append
33 }
34 );
35
36