I have a WordPress plugin that uses a jQuery function to hide/show certain parts of the plugin.
if ($('#display_linkedin_icon').val() == 'true') {
$('#linkedin').show();
}
My issue is that in the WordPress Dashboard another plugin adds an element with the ID of #linkedin so when I activate the hiding of the div in my plugin it hides the other div in the WordPress Dashboard.
At this stage it is not an easy task to simply change the name of my ID’s.
I was wondering is there any way I can wrap the above jQuery function so that it will only activate on my plugin page.
I have the #linkedin div wrapped in an outer div called “asw-sortable“.
Was hoping something like this wold work.
if ($('#display_linkedin_icon').val() == 'true') {
$('#asw-sortable #linkedin').show();
}
Any help would be greatly appreciated.
That last thing you did should have worked. Did it work?
If not you should try to make your selector even more specific.