Plugin Directory

Changeset 805653


Ignore:
Timestamp:
11/17/2013 06:21:49 AM (12 years ago)
Author:
apokalyptik
Message:

add support for custom gallery shortcodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • photostream-sync/trunk/photostream-sync.php

    r805652 r805653  
    55Description: Synchronize your public iCloud photostreams to your WordPress installation. Import images, Import videos, create gellery posts, and more.
    66Author: Demitrious Kelly <apokalyptik@apokalyptik.com>
    7 Version: 2.0.0
     7Version: 2.0.1
    88Author URI: http://blog.apokalyptik.com/
    99*/
     
    233233
    234234                            <tr
     235                                help="<?php esc_attr_e( 'Choose a custom gallery shortcode for gallery posts. This is an advanced setting and is best left alone unless you have a specific reason to change it.' ); ?>">
     236                                <td><?php esc_html_e( 'Gallery Shortcode' ); ?></td>
     237                                <td>
     238                                    <input name="photostream[edit][<?php esc_attr_e( $key );?>][gallery_shortcode]" type="text" value="<?php esc_attr_e($stream->gallery_shortcode); ?>" placeholder="[gallery]"/>
     239                                </td>
     240                            </tr>
     241
     242                            <tr
    235243                                help="<?php esc_attr_e( 'Configure the filename to save imported images as. Click "show options" for formatting help.' ); ?>">
    236244                                <td><?php esc_html_e( 'Save Images As' ); ?></td>
     
    335343                    </td>
    336344                </tr>
     345                <tr
     346                    help="<?php esc_attr_e( 'Choose a custom gallery shortcode for gallery posts. This is an advanced setting and is   best left alone unless you have a specific reason to change it.' ); ?>">
     347                    <td><?php esc_html_e( 'Gallery Shortcode' ); ?></td>
     348                    <td>
     349                        <input name="photostream[add][gallery_shortcode]" type="text" placeholder="[gallery]"/>
     350                    </td>
     351                </tr>
    337352                <tr help="<?php esc_attr_e( 'Configure the filename to save imported images as. Click "show options" for formatting help.' ); ?>">
    338353                    <td><?php esc_html_e( 'Save Images As' ); ?></td>
     
    358373        if ( !wp_verify_nonce( $_POST['ps-nonce'], 'ps-sync-add' ) )
    359374            return;
    360         $new_stream = $_POST['photostream']['add'];
     375        $new_stream = stripslashes_deep( $_POST['photostream']['add'] );
    361376        $key = $this->parse_user_input_photostream_key( $_POST['photostream']['add']['stream'] );
    362377        $new_stream['key'] = $key;
     
    375390    function process_admin_edit_post() {
    376391        foreach( $_POST['photostream']['edit'] as $key => $data ) {
     392            $data = stripslashes_deep( $data );
    377393            if ( !wp_verify_nonce( $_POST['photostream']['edit'][$key]['ps-nonce'], 'ps-sync-edit-' . $key ) )
    378394                continue;
     
    433449                'tags_input' => empty( $stream->tags ) ? '' : implode( ', ', $stream->tags ),
    434450            );
     451            if ( !empty( $stream->gallery_shortcode ) )
     452                $post['post_content'] = $stream->gallery_shortcode;
    435453            if ( !empty( $images[0]->caption ) && $stream->use_caption ) {
    436454                if ( $stream->use_caption == 'above' )
Note: See TracChangeset for help on using the changeset viewer.