Plugin Directory

Changeset 1092564


Ignore:
Timestamp:
02/17/2015 04:21:47 PM (11 years ago)
Author:
osdwebdev
Message:

3.4 Release

Location:
osd-social-media-sharing
Files:
17 added
4 edited

Legend:

Unmodified
Added
Removed
  • osd-social-media-sharing/trunk/includes/OSDSocialShare.php

    r1091838 r1092564  
    1010        "target" => "new",
    1111        "emailTo" => "someone@example.com",
    12         "post_types" => array("post" => "1"),
     12        "post_types" => array("post" => 1),
    1313        "services" => array(
    1414            "facebook" => array(
    1515                "url" => "https://www.facebook.com/sharer/sharer.php?u={{CURRENT_URL}}",
     16                "button-type" => "icon",
    1617                "enabled" => 1,
    17                 "button-type" => "icon",
    1818            ),
    1919            "twitter" => array(
    2020                "url" => "https://twitter.com/intent/tweet?text={{POST_TITLE}}&url={{CURRENT_URL}}",
     21                "button-type" => "icon",
    2122                "enabled" => 1,
    22                 "button-type" => "icon",
    2323            ),
    2424            "google" => array(
    2525                "url" => "https://plus.google.com/share?url={{CURRENT_URL}}",
     26                "button-type" => "icon",
    2627                "enabled" => 1,
    27                 "button-type" => "icon",
    2828            ),
    2929            "linkedIn" => array(
    3030                "url" => "https://www.linkedin.com/shareArticle?mini=true&url={{CURRENT_URL}}&title={{POST_TITLE}}&summary=&source={{SITE_NAME}}",
     31                "button-type" => "icon",
    3132                "enabled" => 1,
    32                 "button-type" => "icon",
    3333            ),
    3434            "pinterest" => array(
    3535                "url" => "http://www.pinterest.com/pin/create/button/?url={{CURRENT_URL}}&description={{POST_TITLE}}&media=",
     36                "button-type" => "icon",
    3637                "enabled" => 1,
    37                 "button-type" => "icon",
    3838            ),
    3939            "email" => array(
    4040                "url" => "mailto:{{EMAIL_TO}}?subject={{EMAIL_SUBJECT}}&body={{EMAIL_BODY}}",
     41                "button-type" => "icon",
    4142                "enabled" => 1,
    42                 "button-type" => "icon",
    4343            ),
    4444            "reddit" => array(
    4545                "url" => "http://www.reddit.com/submit/?url={{CURRENT_URL}}",
    4646                "button-type" => "icon",
     47                "order" => -1,
     48                "enabled" => 0,
    4749            )
    4850        )
     
    5961        foreach ($this->defaults["services"] as $name => $service) {
    6062            foreach ($service as $key => $value) {
    61                 if (!isset($this->options["services"][$name][$key]) || $this->options["services"][$name][$key] == "") {
     63                if (!isset($this->options["services"][$name][$key]) || $this->options["services"][$name][$key] === "") {
    6264                    $this->options["services"][$name][$key] = $this->defaults["services"][$name][$key];
    6365                }
     
    102104                && isset($this->options['post_types'])
    103105                && count($this->options['post_types']) > 0
    104                 && isset($this->options['post_types'][$post->post_type])) {
     106                && isset($this->options['post_types'][$post->post_type])
     107                && $this->options['post_types'][$post->post_type] == 1) {
    105108                $post->post_content .= "[osd_social_media_sharing]";
    106109            }
  • osd-social-media-sharing/trunk/includes/global_settings.php

    r1091838 r1092564  
    88class OSDSocialShareSettings {
    99    private $options;
     10    private $post_types;
    1011
    1112    public function __construct($options) {
     
    5051
    5152    //register / add options
    52     public function page_init() {   
     53    public function page_init() {
     54        // Get all the registered post types
     55        $this->post_types = get_post_types(array('public' => 1), 'array');
     56
    5357        // Register Style Sheet
    5458        wp_register_style('osd_sms_admin_style', plugins_url('includes/admin_style.css', dirname(__FILE__)));
     
    117121    }
    118122
    119     //sanitize 
     123    // Sanitize 
    120124    public function sanitize($input) {
    121         // use to sanitize all inputs
     125        // Get all checkboxes to accurately represent their value
     126        if (!isset($input["post_types"])) {
     127            $input["post_types"] = array();
     128        }
     129        foreach ($this->post_types as $key => $value) {
     130            $input["post_types"][$key] = (isset($input["post_types"][$key]) && $input["post_types"][$key] == 1) ? 1 : 0;
     131        }
     132        foreach ($input["services"] as $key => $value) {
     133            $input["services"][$key]["enabled"] = (isset($input["services"][$key]["enabled"]) && $input["services"][$key]["enabled"] == 1) ? 1 : 0;
     134        }
    122135        return $input;
    123136    }
     
    140153
    141154    public function post_types_callback() {
    142         $post_types = get_post_types(array('public' => 1), 'array');
    143 
    144155        echo "<ul class='post-types'>";
    145         foreach($post_types as $post_type) {
     156        foreach($this->post_types as $post_type) {
    146157            $checked = '';
    147             if(isset($this->options['post_types'][$post_type->name])) {
     158            if (isset($this->options['post_types'][$post_type->name]) && $this->options['post_types'][$post_type->name] == 1) {
    148159                $checked = " checked='checked'";
    149160            }
     
    168179        printf(
    169180            '<input type="text" id="emailTo" name="osd_social_share_options[emailTo]" value="%s" />',
    170             isset($options['emailTo']) ? esc_attr($options['emailTo']) : 'someone@example.com'
     181            isset($this->options['emailTo']) ? esc_attr($this->options['emailTo']) : 'someone@example.com'
    171182        );
    172183    }
     
    215226            }
    216227
    217             $enabled_checked = (isset($val["enabled"]) && $val["enabled"] == "1") ? ' checked="checked"' : '';
     228            $enabled_checked = (isset($val["enabled"]) && $val["enabled"] == 1) ? ' checked="checked"' : '';
    218229            $url = (isset($val['url'])) ? $val['url'] : '';
    219230            $icon = (isset($val['icon'])) ? $val['icon'] : '';
  • osd-social-media-sharing/trunk/osd_social_media_sharing.php

    r1091838 r1092564  
    44Plugin URI: http://outsidesource.com
    55Description: Add buttons to share any of your content on facebook, twitter, google plus, pinterest, email and more.
    6 Version: 3.3
     6Version: 3.4
    77Author: OSD Web Development Team
    88Author URI: http://outsidesource.com
  • osd-social-media-sharing/trunk/readme.txt

    r1091838 r1092564  
    44Requires at least: 3.4
    55Tested up to: 4.1
    6 Stable tag: 3.3
     6Stable tag: 3.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4040
    4141== Changelog ==
     42
     43= 3.4 =
     44* Fixed saving issues
    4245
    4346= 3.3 =
Note: See TracChangeset for help on using the changeset viewer.