MT4で記事のデータをエクスポートする場合、すべての記事が一括してエクスポートされてしまいます。
そこで特定のカテゴリの記事だけをエクスポートする方法です。
こちらのサイトを参考にさせていただきました。
正夢ブログ http://blog.masaume.com/2011/08/07-193524.html
/lib/MT/ImportExport.pm 596行目あたり
my $res = $tmpl->build($ctx)
or return $class->error(MT->translate(
“Export failed on entry ‘[_1]‘: [_2]“, $entry->title,
$tmpl->errstr));
$cb->($res);
赤字の部分を下のように変える.
my $res = $tmpl->build($ctx)
or return $class->error(MT->translate(
“Export failed on entry ‘[_1]‘: [_2]“, $entry->title,
$tmpl->errstr));
my $cats = $entry->categories;
for my $c (@$cats) {
$cb->($res) if $c->id == 6};
最後の行の「6」はエクスポートしたいカテゴリのID番号です。