Plugin Directory

Changeset 663503


Ignore:
Timestamp:
02/05/2013 02:34:25 AM (13 years ago)
Author:
ffto
Message:

add fixes. The image replacement was not working. Added content position in widget

Location:
social-accounts/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • social-accounts/trunk/ffto-social-accounts-widget.php

    r654674 r663503  
    1818   
    1919    function update($new_instance, $old_instance) {
    20         $instance               = $old_instance;
    21         $instance['title']      = strip_tags($new_instance['title']);
    22         $instance['style']      = $new_instance['style'];
    23         $instance['content']    = $new_instance['content'];
     20        $instance                       = $old_instance;
     21        $instance['title']              = strip_tags($new_instance['title']);
     22        $instance['style']              = $new_instance['style'];
     23        $instance['content']            = $new_instance['content'];
     24        $instance['content_position']   = $new_instance['content_position'];
    2425        return $instance;
    2526    }
     
    3839            <textarea id="<?php echo $this->get_field_id('content'); ?>" name="<?php echo $this->get_field_name('content'); ?>" class="widefat" rows="4"><?php echo esc_attr($instance['content']); ?></textarea>
    3940        </p>
     41        <p>
     42            <label for="<?php echo $this->get_field_id('content_position'); ?>"><?php _e('Content Position'); ?></label>
     43            <select name="<?php echo $this->get_field_name('content_position'); ?>" class="widefat" id="<?php echo $this->get_field_id('content_position'); ?>">
     44                <?php foreach (array('before'=>'Before the accounts', 'after'=>'After the accounts') as $id=>$name): ?>
     45                <option value="<?php echo $id; ?>" <?php selected($instance['content_position'], $id); ?>><?php echo $name; ?></option>
     46                <?php endforeach; ?>
     47            </select>
     48        </p>
    4049        <p>
    4150            <label for="<?php echo $this->get_field_id('style'); ?>"><?php _e('Style'); ?></label>
     
    5968        if ($title) echo $args['before_title'].apply_filters('widget_title', $title).$args['after_title'];
    6069       
    61         $accounts = the_social_accounts('container_class=social-accounts '.$style, false);
     70        $accounts   = the_social_accounts('container_class=social-accounts '.$style, false);
     71        $content    = $content ? '<div class="extra-content">'.apply_filters('widget_content', wpautop($content)).'</div>' : '';
    6272       
    63         echo apply_filters('widget_content', wpautop($content));
     73        if ($content_position == 'before') echo $content;
    6474        echo $accounts;
     75        if ($content_position == 'after') echo $content;
    6576       
    6677        echo $args['after_widget'];
  • social-accounts/trunk/ffto-social-accounts.php

    r659092 r663503  
    55Description: Add an option page under Settings where the user can add all his Social Accounts URLs. Includes a Social Account Widget.
    66Author: Maxime Lefrancois
    7 Version: 1.1
     7Version: 1.1.2
    88Author URI: http://imfreshfromtheoven.com
    99*/
    1010
    1111if(defined('FFTO_SOCIAL_ACCOUNTS')) return;
    12 define('FFTO_SOCIAL_ACCOUNTS', '1.1');
     12define('FFTO_SOCIAL_ACCOUNTS', '1.1.2');
    1313define('FFTO_SOCIAL_ACCOUNTS_PATH', dirname(__FILE__));
    1414define('FFTO_SOCIAL_ACCOUNTS_FOLDER', basename(FFTO_SOCIAL_ACCOUNTS_PATH));
     
    184184               
    185185                $image  = '';
    186                 $custom = $this->get_value('custom_value', $account['id']);
     186                $custom = $this->get_value('custom_image', $account['id']);
    187187               
    188188                if ($custom)                            $image = $custom;
  • social-accounts/trunk/readme.txt

    r659090 r663503  
    44Requires at least: 3.4
    55Tested up to: 3.5
    6 Stable tag: 1.1
     6Stable tag: 1.1.2
    77
    88Add a new section under Settings for your social accounts. The order and the images can be customized with ease.
     
    9292== Changelog ==
    9393
     94= 1.1.2 =
     95* Fix the image replacement not working
     96* Add optional content position for widget
     97
    9498= 1.1 =
    9599* Updated admin design
Note: See TracChangeset for help on using the changeset viewer.