Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Created June 9, 2016 18:23
Show Gist options
  • Save BeardedGinger/a33588aa9037c1674b0d59a368fecc81 to your computer and use it in GitHub Desktop.
Save BeardedGinger/a33588aa9037c1674b0d59a368fecc81 to your computer and use it in GitHub Desktop.
<?php
function shortcode_ui() {
if( ! function_exists( 'shortcode_ui_register_for_shortcode' ) )
return;
$fields = array(
array(
'label' => 'Background Color',
'attr' => 'background_color',
'type' => 'select',
'options' => array(
'' => 'White',
'green' => 'Green',
'blue' => 'Blue',
'orange' => 'Orange',
'black' => 'Black'
)
),
array(
'label' => 'Image',
'attr' => 'image',
'type' => 'attachment',
'libraryType' => array( 'image' ),
'addButton' => 'Banner Image',
'frameTitle' => 'Banner Image'
),
array(
'label' => 'Image Position',
'attr' => 'image-position',
'type' => 'select',
'options' => array(
'left' => 'Left',
'right' => 'Right'
)
)
);
$shortcode_ui_args = array(
'label' => 'Banner',
'listItemImage' => 'dashicons-align-center',
'inner_content' => array(
'label' => 'Content'
),
'attrs' => $fields
);
shortcode_ui_register_for_shortcode( 'limecuda_banner', $shortcode_ui_args );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment