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:
Scott Taylor 2015-06-16 20:20:26 +00:00
parent 45d5037a10
commit 6148f3cd41
3 changed files with 13 additions and 10 deletions

View File

@ -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() {
if ( wpLink.isMCE() ) {
wpLink.mceUpdate();
@ -290,14 +300,7 @@ var wpLink;
return;
}
// Build HTML
html = '<a href="' + attrs.href + '"';
if ( attrs.target ) {
html += ' target="' + attrs.target + '"';
}
html += '>';
html = wpLink.buildHtml(attrs);
// Insert HTML
if ( document.selection && wpLink.range ) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @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.