A few of my snippets:
uploads_url (Sortcode, PHP code)
$upload_dir = (array) wp_upload_dir();
if ( isset($upload_dir['baseurl']) && !empty($upload_dir['baseurl']) )
echo $upload_dir['baseurl']; }
else
// your fallback
home_url (Sortcode, PHP code, vars: path,scheme)
echo home_url("{path}", "{scheme}");
…imagine what you can do 😉
F.e: you can make a snippet for bloginfo
(untested):
bloginfo (Sortcode, PHP code, vars: key)
echo bloginfo("{key}");
or
bloginfo (Sortcode, PHP code, vars: key,echo)
if ( "" !== "{echo}" )
echo get_bloginfo("{key}");
else
get_bloginfo("{key}");
I use a lot: antispambot, permalink, google maps, Wikipedia, Google links…
Great plugin 😉
hi am new to coding in php and snippets, if I want to dynamically get my site_url and place it in an image <img src=”{site_url}/images/test.jpg” how would I define the snippet? thanks so much