Changeset 1092564
- Timestamp:
- 02/17/2015 04:21:47 PM (11 years ago)
- Location:
- osd-social-media-sharing
- Files:
-
- 17 added
- 4 edited
-
tags/3.4 (added)
-
tags/3.4/images (added)
-
tags/3.4/images/icon.png (added)
-
tags/3.4/images/icons.png (added)
-
tags/3.4/images/icons.svg (added)
-
tags/3.4/includes (added)
-
tags/3.4/includes/OSDSocialShare.php (added)
-
tags/3.4/includes/admin_js.js (added)
-
tags/3.4/includes/admin_style.css (added)
-
tags/3.4/includes/global_settings.php (added)
-
tags/3.4/includes/installation_actions.php (added)
-
tags/3.4/includes/js.php (added)
-
tags/3.4/includes/post_settings.php (added)
-
tags/3.4/includes/style.css (added)
-
tags/3.4/osd_social_media_sharing.php (added)
-
tags/3.4/readme.txt (added)
-
tags/3.4/uninstall.php (added)
-
trunk/includes/OSDSocialShare.php (modified) (3 diffs)
-
trunk/includes/global_settings.php (modified) (6 diffs)
-
trunk/osd_social_media_sharing.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
osd-social-media-sharing/trunk/includes/OSDSocialShare.php
r1091838 r1092564 10 10 "target" => "new", 11 11 "emailTo" => "someone@example.com", 12 "post_types" => array("post" => "1"),12 "post_types" => array("post" => 1), 13 13 "services" => array( 14 14 "facebook" => array( 15 15 "url" => "https://www.facebook.com/sharer/sharer.php?u={{CURRENT_URL}}", 16 "button-type" => "icon", 16 17 "enabled" => 1, 17 "button-type" => "icon",18 18 ), 19 19 "twitter" => array( 20 20 "url" => "https://twitter.com/intent/tweet?text={{POST_TITLE}}&url={{CURRENT_URL}}", 21 "button-type" => "icon", 21 22 "enabled" => 1, 22 "button-type" => "icon",23 23 ), 24 24 "google" => array( 25 25 "url" => "https://plus.google.com/share?url={{CURRENT_URL}}", 26 "button-type" => "icon", 26 27 "enabled" => 1, 27 "button-type" => "icon",28 28 ), 29 29 "linkedIn" => array( 30 30 "url" => "https://www.linkedin.com/shareArticle?mini=true&url={{CURRENT_URL}}&title={{POST_TITLE}}&summary=&source={{SITE_NAME}}", 31 "button-type" => "icon", 31 32 "enabled" => 1, 32 "button-type" => "icon",33 33 ), 34 34 "pinterest" => array( 35 35 "url" => "http://www.pinterest.com/pin/create/button/?url={{CURRENT_URL}}&description={{POST_TITLE}}&media=", 36 "button-type" => "icon", 36 37 "enabled" => 1, 37 "button-type" => "icon",38 38 ), 39 39 "email" => array( 40 40 "url" => "mailto:{{EMAIL_TO}}?subject={{EMAIL_SUBJECT}}&body={{EMAIL_BODY}}", 41 "button-type" => "icon", 41 42 "enabled" => 1, 42 "button-type" => "icon",43 43 ), 44 44 "reddit" => array( 45 45 "url" => "http://www.reddit.com/submit/?url={{CURRENT_URL}}", 46 46 "button-type" => "icon", 47 "order" => -1, 48 "enabled" => 0, 47 49 ) 48 50 ) … … 59 61 foreach ($this->defaults["services"] as $name => $service) { 60 62 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] === "") { 62 64 $this->options["services"][$name][$key] = $this->defaults["services"][$name][$key]; 63 65 } … … 102 104 && isset($this->options['post_types']) 103 105 && 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) { 105 108 $post->post_content .= "[osd_social_media_sharing]"; 106 109 } -
osd-social-media-sharing/trunk/includes/global_settings.php
r1091838 r1092564 8 8 class OSDSocialShareSettings { 9 9 private $options; 10 private $post_types; 10 11 11 12 public function __construct($options) { … … 50 51 51 52 //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 53 57 // Register Style Sheet 54 58 wp_register_style('osd_sms_admin_style', plugins_url('includes/admin_style.css', dirname(__FILE__))); … … 117 121 } 118 122 119 // sanitize123 // Sanitize 120 124 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 } 122 135 return $input; 123 136 } … … 140 153 141 154 public function post_types_callback() { 142 $post_types = get_post_types(array('public' => 1), 'array');143 144 155 echo "<ul class='post-types'>"; 145 foreach($ post_types as $post_type) {156 foreach($this->post_types as $post_type) { 146 157 $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) { 148 159 $checked = " checked='checked'"; 149 160 } … … 168 179 printf( 169 180 '<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' 171 182 ); 172 183 } … … 215 226 } 216 227 217 $enabled_checked = (isset($val["enabled"]) && $val["enabled"] == "1") ? ' checked="checked"' : '';228 $enabled_checked = (isset($val["enabled"]) && $val["enabled"] == 1) ? ' checked="checked"' : ''; 218 229 $url = (isset($val['url'])) ? $val['url'] : ''; 219 230 $icon = (isset($val['icon'])) ? $val['icon'] : ''; -
osd-social-media-sharing/trunk/osd_social_media_sharing.php
r1091838 r1092564 4 4 Plugin URI: http://outsidesource.com 5 5 Description: Add buttons to share any of your content on facebook, twitter, google plus, pinterest, email and more. 6 Version: 3. 36 Version: 3.4 7 7 Author: OSD Web Development Team 8 8 Author URI: http://outsidesource.com -
osd-social-media-sharing/trunk/readme.txt
r1091838 r1092564 4 4 Requires at least: 3.4 5 5 Tested up to: 4.1 6 Stable tag: 3. 36 Stable tag: 3.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 40 40 41 41 == Changelog == 42 43 = 3.4 = 44 * Fixed saving issues 42 45 43 46 = 3.3 =
Note: See TracChangeset
for help on using the changeset viewer.