[showcase]
[showcase id="5"]
[url href="http://www.smashingmagazine.com"]Smashing Magazine[/url]
hello() {
return 'Hello, World!';
}
add_shortcode('hw', 'hello');
The first parameter is the name of the abbreviation, the second is the name of the function.
[hw]
add_shortcode("url", "myUrl");
function myUrl($atts, $content = null) {
extract(shortcode_atts(array(
"href" => 'http://'
), $atts));
return ''.$content.'';
}
[url href="http://ajaxed.ru"]Ajax - [/url]
function twitt() {
return '-';
}
add_shortcode('twitter', 'twitt');
[twitter]
function subscribeRss() {
return 'Enjoyed this post? Subscribe to my RSS feeds!';
}
add_shortcode('subscribe', 'subscribeRss');
.rss-box{
background:#F2F8F2;
border:2px #D5E9D5 solid;
font-weight:bold;
padding:10px;
}
function showads() {
return '
<script type="text/javascript"
src="http://127.0.0.1/images/ajaxed/http://pagead2.googlesyndication.com/pagead/show_ads.js">
';
Source: https://habr.com/ru/post/51027/