Changeset 1496066
- Timestamp:
- 09/15/2016 02:06:33 AM (9 years ago)
- Location:
- wp-sacloud-ojs/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-sacloud-ojs.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-sacloud-ojs/trunk/readme.txt
r1495668 r1496066 5 5 Requires at least: 4.5.3 6 6 Tested up to: 4.6.1 7 Stable tag: 0.0. 67 Stable tag: 0.0.7 8 8 License: GPLv2 or later. 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 52 0.0. 6 : アップロード先の年月ディレクトリ対応、キャッシュ配信関連バグ修正、移行手順追加52 0.0.7 : [srcset属性のURL書き換え対応](https://github.com/yamamoto-febc/wp-sacloud-ojs/releases/tag/v0.0.7) 53 53 54 0.0. 5 : WP-CLI対応、オプション値の内部構造変更、アップロード後のファイル削除オプション対応54 0.0.6 : [アップロード先の年月ディレクトリ対応、キャッシュ配信関連バグ修正、移行手順追加](https://github.com/yamamoto-febc/wp-sacloud-ojs/releases/tag/v0.0.6) 55 55 56 0.0. 4 : メディアファイル削除時のフィルタロジック修正56 0.0.5 : [WP-CLI対応、オプション値の内部構造変更、アップロード後のファイル削除オプション対応](https://github.com/yamamoto-febc/wp-sacloud-ojs/releases/tag/v0.0.5) 57 57 58 0.0. 3 : メディアファイル削除時にuploadsディレクトリ内にファイルが残存するバグを修正58 0.0.4 : [メディアファイル削除時のフィルタロジック修正](https://github.com/yamamoto-febc/wp-sacloud-ojs/releases/tag/v0.0.4) 59 59 60 0.0.2 : 再同期時にサムネイルを生成する機能追加 60 0.0.3 : [メディアファイル削除時にuploadsディレクトリ内にファイルが残存するバグを修正](https://github.com/yamamoto-febc/wp-sacloud-ojs/releases/tag/v0.0.3) 61 62 0.0.2 : [再同期時にサムネイルを生成する機能追加](https://github.com/yamamoto-febc/wp-sacloud-ojs/releases/tag/v0.0.2) 61 63 62 64 0.0.1 : 初回リリース -
wp-sacloud-ojs/trunk/wp-sacloud-ojs.php
r1495668 r1496066 8 8 * Author URI: https://github.com/yamamoto-febc 9 9 * Text Domain: wp-sacloud-ojs 10 * Version: 0.0. 610 * Version: 0.0.7 11 11 * License: GPLv2 12 12 */ … … 44 44 45 45 add_filter('wp_get_attachment_url', 'sacloudojs_object_storage_url'); 46 46 add_filter('wp_calculate_image_srcset', 'sacloudojs_calculate_image_srcset', 10, 5); 47 47 48 48 if (Wp_Sacloud_Ojs\Options::$Instance->DeleteObject === '1') { … … 333 333 } 334 334 335 // Return object URL(srcset) 336 function sacloudojs_calculate_image_srcset($sources, $size_array, $image_src, $image_meta, $attachment_id) 337 { 338 foreach ($sources as &$src) { 339 $url = $src['url']; 340 341 $object_name = __generate_object_name_from_url($url); 342 if ($object_name) { 343 $url = Wp_Sacloud_Ojs\Options::$Instance->getObjectURLByName($object_name); 344 $src['url'] = $url; 345 } 346 } 347 return $sources; 348 } 349 335 350 // -------------------- internal functions -------------------- 336 351 … … 352 367 return $container_name . $prefix . $name; 353 368 } 369 370 function __generate_object_name_from_url($url) 371 { 372 373 $dir = wp_upload_dir(); 374 $name = str_replace($dir['url'] . DIRECTORY_SEPARATOR , '' , $url); 375 376 $prefix = str_replace($dir['baseurl'] . DIRECTORY_SEPARATOR, '', $dir['url']) . DIRECTORY_SEPARATOR; 377 378 $container_name = Wp_Sacloud_Ojs\Options::$Instance->Container; 379 if ($container_name != "") { 380 $container_name .= "/"; 381 } 382 383 return $container_name . $prefix . $name; 384 385 } 386 354 387 355 388 function __get_attachment_id_from_url($url)
Note: See TracChangeset
for help on using the changeset viewer.