Skip to content

Commit

Permalink
Merge pull request #676 from wp-shortcake/release-v0.7.1
Browse files Browse the repository at this point in the history
Bump version number and add changelog for v0.7.1
  • Loading branch information
goldenapples authored Mar 16, 2017
2 parents b653929 + a321b40 commit 4a2a07a
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 84 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Tags:** shortcodes
**Requires at least:** 4.5
**Tested up to:** 4.7
**Stable tag:** 0.7.0
**Stable tag:** 0.7.1
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -27,9 +27,9 @@ New in 0.4.0 is the ability to [attach javascript functions to event attribute u

## Frequently Asked Questions ##

= How do I register UI for arbitrary key=>value pairs as shortcode attributes? =
### How do I register UI for arbitrary key/value pairs as shortcode attributes? ###

Shortcake doesn't support custom key=>value pairs as shortcode attributes because it isn't a great user experience.
Shortcake doesn't support custom key => value pairs as shortcode attributes because it isn't a great user experience.

### After upgrading to Shortcake 0.7.x, some of the shortcode UI fields (post select, user select, etc) don't work as expected. What can I do? ###

Expand Down Expand Up @@ -76,6 +76,16 @@ We've removed the compatibility shim for the magical `content` attribute. If you

## Changelog ##

### 0.7.1 (December 16, 2016) ###
* Change shortcode formatting to add a space before the self-closing trailing slash.
* Fix alignment of attachment previews with long filenames.
* Bug fix: Set an initial value on select fields (previously, no value would be set for a select field unless the user interacts with the field).
* Enhancement/fix: Reuse one copy of the media modal and reset its state upon closing, rather than creating duplicate markup each time the modal is accessed.
* Compatability: Uses "full" version of select2.js 4.0.3 to prevent plugin conflicts with other plugins which expect the full version to be enqueued.
* Compatability: Add `SELECT2_NOCONFLICT` flag to load Select2 in a unique namespace to prevent conflicts with other plugins which are loading select2.js version 3.
* Added Norwegian translation.
* Multiple coding style fixes.

### 0.7.0 (November 18, 2016) ###
* Adds "Add post element" button to media buttons - one click to open the shortcode list, rather than clicking "Add media" button and then finding "insert post element" in the menu.
* Added "Term Select" field type.
Expand Down Expand Up @@ -196,7 +206,7 @@ We've removed the compatibility shim for the magical `content` attribute. If you

* Supports all HTML5 input types for form fields.
* Shortcode preview tab within the editing experience.
* Re-labeled the UI around “Post Elements”, which is more descriptive than “Content Items.”
}* Re-labeled the UI around “Post Elements”, which is more descriptive than “Content Items.”
* Many bug fixes.
* [Full release notes](http://next.fusion.net/2014/12/23/shortcake-v0-1-0-live-previews-fieldmanager-integration/).

70 changes: 35 additions & 35 deletions dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function shortcode_ui_dev_example_notices() {
if ( current_user_can( 'activate_plugins' ) ) {
?>
<div class="error message">
<p><?php esc_html_e( 'Shortcode UI plugin must be active for Shortcode UI Example plugin to function.', 'shortcode-ui-example' ); ?></p>
<p><?php esc_html_e( 'Shortcode UI plugin must be active for Shortcode UI Example plugin to function.', 'shortcode-ui-example', 'shortcode-ui' ); ?></p>
</div>
<?php
}
Expand Down Expand Up @@ -116,7 +116,7 @@ function shortcode_ui_dev_minimal_example() {
shortcode_ui_register_for_shortcode(
'shortcake-no-attributes', // Shortcode tag this UI is for.
array( // Shortcode UI args.
'label' => esc_html__( 'Shortcake With No Attributes', 'shortcode-ui-example' ),
'label' => esc_html__( 'Shortcake With No Attributes', 'shortcode-ui-example', 'shortcode-ui' ),
)
);
}
Expand Down Expand Up @@ -156,7 +156,7 @@ function shortcode_ui_dev_advanced_example() {
*/
$fields = array(
array(
'label' => esc_html__( 'Attachment', 'shortcode-ui-example' ),
'label' => esc_html__( 'Attachment', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'attachment',
'type' => 'attachment',
/*
Expand All @@ -166,79 +166,79 @@ function shortcode_ui_dev_advanced_example() {
* 'frameTitle' - Title for the modal UI once the library is open.
*/
'libraryType' => array( 'image' ),
'addButton' => esc_html__( 'Select Image', 'shortcode-ui-example' ),
'frameTitle' => esc_html__( 'Select Image', 'shortcode-ui-example' ),
'addButton' => esc_html__( 'Select Image', 'shortcode-ui-example', 'shortcode-ui' ),
'frameTitle' => esc_html__( 'Select Image', 'shortcode-ui-example', 'shortcode-ui' ),
),
array(
'label' => 'Gallery',
'attr' => 'gallery',
'description' => esc_html__( 'You can select multiple images.' ),
'description' => esc_html__( 'You can select multiple images.', 'shortcode-ui' ),
'type' => 'attachment',
'libraryType' => array( 'image' ),
'multiple' => true,
'addButton' => 'Select Images',
'frameTitle' => 'Select Images',
),
array(
'label' => esc_html__( 'Citation Source', 'shortcode-ui-example' ),
'label' => esc_html__( 'Citation Source', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'source',
'type' => 'text',
'encode' => true,
'meta' => array(
'placeholder' => esc_html__( 'Test placeholder', 'shortcode-ui-example' ),
'placeholder' => esc_html__( 'Test placeholder', 'shortcode-ui-example', 'shortcode-ui' ),
'data-test' => 1,
),
),
array(
'label' => esc_html__( 'Select Page', 'shortcode-ui-example' ),
'label' => esc_html__( 'Select Page', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'page',
'type' => 'post_select',
'query' => array( 'post_type' => 'page' ),
'multiple' => true,
),
array(
'label' => __( 'Select Term', 'shortcode-ui-example' ),
'label' => __( 'Select Term', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'term',
'type' => 'term_select',
'taxonomy' => 'post_tag',
'multiple' => true,
),
array(
'label' => __( 'User Select', 'shortcode-ui-example' ),
'label' => __( 'User Select', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'users',
'type' => 'user_select',
'multiple' => true,
),
array(
'label' => esc_html__( 'Color', 'shortcode-ui-example' ),
'label' => esc_html__( 'Color', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'color',
'type' => 'color',
'encode' => false,
'meta' => array(
'placeholder' => esc_html__( 'Hex color code', 'shortcode-ui-example' ),
'placeholder' => esc_html__( 'Hex color code', 'shortcode-ui-example', 'shortcode-ui' ),
),
),
array(
'label' => esc_html__( 'Alignment', 'shortcode-ui-example' ),
'description' => esc_html__( 'Whether the quotation should be displayed as pull-left, pull-right, or neither.', 'shortcode-ui-example' ),
'label' => esc_html__( 'Alignment', 'shortcode-ui-example', 'shortcode-ui' ),
'description' => esc_html__( 'Whether the quotation should be displayed as pull-left, pull-right, or neither.', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'alignment',
'type' => 'select',
'options' => array(
array( 'value' => '', 'label' => esc_html__( 'None', 'shortcode-ui-example' ) ),
array( 'value' => 'left', 'label' => esc_html__( 'Pull Left', 'shortcode-ui-example' ) ),
array( 'value' => 'right', 'label' => esc_html__( 'Pull Right', 'shortcode-ui-example' ) ),
array( 'value' => '', 'label' => esc_html__( 'None', 'shortcode-ui-example', 'shortcode-ui' ) ),
array( 'value' => 'left', 'label' => esc_html__( 'Pull Left', 'shortcode-ui-example', 'shortcode-ui' ) ),
array( 'value' => 'right', 'label' => esc_html__( 'Pull Right', 'shortcode-ui-example', 'shortcode-ui' ) ),
array(
'label' => 'Test Optgroup',
'options' => array(
array( 'value' => 'left-2', 'label' => esc_html__( 'Pull Left', 'shortcode-ui-example' ) ),
array( 'value' => 'right-2', 'label' => esc_html__( 'Pull Right', 'shortcode-ui-example' ) ),
array( 'value' => 'left-2', 'label' => esc_html__( 'Pull Left', 'shortcode-ui-example', 'shortcode-ui' ) ),
array( 'value' => 'right-2', 'label' => esc_html__( 'Pull Right', 'shortcode-ui-example', 'shortcode-ui' ) ),
)
),
),
),
array(
'label' => esc_html__( 'Year', 'shortcode-ui-example' ),
'description' => esc_html__( 'Optional. The year the quotation is from.', 'shortcode-ui-example' ),
'label' => esc_html__( 'Year', 'shortcode-ui-example', 'shortcode-ui' ),
'description' => esc_html__( 'Optional. The year the quotation is from.', 'shortcode-ui-example', 'shortcode-ui' ),
'attr' => 'year',
'type' => 'number',
'meta' => array(
Expand All @@ -257,7 +257,7 @@ function shortcode_ui_dev_advanced_example() {
/*
* How the shortcode should be labeled in the UI. Required argument.
*/
'label' => esc_html__( 'Shortcake Dev', 'shortcode-ui-example' ),
'label' => esc_html__( 'Shortcake Dev', 'shortcode-ui-example', 'shortcode-ui' ),

/*
* Include an icon with your shortcode. Optional.
Expand All @@ -276,8 +276,8 @@ function shortcode_ui_dev_advanced_example() {
* data present will be backed-up during editing.
*/
'inner_content' => array(
'label' => esc_html__( 'Quote', 'shortcode-ui-example' ),
'description' => esc_html__( 'Include a statement from someone famous.', 'shortcode-ui-example' ),
'label' => esc_html__( 'Quote', 'shortcode-ui-example', 'shortcode-ui' ),
'description' => esc_html__( 'Include a statement from someone famous.', 'shortcode-ui-example', 'shortcode-ui' ),
),

/*
Expand Down Expand Up @@ -349,47 +349,47 @@ function( $user_id ) {
<p style="margin:0; padding: 0;">

<?php if ( ! empty( $content ) ) : ?>
<b><?php esc_html_e( 'Content:', 'shortcode-ui-example' ); ?></b> <?php echo wpautop( wp_kses_post( $content ) ); ?></br>
<b><?php esc_html_e( 'Content:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo wpautop( wp_kses_post( $content ) ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['source'] ) ) : ?>
<b><?php esc_html_e( 'Source:', 'shortcode-ui-example' ); ?></b> <?php echo wp_kses_post( $attr['source'] ); ?></br>
<b><?php esc_html_e( 'Source:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo wp_kses_post( $attr['source'] ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['attachment'] ) ) : ?>
<b><?php esc_html_e( 'Image:', 'shortcode-ui-example' ); ?></b> <?php echo wp_kses_post( wp_get_attachment_image( $attr['attachment'], array( 50, 50 ) ) ); ?></br>
<b><?php esc_html_e( 'Image:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo wp_kses_post( wp_get_attachment_image( $attr['attachment'], array( 50, 50 ) ) ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['gallery'] ) ) : ?>
<b><?php esc_html_e( 'Gallery:', 'shortcode-ui-example' ); ?></b>
<b><?php esc_html_e( 'Gallery:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b>
<?php foreach ( explode( ',', $attr['gallery'] ) as $attachment ) : ?>
<?php echo wp_kses_post( wp_get_attachment_image( $attachment, array( 50, 50 ) ) ); ?>
<?php endforeach; ?>
<br />
<?php endif; ?>

<?php if ( ! empty( $attr['page'] ) ) : ?>
<b><?php esc_html_e( 'Pages:', 'shortcode-ui-example' ); ?></b> <?php echo esc_html( implode( ', ', $attr['page'] ) ); ?></br>
<b><?php esc_html_e( 'Pages:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo esc_html( implode( ', ', $attr['page'] ) ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['term'] ) ) : ?>
<b><?php esc_html_e( 'Terms:', 'shortcode-ui-example' ); ?></b> <?php echo esc_html( implode( ', ', $attr['term'] ) ); ?></br>
<b><?php esc_html_e( 'Terms:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo esc_html( implode( ', ', $attr['term'] ) ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['users'] ) ) : ?>
<b><?php esc_html_e( 'Users:', 'shortcode-ui-example' ); ?></b> <?php echo esc_html( implode( ', ', $attr['users'] ) ); ?></br>
<b><?php esc_html_e( 'Users:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo esc_html( implode( ', ', $attr['users'] ) ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['color'] ) ) : ?>
<b><?php esc_html_e( 'Color:', 'shortcode-ui-example' ); ?></b> <span style="display: inline-block; width: 1.5em; height: 1.5em; vertical-align: bottom; background-color: <?php echo esc_html( $attr['color'] ); ?>"></span></br>
<b><?php esc_html_e( 'Color:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <span style="display: inline-block; width: 1.5em; height: 1.5em; vertical-align: bottom; background-color: <?php echo esc_html( $attr['color'] ); ?>"></span></br>
<?php endif; ?>

<?php if ( ! empty( $attr['alignment'] ) ) : ?>
<b><?php esc_html_e( 'Alignment:', 'shortcode-ui-example' ); ?></b> <?php echo esc_html( $attr['alignment'] ); ?></br>
<b><?php esc_html_e( 'Alignment:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo esc_html( $attr['alignment'] ); ?></br>
<?php endif; ?>

<?php if ( ! empty( $attr['year'] ) ) : ?>
<b><?php esc_html_e( 'Year:', 'shortcode-ui-example' ); ?></b> <?php echo esc_html( $attr['year'] ); ?></br>
<b><?php esc_html_e( 'Year:', 'shortcode-ui-example', 'shortcode-ui' ); ?></b> <?php echo esc_html( $attr['year'] ); ?></br>
<?php endif; ?>

</p>
Expand Down
Loading

0 comments on commit 4a2a07a

Please sign in to comment.