Exemple #1
0
/**
 * Provides a Render selectbox with options for all registered image sizes.
 *
 * @since 1.0.0
 *
 * @return array All WP image sizes.
 */
function render_image_sizes_dropdown()
{
    $output = array('full' => 'Full');
    foreach (get_intermediate_image_sizes() as $size) {
        $output[$size] = render_translate_id_to_name($size);
    }
    return $output;
}
Exemple #2
0
/**
 * Helper function for populating the icon list selectbox.
 *
 * @since  1.0.0
 * @return bool|array List of icons.
 */
function render_sc_icon_list()
{
    $icons = array('menu', 'dashboard', 'admin-site', 'admin-media', 'admin-page', 'admin-comments', 'admin-appearance', 'admin-plugins', 'admin-users', 'admin-tools', 'admin-settings', 'admin-network', 'admin-generic', 'admin-home', 'admin-collapse', 'admin-links', 'admin-post', 'format-standard', 'format-image', 'format-gallery', 'format-audio', 'format-video', 'format-links', 'format-chat', 'format-status', 'format-aside', 'format-quote', 'welcome-write-blog', 'welcome-edit-page', 'welcome-add-page', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-comments', 'welcome-learn-more', 'image-crop', 'image-rotate-left', 'image-rotate-right', 'image-flip-vertical', 'image-flip-horizontal', 'undo', 'redo', 'editor-bold', 'editor-italic', 'editor-ul', 'editor-ol', 'editor-quote', 'editor-alignleft', 'editor-aligncenter', 'editor-alignright', 'editor-insertmore', 'editor-spellcheck', 'editor-distractionfree', 'editor-expand', 'editor-contract', 'editor-kitchensink', 'editor-underline', 'editor-justify', 'editor-textcolor', 'editor-paste-word', 'editor-paste-text', 'editor-removeformatting', 'editor-video', 'editor-customchar', 'editor-outdent', 'editor-indent', 'editor-help', 'editor-strikethrough', 'editor-unlink', 'editor-rtl', 'editor-break', 'editor-code', 'editor-paragraph', 'align-left', 'align-right', 'align-center', 'align-none', 'lock', 'calendar', 'visibility', 'post-status', 'edit', 'post-trash', 'trash', 'external', 'arrow-up', 'arrow-down', 'arrow-left', 'arrow-right', 'arrow-up-alt', 'arrow-down-alt', 'arrow-left-alt', 'arrow-right-alt', 'arrow-up-alt2', 'arrow-down-alt2', 'arrow-left-alt2', 'arrow-right-alt2', 'leftright', 'sort', 'randomize', 'list-view', 'exerpt-view', 'hammer', 'art', 'migrate', 'performance', 'universal-access', 'universal-access-alt', 'tickets', 'nametag', 'clipboard', 'heart', 'megaphone', 'schedule', 'wordpress', 'wordpress-alt', 'pressthis', 'update', 'screenoptions', 'info', 'cart', 'feedback', 'cloud', 'translation', 'tag', 'category', 'archive', 'tagcloud', 'text', 'media-archive', 'media-audio', 'media-code', 'media-default', 'media-document', 'media-interactive', 'media-spreadsheet', 'media-text', 'media-video', 'playlist-audio', 'playlist-video', 'yes', 'no', 'no-alt', 'plus', 'plus-alt', 'minus', 'dismiss', 'marker', 'star-filled', 'star-half', 'star-empty', 'flag', 'share', 'share1', 'share-alt', 'share-alt2', 'twitter', 'rss', 'email', 'email-alt', 'facebook', 'facebook-alt', 'networking', 'googleplus', 'location', 'location-alt', 'camera', 'images-alt', 'images-alt2', 'video-alt', 'video-alt2', 'video-alt3', 'vault', 'shield', 'shield-alt', 'sos', 'search', 'slides', 'analytics', 'chart-pie', 'chart-bar', 'chart-line', 'chart-area', 'groups', 'businessman', 'id', 'id-alt', 'products', 'awards', 'forms', 'testimonial', 'portfolio', 'book', 'book-alt', 'download', 'upload', 'backup', 'clock', 'lightbulb', 'microphone', 'desktop', 'tablet', 'smartphone', 'smiley');
    $output = array();
    foreach ($icons as $icon) {
        $output["dashicons-{$icon}"] = array('label' => render_translate_id_to_name(str_replace('admin-', '', $icon)), 'icon' => "dashicons dashicons-{$icon}");
    }
    return $output;
}
Exemple #3
0
 /**
  * Adds all shortcodes into Render and / or WordPress.
  *
  * @since 1.0.0
  *
  * @global Render $Render         The main Render object.
  * @global array  $shortcode_tags All registered shortcodes.
  */
 public function add_shortcodes()
 {
     global $shortcode_tags;
     // Add in all existing shortcode tags first (to account for "unregistered with Render" shortcodes)
     $shortcodes = array();
     if (!empty($shortcode_tags)) {
         foreach ($shortcode_tags as $code => $callback) {
             $shortcode = array();
             $shortcode['title'] = render_translate_id_to_name($code);
             $shortcode['function'] = $callback;
             // Add shortcode to Render
             $shortcodes[$code] = $shortcode;
         }
     }
     $shortcodes = apply_filters('render_add_shortcodes', $shortcodes);
     if ($shortcodes !== false) {
         foreach ($shortcodes as $code => $args) {
             // Setup shortcode defaults
             $args = $this->parse_shortcode($args);
             // Create the actual shortcode if it hasn't yet been created
             if (!array_key_exists($code, $shortcode_tags)) {
                 add_shortcode($code, $args['function']);
             }
             // Add the shortcode info to our list if it hasn't yet been added
             if (empty($this->shortcodes) || !array_key_exists($code, $this->shortcodes)) {
                 $this->shortcodes[$code] = $args;
             }
         }
     }
 }