Last active
October 4, 2017 11:37
-
-
Save SanjeevMohindra/b63cb46cb83aa47bd115caa011d67e42 to your computer and use it in GitHub Desktop.
Replace existing shortcakes with a new shortcode
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
<?php | |
/** | |
* Remove ShortCode Plugin | |
* | |
* This function will remove the shortcode from getting diplayed while keep displaying the content. | |
* Add this to your function.php | |
* | |
* @author MetaBlogue | |
* @license GPL-2.0+ | |
* @link https://metablogue.com/wordpress-remove-shortcode-plugin/ | |
*/ | |
// Sample Shortcode to replace it with a new shortcode | |
function mb_test_shortcode_content( $atts, $content = NULL ) { | |
extract(shortcode_atts(array( | |
'arg1' => '', | |
'arg2' => '' | |
),$atts)); | |
////If the attributes are not same, you may need to format the attributes in below function call | |
return do_shortcode('[test2 arg1="' .$arg1 .'"]'); | |
} | |
add_shortcode('test1', 'mb_test_shortcode_content'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment