Skip to content

Instantly share code, notes, and snippets.

@hideki-a
Created November 25, 2015 09:38
Show Gist options
  • Select an option

  • Save hideki-a/9b030f14a4a61cbc8ccf to your computer and use it in GitHub Desktop.

Select an option

Save hideki-a/9b030f14a4a61cbc8ccf to your computer and use it in GitHub Desktop.
全てのブログに設定を適用するコードの例。
<mt:PerlScript>
use MT::Blog;
# ブログオブジェクトの読み込み
my @blogs = MT::Blog->load;
for my $blog (@blogs) {
# ------------------
# 設定変更
# ------------------
# アイテムアップロード時にアップロード先の変更を許可しない
$blog->allow_to_change_at_upload(0);
# 日本語ファイル名を自動で変換する
$blog->auto_rename_non_ascii(1);
# ------------------
# 設定保存
# ------------------
$blog->save();
}
</mt:PerlScript>
<mt:Ignore>
MTPerlScriptは以下を参照
http://www.h-fj.com/blog/archives/2008/12/02-090610.php
</mt:Ignore>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment