-
-
Save anevins12/ab82afe8db9992dff70a to your computer and use it in GitHub Desktop.
Forum & BBadmin show hidden links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Forum thread | |
if ($('#wordpress-org').length !== 0) { | |
if ($('#thread').length !== 0) { | |
var posts = $('.threadpost .post'); | |
showHiddenLinks(posts); | |
} | |
} | |
// BBadmin | |
if ($('.bb-admin').length !== 0) { | |
var posts = $('.post p:first-child'); | |
showHiddenLinks(posts); | |
} | |
function showHiddenLinks(posts) { | |
var style = 'border: 2px solid gold; display: inline-block; padding: 5px; margin-top: 5px;'; | |
posts.each(function() { | |
post = $(this); | |
links = post.find('a'); | |
links.each(function() { | |
var link = $(this); | |
if (link.text() == '') { | |
// Get the HTML of the link | |
link.text(link[0].outerHTML); | |
// Output it on the page | |
post.append('<pre style="' + style +'">' + link.html() + '</pre>'); | |
// Hide the original link | |
link.hide(); | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment