Shortcode is a WordPress-specific code that lets you do nifty things with very little effort.', 'shortcodes-ultimate' ); ?>

%home_url% -
%theme_url% -
%plugin_url% -
'; $open = ( isset( $_GET['example'] ) ) ? sanitize_key( $_GET['example'] ) : ''; $open = ''; $nonce = ''; foreach ( $examples as $group ) { $items = array(); if ( isset( $group['items'] ) ) foreach ( $group['items'] as $item ) { $code = ( isset( $item['code'] ) ) ? $item['code'] : plugins_url( 'inc/examples/' . $item['id'] . '.example', SU_PLUGIN_FILE ); $id = ( isset( $item['id'] ) ) ? $item['id'] : ''; $items[] = '
' . $item['name'] . '
'; } $output[] = '

' . $group['title'] . '

' . implode( '', $items ) . '
'; } su_query_asset( 'css', array( 'magnific-popup', 'font-awesome', 'su-options-page' ) ); su_query_asset( 'js', array( 'jquery', 'magnific-popup', 'su-options-page' ) ); return '
' . implode( '', $output ) . '
' . $preview . $open . $nonce; } public static function cheatsheet( $field, $config ) { // Prepare print button $print = '
' . __( 'Printable version', 'shortcodes-ultimate' ) . '

' . __( 'Shortcodes Ultimate', 'shortcodes-ultimate' ) . ': ' . __( 'Cheatsheet', 'shortcodes-ultimate' ) . '

← ' . __( 'Back to Dashboard', 'shortcodes-ultimate' ) . '
'; // Prepare table array $table = array(); // Table start $table[] = ''; // Loop through shortcodes foreach ( (array) Su_Data::shortcodes() as $name => $shortcode ) { // Prepare vars $icon = ( isset( $shortcode['icon'] ) ) ? $shortcode['icon'] : 'puzzle-piece'; $shortcode['name'] = ( isset( $shortcode['name'] ) ) ? $shortcode['name'] : $name; $attributes = array(); $example = array(); $icons = 'icon: music, icon: envelope … ' . __( 'full list', 'shortcodes-ultimate' ) . ''; // Loop through attributes if ( is_array( $shortcode['atts'] ) ) foreach ( $shortcode['atts'] as $id => $data ) { // Prepare default value $default = ( isset( $data['default'] ) && $data['default'] !== '' ) ? '

' . __( 'Default value', 'shortcodes-ultimate' ) . ': ' . $data['default'] . '

' : ''; // Check type is set if ( empty( $data['type'] ) ) $data['type'] = 'text'; // Switch attribute types switch ( $data['type'] ) { // Select case 'select': $value = implode( ', ', array_keys( $data['values'] ) ); break; // Slider and number case 'slider': case 'number': $value = $data['min'] . '…' . $data['max']; break; // Bool case 'bool': $value = 'yes | no'; break; // Icon case 'icon': $value = $icons; break; // Color case 'color': $value = __( '#RGB and rgba() colors' ); break; // Default value default: $value = $data['default']; break; } // Check empty value if ( $value === '' ) $value = __( 'Any text value', 'shortcodes-ultimate' ); // Extra CSS class if ( $id === 'class' ) $value = __( 'Any custom CSS classes', 'shortcodes-ultimate' ); // Add attribute $attributes[] = '
' . $data['name'] . ' – ' . $id . '

' . __( 'Possible values', 'shortcodes-ultimate' ) . ': ' . $value . '

' . $default . '
'; // Add attribute to the example code $example[] = $id . '="' . $data['default'] . '"'; } // Prepare example code $example = '[%prefix_' . $name . ' ' . implode( ' ', $example ) . ']'; // Prepare content value if ( empty( $shortcode['content'] ) ) $shortcode['content'] = ''; // Add wrapping code if ( $shortcode['type'] === 'wrap' ) $example .= esc_textarea( $shortcode['content'] ) . '[/%prefix_' . $name . ']'; // Change compatibility prefix $example = str_replace( array( '%prefix_', '__' ), su_cmpt(), $example ); // Shortcode $table[] = ''; // Attributes $table[] = ''; // Example code $table[] = ''; } // Table end $table[] = '
' . __( 'Shortcode', 'shortcodes-ultimate' ) . '' . __( 'Attributes', 'shortcodes-ultimate' ) . '' . __( 'Example code', 'shortcodes-ultimate' ) . '
' . '' . Su_Tools::icon( $icon ) . '' . $shortcode['name'] . '
' . $shortcode['desc'] . '
' . implode( '', $attributes ) . '' . $example . '
'; // Query assets su_query_asset( 'css', array( 'font-awesome', 'su-cheatsheet' ) ); su_query_asset( 'js', array( 'jquery', 'su-options-page' ) ); // Return output return '
' . $print . implode( '', $table ) . '
'; } public static function addons( $field, $config ) { $output = array(); $addons = array( array( 'name' => __( 'New Shortcodes', 'shortcodes-ultimate' ), 'desc' => __( 'Parallax sections, responsive content slider, pricing tables, vector icons, testimonials, progress bars and even more', 'shortcodes-ultimate' ), 'url' => 'http://gndev.info/shortcodes-ultimate/extra/', 'image' => plugins_url( 'assets/images/banners/extra.png', SU_PLUGIN_FILE ) ), array( 'name' => __( 'Maker', 'shortcodes-ultimate' ), 'desc' => __( 'This add-on allows you to create custom shortcodes. You can easily create any shortcode with different parameters or even override default shortcodes', 'shortcodes-ultimate' ), 'url' => 'http://gndev.info/shortcodes-ultimate/maker/', 'image' => plugins_url( 'assets/images/banners/maker.png', SU_PLUGIN_FILE ) ), array( 'name' => __( 'Skins', 'shortcodes-ultimate' ), 'desc' => __( 'Set of additional skins for Shortcodes Ultimate. It includes skins for accordeons/spoilers, tabs and some other shortcodes', 'shortcodes-ultimate' ), 'url' => 'http://gndev.info/shortcodes-ultimate/skins/', 'image' => plugins_url( 'assets/images/banners/skins.png', SU_PLUGIN_FILE ) ), array( 'name' => __( 'Add-ons bundle', 'shortcodes-ultimate' ), 'desc' => __( 'Get all three add-ons with huge discount!', 'shortcodes-ultimate' ), 'url' => 'http://gndev.info/shortcodes-ultimate/add-ons-bundle/', 'image' => plugins_url( 'assets/images/banners/bundle.png', SU_PLUGIN_FILE ) ), ); $plugins = array(); $output[] = '

' . __( 'Shortcodes Ultimate Add-ons', 'shortcodes-ultimate' ) . '

'; $output[] = '
'; foreach ( $addons as $addon ) { $output[] = ''; } $output[] = '
'; if ( count( $plugins ) ) { $output[] = '

' . __( 'Other WordPress Plugins', 'shortcodes-ultimate' ) . '

'; $output[] = '
'; foreach ( $plugins as $plugin ) { $output[] = ''; } $output[] = '
'; } su_query_asset( 'css', array( 'animate', 'su-options-page' ) ); su_query_asset( 'js', array( 'jquery', 'su-options-page' ) ); return '
' . implode( '', $output ) . '
'; } }