PluginProbe
CoolClock / 4.0
CoolClock v4.0
4.3.8 trunk 0.1 2.0 2.9.8 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7
coolclock / includes / class-coolclock-shortcode.php

class-coolclock-shortcode.php in CoolClock 4.0, at includes/class-coolclock-shortcode.php

48 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * CoolClock Shortcode Class
5 */
6
7 class CoolClock_Shortcode {
8
9 public static function handle_shortcode( $atts, $content = null ) {
10 if ( is_feed() )
11 return '';
12
13 $atts = shortcode_atts( array_merge( CoolClock::$defaults, CoolClock::$advanced_defaults ), $atts, 'coolclock' );
14
15 // TODO user input (attributes) validation here !!
16 /*
17 skin -- must be one of these: 'swissRail' (default skin), 'chunkySwiss', 'chunkySwissOnBlack', 'fancy', 'machine', 'simonbaird_com', 'classic', 'modern', 'simple', 'securephp', 'Tes2', 'Lev', 'Sand', 'Sun', 'Tor', 'Cold', 'Babosa', 'Tumb', 'Stone', 'Disc', 'watermelon' or 'mister'. If the Advanced extension is activated, there is also 'minimal' available. Please note that these names are case sensitive.
18 radius -- a number to define the clock radius. Do not add 'px' or any other measure descriptor.
19 noseconds -- set to true (or 1) to hide the second hand
20 gmtoffset -- a number to define a timezone relative the Greenwhich Mean Time. Do not set this parameter to default to local time.
21 showdigital -- set to 'digital12' to show the time in 12h digital format (with am/pm) too
22 scale -- must be one of these: 'linear' (default scale), 'logClock' or 'logClockRev'. Linear is our normal clock scale, the other two show a logarithmic time scale
23 subtext -- optional text, centered below the clock
24 align -- sets floating of the clock: 'left', 'right' or 'center'
25 */
26
27 // set footer script flags
28 CoolClock::$add_script = true;
29
30 if ( !isset( $atts['skin'] ) )
31 $atts['skin'] = CoolClock::$defaults['skin'];
32
33 if ( in_array( $atts['skin'], CoolClock::$more_skins ) )
34 CoolClock::$add_moreskins = true;
35
36 // get output
37 $output = CoolClock::canvas( $atts );
38
39 return apply_filters( 'coolclock_shortcode_advanced', $output, $atts, $content );
40 }
41
42 public static function no_wptexturize($shortcodes) {
43 $shortcodes[] = 'coolclock';
44 return $shortcodes;
45 }
46
47 }
48