LoginSignup
2
1

More than 5 years have passed since last update.

Movable Type にて 記事に設定されたカスタムフィールドを取得する

Posted at

こんな感じで取れる。
ただし、カスタムフィールドに対応していないMTOSでは動かないので注意。

my $blog_id = (任意のblog id);
my @entries = MT::Entry->load( { blog_id => $blog_id } );
foreach my $entry ( @entries ){
    my $customfields = get_meta( $entry );
    while( my ( $custom_name, $custom_value ) = each %{ $customfields } ){
        print "title: " . $entry->title . "\n";
        print "name: $custom_name\n";
        print "value: $custom_value\n";
    } 
}

※とりあえずMTのソースを読んでやってみたんですが、もしマニュアルの「ここに書いてある!」ってのがあれば教えてください。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1