-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshorcodizer.php
More file actions
50 lines (39 loc) · 1.45 KB
/
shorcodizer.php
File metadata and controls
50 lines (39 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/*
Plugin Name: Shortcodizer
Plugin URI: https://productforums.google.com/d/topic/adsense/v5f_HHzjBXA/discussion
Description: Insert AdSense ad code with Wordpress shorcodes [adsense-ad-code ad="1"] [adsense-ad-code ad="2"] [adsense-ad-code ad="3"], etc.
Version: 0.01 BETA
Author: Goran Aleksic
Author URI: http://www.88em.com
*/
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
http://www.reallyeffective.co.uk/archives/2009/06/22/how-to-code-your-own-wordpress-shortcode-plugin-tutorial-part-1/
http://wp.smashingmagazine.com/2012/05/01/wordpress-shortcodes-complete-guide/
*/
add_shortcode("adsense-ad-code", "adsense_ad_code_handler");
function adsense_ad_code_handler($atts) {
extract(shortcode_atts(array(
'ad' => 1,
), $atts));
$adArray[1] = 'INSERT AD CODE HERE';
/*
$adArray[2] = '';
$adArray[3] = '';
$adArray[4] = '';
$adArray[5] = '';
// etc.
*/
return $adArray[$ad];
}
?>