forked from construct0-forks/nyzoWordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnyzoShortcodes.php
33 lines (27 loc) · 1.11 KB
/
nyzoShortcodes.php
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
<?php
if (!defined('__NYZO_EXTENSION_ROOT__')) { define('__NYZO_EXTENSION_ROOT__', dirname(__FILE__)); }
require_once(__NYZO_EXTENSION_ROOT__ . '/lib/nyzoStringEncoder.php');
require_once(__NYZO_EXTENSION_ROOT__ . '/lib/nyzoStringPublicIdentifier.php');
require_once(__NYZO_EXTENSION_ROOT__ . '/lib/nyzoTip.php');
add_shortcode('nyzo_tip', 'nyzoTipShortcodeDefault');
add_shortcode('nyzo_tip_hidden', 'nyzoTipShortcodeHidden');
add_shortcode('nyzo_tip_small', 'nyzoTipShortcodeSmall');
add_shortcode('nyzo_tip_large', 'nyzoTipShortcodeLarge');
function nyzoTipShortcodeDefault() {
$options = get_option('nyzo_plugin_options');
try {
$style = $options['default_shortcode_tip_element'];
} catch (Throwable $t) {
$style = 'hidden';
}
return nyzoTipElement($style, 'shortcode nyzo_tip');
}
function nyzoTipShortcodeHidden() {
return nyzoTipElement('hidden', 'shortcode nyzo_tip_hidden');
}
function nyzoTipShortcodeSmall() {
return nyzoTipElement('small', 'shortcode nyzo_tip_small');
}
function nyzoTipShortcodeLarge() {
return nyzoTipElement('large', 'shortcode nyzo_tip_large');
}