説明
メディアライブラリへの画像登録
- EXIF 情報の日時に変更します。
兄弟版プラグイン
フィルターフック使用方法のサンプル
- サンプルスニペット
/** ==================================================
* Sample snippet for Upload Media Exif Date
*
* The original filter hook('umed_postdate'),
* Get the date and time from the file name when the date and time cannot be read from the EXIF.
*
* @param string $postdate postdate.
* @param string $filename filename.
*/
function umed_postdate_from_filename( $postdate, $filename ) {
/* Sample for 20191120_183022.jpg */
$year = substr( $filename, 0, 4 );
$month = substr( $filename, 4, 2 );
$day = substr( $filename, 6, 2 );
$hour = substr( $filename, 9, 2 );
$minute = substr( $filename, 11, 2 );
$second = substr( $filename, 13, 2 );
$postdate = $year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second;
return $postdate;
}
add_filter( 'umed_postdate', 'umed_postdate_from_filename', 10, 2 );
インストール
/wp-content/plugins/
ディレクトリ以下にupload-media-exif-date
ディレクトリをアップロードします。- WordPress の “プラグイン” メニューから有効化してください。
FAQ
ありません
貢献者と開発者
変更履歴
1.05
フィルターフック修正(’umed_postdate’)。
1.04
フィルターフック追加(’umed_postdate’)。
1.03
WordPress 5.6 に対応しました。
1.02
メタデータの問題を修正しました。
1.01
ファイルの移動の問題を修正しました。
1.00
初回リリース。