I’m trying to remove the shortcodes from a child theme.
In my functions.php file (for the child theme), I’ve put:
function my_remove_shortcode(){
return '';
}
add_shortcode('entry-twitter-link', 'my_remove_shortcode');
Where entry-twitter-link is a shortcode created in the parent. However, the entry still shows up on my posts. Ideas on what’s wrong?
Try this out. Remove the already added shortcode then add the new shortcode on the init hook.
Thanks to Joshua’s answer, and that’s life saving indeed. 🙂
BTW, I can propose a slightly different method. Suppose you have created a plugin and now you are going to release its pro version – so you have the full control over both the plugins, so you can follow something like this:
Actual Plugin:
Pro Plugin:
In this method, the name of the function should remain exact same.
You can do the same thing in your Parent theme and Child theme too.
But again, Joshua’s answer was great.