PluginProbe
Polylang / 2.7
Polylang v2.7
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 / user.js

user.js in Polylang 2.7, at js/user.js

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