Add a class method to `wpLink`, `buildHtml()`. This will allows devs to duck-punch the implementation.
Props martinsachse. Fixes #32180. Built from https://develop.svn.wordpress.org/trunk@32802 git-svn-id: http://core.svn.wordpress.org/trunk@32773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
45d5037a10
commit
6148f3cd41
|
@ -266,6 +266,16 @@ var wpLink;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
buildHtml: function(attrs) {
|
||||||
|
var html = '<a href="' + attrs.href + '"';
|
||||||
|
|
||||||
|
if ( attrs.target ) {
|
||||||
|
html += ' target="' + attrs.target + '"';
|
||||||
|
}
|
||||||
|
|
||||||
|
return html + '>';
|
||||||
|
},
|
||||||
|
|
||||||
update: function() {
|
update: function() {
|
||||||
if ( wpLink.isMCE() ) {
|
if ( wpLink.isMCE() ) {
|
||||||
wpLink.mceUpdate();
|
wpLink.mceUpdate();
|
||||||
|
@ -290,14 +300,7 @@ var wpLink;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build HTML
|
html = wpLink.buildHtml(attrs);
|
||||||
html = '<a href="' + attrs.href + '"';
|
|
||||||
|
|
||||||
if ( attrs.target ) {
|
|
||||||
html += ' target="' + attrs.target + '"';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '>';
|
|
||||||
|
|
||||||
// Insert HTML
|
// Insert HTML
|
||||||
if ( document.selection && wpLink.range ) {
|
if ( document.selection && wpLink.range ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.3-alpha-32801';
|
$wp_version = '4.3-alpha-32802';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue