/wp-content/themes/nonus/theme/shortcodes/typography/ctIconShortcode.class.php
PHP | 59 lines | 25 code | 9 blank | 25 comment | 1 complexity | c046ee9fd7e44b42c4d71a2eccb48d2e MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
- <?php
- /**
- * Icon shortcode
- */
- class ctIconShortcode extends ctShortcode {
- /**
- * Returns name
- * @return string|void
- */
- public function getName() {
- return 'Icon';
- }
- /**
- * Shortcode name
- * @return string
- */
- public function getShortcodeName() {
- return 'icon';
- }
- /**
- * Returns shortcode type
- * @return mixed|string
- */
- public function getShortcodeType() {
- return self::TYPE_SHORTCODE_ENCLOSING;
- }
- /**
- * Handles shortcode
- * @param $atts
- * @param null $content
- * @return string
- */
- public function handle($atts, $content = null) {
- extract(shortcode_atts($this->extractShortcodeAttributes($atts), $atts));
- if($awesome){
- return '<i class="' . $awesome . '"></i>';
- }
- return '';
- }
- /**
- * Returns config
- * @return null
- */
- public function getAttributes() {
- return array(
- 'awesome' => array('label' => __('awesome icon', 'ct_theme'),'type' => "icon", 'default' => '','link'=>CT_THEME_ASSETS.'/shortcode/awesome/index.html'),
- );
- }
- }
- new ctIconShortcode();