Getting WP to prompt you for the “title” of link
-
This modification allows my wordpress to prompt me for the title attribute when I use the quicktags in the post page to add a link.
Here is what I have in my wp-admin/quicktags.js file, closer to the bottom:function edInsertLink(myField, i, defaultValue) {
if (!defaultValue) {
defaultValue = 'https://';
}
if (!edCheckOpenTags(i)) {
var URL = prompt('Enter the URL' ,defaultValue);
if (URL) {
edButtons[i].tagStart = '< a href=""'<br" />
+ URL
+ '" title="' + prompt('Enter a title for the link', '')
+ '">';
edInsertTag(myField, i);
}
}
else {
edInsertTag(myField, i);
}
}This function replaces the existent edInsertLink(); function in the quicktags.js file
- The topic ‘Getting WP to prompt you for the “title” of link’ is closed to new replies.