Changeset 873981
- Timestamp:
- 03/12/2014 11:52:05 AM (12 years ago)
- Location:
- rss-synchronization
- Files:
-
- 25 added
- 6 edited
-
tags/0.5.3 (added)
-
tags/0.5.3/LICENSE.txt (added)
-
tags/0.5.3/README.txt (added)
-
tags/0.5.3/admin (added)
-
tags/0.5.3/admin/assets (added)
-
tags/0.5.3/admin/assets/js (added)
-
tags/0.5.3/admin/assets/js/admin.js (added)
-
tags/0.5.3/admin/class-rss-sync-admin.php (added)
-
tags/0.5.3/admin/views (added)
-
tags/0.5.3/admin/views/admin.php (added)
-
tags/0.5.3/admin/views/index.php (added)
-
tags/0.5.3/assets (added)
-
tags/0.5.3/includes (added)
-
tags/0.5.3/includes/class-rss-sync-tools.php (added)
-
tags/0.5.3/index.php (added)
-
tags/0.5.3/languages (added)
-
tags/0.5.3/languages/index.php (added)
-
tags/0.5.3/languages/rss-sync.pot (added)
-
tags/0.5.3/public (added)
-
tags/0.5.3/public/class-rss-sync.php (added)
-
tags/0.5.3/rss-sync.php (added)
-
tags/0.5.3/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/assets (added)
-
trunk/admin/assets/js (added)
-
trunk/admin/assets/js/admin.js (added)
-
trunk/admin/class-rss-sync-admin.php (modified) (10 diffs)
-
trunk/admin/views/admin.php (modified) (7 diffs)
-
trunk/includes/class-rss-sync-tools.php (modified) (6 diffs)
-
trunk/public/class-rss-sync.php (modified) (6 diffs)
-
trunk/rss-sync.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rss-synchronization/trunk/README.txt
r871375 r873981 1 === RSS Synchroni zation ===1 === RSS Synchronisation === 2 2 Contributors: LightSystem 3 3 Tags: RSS, plugin, wordpress 4 4 Requires at least: 3.8 5 5 Tested up to: 3.8.1 6 Stable tag: 0.5. 26 Stable tag: 0.5.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 46 46 == Changelog == 47 47 48 = 0.5.3 = 49 * Added option for toggling using thumbnails. 50 48 51 = 0.5.2 = 49 52 * Added support to thumbnail/featured images in posts when 'Link to media gallery' is selected in the settings. -
rss-synchronization/trunk/admin/class-rss-sync-admin.php
r871328 r873981 35 35 * Initialize the plugin by loading admin scripts & styles and adding a 36 36 * settings page and menu. 37 *38 * @since 0.3.039 37 */ 40 38 private function __construct() { … … 60 58 add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) ); 61 59 62 /*63 * Define custom functionality.64 *65 * Read more about actions and filters:66 * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters67 */68 add_action( '@TODO', array( $this, 'action_method_name' ) );69 add_filter( '@TODO', array( $this, 'filter_method_name' ) );70 71 60 } 72 61 73 62 /** 74 63 * Return an instance of this class. 75 *76 * @since 1.0.077 64 * 78 65 * @return object A single instance of this class. … … 98 85 * Register and enqueue admin-specific style sheet. 99 86 * 100 *101 * @since 0.3.0102 *103 87 * @return null Return early if no settings page is registered. 104 88 */ … … 118 102 /** 119 103 * Register and enqueue admin-specific JavaScript. 120 *121 * @since 0.3.0122 104 * 123 105 * @return null Return early if no settings page is registered. … … 139 121 * Register settings for use with this plugin. 140 122 * 141 * @since 0.3.0142 123 */ 143 124 public function register_settings_admin_init() { … … 150 131 * Register the administration menu for this plugin into the WordPress Dashboard menu. 151 132 * 152 * @since 0.3.0153 133 */ 154 134 public function add_plugin_admin_menu() { … … 159 139 * NOTE: Alternative menu locations are available via WordPress administration menu functions. 160 140 * 161 * Administration Menus: http://codex.wordpress.org/Administration_Menus141 * Administration Menus: http://codex.wordpress.org/Administration_Menus 162 142 * 163 * For reference: http://codex.wordpress.org/Roles_and_Capabilities143 * For reference: http://codex.wordpress.org/Roles_and_Capabilities 164 144 */ 165 145 $this->plugin_screen_hook_suffix = add_options_page( … … 169 149 $this->plugin_slug, 170 150 array( $this, 'display_plugin_admin_page' ) 171 ); 151 ); 172 152 173 153 } … … 176 156 * Render the settings page for this plugin. 177 157 * 178 * @since 0.3.0179 158 */ 180 159 public function display_plugin_admin_page() { 181 160 include_once( 'views/admin.php' ); 182 161 183 162 RSS_Sync_AdminSettings::rss_sync_app_page(); 184 163 } … … 187 166 * Add settings action link to the plugins page. 188 167 * 189 * @since 1.0.0190 168 */ 191 169 public function add_action_links( $links ) { -
rss-synchronization/trunk/admin/views/admin.php
r871375 r873981 18 18 19 19 register_setting( 'rss_sync', 'rss_sync', array( 'RSS_Sync_AdminSettings', 'options_validator' ) ); 20 20 21 21 add_settings_section( 'rss_sync_options', 22 22 __( 'General', 'rss-sync' ), 23 23 array( 'RSS_Sync_AdminSettings', 'rss_options' ), 24 24 'rss_sync' ); 25 25 26 26 add_settings_field( 'rss_sync_rss_feeds', 27 27 __( 'RSS Feeds', 'rss-sync' ), … … 29 29 'rss_sync', 30 30 'rss_sync_options' ); 31 31 32 32 add_settings_field( 'rss-sync-refresh', 33 33 __('Refresh Feed', 'rss-sync'), … … 36 36 'rss_sync_options' ); 37 37 38 add_settings_field( 'rss_sync_img_storage', 39 __('Image Storage', 'rss-sync'), 40 array('RSS_Sync_AdminSettings', 'image_storage_options'), 41 'rss_sync', 38 add_settings_field( 'rss_sync_img_storage', 39 __('Image Storage', 'rss-sync'), 40 array('RSS_Sync_AdminSettings', 'image_storage_options'), 41 'rss_sync', 42 42 'rss_sync_options' ); 43 43 } 44 44 45 /* BEGIN APP SETTINGS FORM CALLBACKS */ 45 /* BEGIN APP SETTINGS FORM CALLBACKS */ 46 46 static function rss_sync_app_page () { 47 47 ?> … … 64 64 echo '<p>'; _e( 'General settings for the RSS Sync Plugin.', 'rss-sync' ); echo '</p>'; 65 65 } 66 66 67 67 function rss_feeds () 68 68 { 69 69 $options = get_option( 'rss_sync' ); 70 70 71 71 ?><fieldset> 72 72 <legend class="screen-reader-text"><span><?php _e( 'RSS Feeds', 'rss-sync' ); ?></span></legend> … … 102 102 { 103 103 $options = get_option( 'rss_sync' ); 104 $stored_option = $options['img_storage']; 104 $storage_option = $options['img_storage']; 105 $thumb_option = $options['img_thumbnail']; 105 106 106 107 ?><fieldset> 107 108 <legend class="screen-reader-text"><span><?php _e( 'Image Storage', 'rss-sync' ); ?></span></legend> 108 109 <select id="image_storage_options" name="rss_sync[img_storage]"> 109 <option value="hotlinking" <?php if($stor ed_option == 'hotlinking') echo 'selected' ?> > <?php _e('Use hotlinking', 'rss-sync') ?> </option>110 <option value="local_storage" <?php if($stor ed_option == 'local_storage') echo 'selected' ?> > <?php _e('Link to media gallery', 'rss-sync') ?> </option>110 <option value="hotlinking" <?php if($storage_option == 'hotlinking') echo 'selected' ?> > <?php _e('Use hotlinking', 'rss-sync') ?> </option> 111 <option value="local_storage" <?php if($storage_option == 'local_storage') echo 'selected' ?> > <?php _e('Link to media gallery', 'rss-sync') ?> </option> 111 112 </select> 112 113 <br/> … … 114 115 <?php _e("Note: For featured/thumbnail images to work in posts, choose 'Link to media gallery'"); ?> 115 116 </label> 117 <br/> 118 <p> 119 <div id="thumb_options_set"> 120 <label> 121 <?php _e( 'Use thumbnails?', 'rss-sync' ); ?> 122 <input id="image_thumbnail_option" name="rss_sync[img_thumbnail]" type="checkbox" value="1" <?php checked( '1', $thumb_option ); ?> > 123 </label> 124 </div> 125 </p> 116 126 </fieldset> 117 127 <?php 118 128 } 119 129 120 130 static function options_validator ( $options ) 121 131 { … … 139 149 } 140 150 151 //checkbox 152 if( 1 != $options['img_thumbnail'] ) 153 unset($existing['img_thumbnail']); 154 141 155 return array_merge( $existing, $options ); 142 156 } 143 157 144 158 /* END APP SETTINGS FORM CALLBACKS */ 145 159 } -
rss-synchronization/trunk/includes/class-rss-sync-tools.php
r871375 r873981 13 13 14 14 /** 15 * Utility class for alot of this plugin's useful methods used throughout the plugin code. 15 * Utility class for alot of this plugin's useful methods used throughout the plugin code. 16 16 * 17 17 * @package RSS-Sync-Tools … … 19 19 */ 20 20 class RSS_Sync_Tools { 21 21 22 22 /** 23 23 * Instance of this class. … … 177 177 178 178 /** 179 * Handles creation and/or resolution of a category ID. 180 * 179 * Handles creation and/or resolution of a category ID. 180 * 181 181 * @since 0.4.0 182 182 */ … … 193 193 194 194 /** 195 * Handles extraction of post tags from a list of RSS item categories. 195 * Handles extraction of post tags from a list of RSS item categories. 196 196 * 197 197 */ … … 335 335 $this->url_remap[$headers['x-final-location']] = $upload['url']; 336 336 } 337 337 338 338 //add to media library 339 339 //Attachment options … … 346 346 $attach_data = wp_generate_attachment_metadata( $attach_id, $url ); 347 347 wp_update_attachment_metadata( $attach_id, $attach_data ); 348 //Set as featured image 349 set_post_thumbnail( $post_id, $attach_id ); 348 //Set as featured image? 349 $options = get_option( 'rss_sync' ); 350 if($options['img_thumbnail'] == 'yes'){ 351 set_post_thumbnail( $post_id, $attach_id ); 352 } 350 353 351 354 return $upload; -
rss-synchronization/trunk/public/class-rss-sync.php
r871375 r873981 29 29 * @var string 30 30 */ 31 const VERSION = '0.5. 2';31 const VERSION = '0.5.3'; 32 32 33 33 const RSS_ID_CUSTOM_FIELD = 'rss_id'; … … 216 216 * Fired for each blog when the plugin is activated. 217 217 * 218 * @since 0.2.0219 218 */ 220 219 private static function single_activate() { 221 220 222 221 $options = get_option( 'rss_sync' ); 223 222 … … 236 235 * Fired for each blog when the plugin is deactivated. 237 236 * 238 * @since 0.2.0239 237 */ 240 238 private static function single_deactivate() { 241 239 242 240 wp_clear_scheduled_hook( 'rss_sync_event' ); 243 244 241 } 245 242 … … 247 244 * Load the plugin text domain for translation. 248 245 * 249 * @since 1.0.0250 246 */ 251 247 public function load_plugin_textdomain() { … … 262 258 * Register and enqueue public-facing style sheet. 263 259 * 264 * @since 1.0.0265 260 */ 266 261 public function enqueue_styles() { … … 271 266 * Register and enqueues public-facing JavaScript files. 272 267 * 273 * @since 1.0.0274 268 */ 275 269 public function enqueue_scripts() { 276 wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'assets/js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION );270 //wp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'assets/js/public.js', __FILE__ ), array( 'jquery' ), self::VERSION ); 277 271 } 278 272 -
rss-synchronization/trunk/rss-sync.php
r871375 r873981 13 13 * Plugin Name: RSS Sync 14 14 * Description: Synchronize posts with external RSS feed. 15 * Version: 0.5. 216 * Author: Horta15 * Version: 0.5.3 16 * Author: lightsystem, log_oscon 17 17 * Text Domain: rss-sync 18 18 * License: GPL-2.0+
Note: See TracChangeset
for help on using the changeset viewer.