Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function helloFunction($atts, $content) {
- extract(shortcode_atts(array(
- "id" => "",
- ), $atts));
- //if $id isnt empty
- if($id != "") {
- //i created a new variable called $theid which = id="whatever you put in"
- $theid = ' id="'.$id.'"';
- }
- //$theid wont equal anything unless you write [writehello id="something"]
- return '<div'.$theid.'>'.$content.'</div>';
- }
- add_shortcode("writehello", "helloFunction");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement