# automatic-youtube-gallery/1.2.0/admin/templates/shortcode-builder.php

Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists &amp; Channels, version 1.2.0. 97 lines.

- Page: https://pluginprobe.com/plugins/automatic-youtube-gallery/1.2.0/code/admin/templates/shortcode-builder.php
- Raw: https://pluginprobe.com/plugins/automatic-youtube-gallery/1.2.0/raw/admin/templates/shortcode-builder.php
- Modified: 2019-07-09T16:20:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/automatic-youtube-gallery/1.2.0/code/admin/templates/shortcode-builder.php#L10-L20`.

```php
<?php

/**
 * Shortcode Builder.
 *
 * @link    https://plugins360.com
 * @since   1.0.0
 *
 * @package Automatic_YouTube_Gallery
 */
?>

<div id="ayg-shortcode-builder">
    <div class="ayg-modal" style="display: none;">
        <div class="ayg-modal-bg"></div>          
        <div class="ayg-modal-content">                 
            <div class="ayg-modal-body">
                <span class="ayg-modal-close">&times;</span>
                
                <div class="ayg-editor ayg-editor-field-type-playlist ayg-editor-field-theme-classic">                    
                    <p class="ayg-editor-title">
                        <span class="dashicons dashicons-video-alt3"></span> 
                        <strong><?php esc_html_e( 'Automatic YouTube Gallery', 'automatic-youtube-gallery' ); ?></strong>
                        - <?php esc_html_e( 'Building Dynamic Video Galleries', 'automatic-youtube-gallery' ); ?>
                    </p>

                    <!-- Fields -->
                    <?php
                    foreach ( $fields as $key => $value ) : 
                        ?>
                        <div class="ayg-editor-section ayg-editor-section-<?php echo esc_attr( $key ); ?> <?php if ( 'source' == $key ) echo 'ayg-active'; ?>">
                            <h2 class="ayg-editor-section-header">            
                                <span class="dashicons-before dashicons-plus"></span>
                                <span class="dashicons-before dashicons-minus"></span>
                                <?php echo esc_html( $value['label'] ); ?>
                            </h2>

                            <div class="ayg-editor-controls" <?php if ( 'source' != $key ) echo 'style="display: none;"'; ?>>
                                <?php
                                foreach ( $value['fields'] as $field ) :                                    
                                    if ( ! isset( $field['placeholder'] ) ) {
                                        $field['placeholder'] = '';
                                    }
                                    ?>
                                    <div class="ayg-editor-control ayg-editor-control-<?php echo esc_attr( $field['name'] ); ?>">                                                
                                        <?php if ( 'text' == $field['type'] || 'url' == $field['type'] || 'number' == $field['type'] ) : ?>                                        
                                            <label><strong><?php echo esc_html( $field['label'] ); ?></strong></label>
                                            <input type="text" name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> widefat" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" value="<?php echo esc_attr( $field['value'] ); ?>" data-default="<?php echo esc_attr( $field['value'] ); ?>" />
                                        <?php elseif ( 'textarea' == $field['type'] ) : ?>
                                            <label><strong><?php echo esc_html( $field['label'] ); ?></strong></label>
                                            <textarea name="<?php echo esc_attr( $field['name'] ); ?>" rows="8" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> widefat" placeholder="<?php echo esc_attr( $field['placeholder'] ); ?>" data-default="<?php echo esc_attr( $field['value'] ); ?>"><?php echo esc_textarea( $field['value'] ); ?></textarea>
                                        <?php elseif ( 'select' == $field['type'] || 'radio' == $field['type'] ) : ?>
                                            <label><strong><?php echo esc_html( $field['label'] ); ?></strong></label> 
                                            <select name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> widefat" data-default="<?php echo esc_attr( $field['value'] ); ?>">
                                                <?php
                                                foreach ( $field['options'] as $value => $label ) {
                                                    printf( '<option value="%s"%s>%s</option>', esc_attr( $value ), selected( $value, $field['value'], false ), esc_html( $label ) );
                                                }
                                                ?>
                                            </select>                                        
                                        <?php elseif ( 'checkbox' == $field['type'] ) : ?>                                        
                                            <label>				
                                                <input type="checkbox" name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?>" value="1" data-default="<?php echo esc_attr( $field['value'] ); ?>" <?php checked( $field['value'] ); ?> />
                                                <strong><?php echo esc_html( $field['label'] ); ?></strong>
                                            </label>                                            
                                        <?php elseif ( 'color' == $field['type'] ) : ?>                                        
                                            <label><strong><?php echo esc_html( $field['label'] ); ?></strong></label>
                                            <input type="text" name="<?php echo esc_attr( $field['name'] ); ?>" class="ayg-editor-field ayg-editor-field-<?php echo esc_attr( $field['name'] ); ?> ayg-color-picker widefat" value="<?php echo esc_attr( $field['value'] ); ?>" data-default="<?php echo esc_attr( $field['value'] ); ?>" />
                                        <?php endif; ?>
                                        
                                        <!-- Hint -->
                                        <?php if ( isset( $field['description'] ) ) : ?>                            
                                            <p class="description"><?php echo wp_kses_post( $field['description'] ); ?></p>                        
                                        <?php endif; ?>                                                            
                                    </div>    
                                    <?php
                                endforeach;
                                ?>
                            </div>

                        </div>
                        
                        <?php
                    endforeach;
                    ?>

                    <!-- Action Buttons -->
                    <p class="submit">            
                        <a id="ayg-close-shortcode-builder" class="button-secondary"><?php esc_html_e( 'Cancel', 'automatic-youtube-gallery' ); ?></a>
                        <input type="button" id="ayg-insert-shortcode" class="button-primary" value="<?php esc_attr_e( 'Insert Shortcode', 'automatic-youtube-gallery' ); ?>" />
                    </p>
                </div> <!-- END ayg-editor -->

            </div> <!-- END ayg-modal-body -->
        </div> <!-- END ayg-modal-content -->
    </div> <!-- END ayg-modal -->
</div>
```
