モジュールを作成せずにPHPコードを実行するにはどうすればよいですか?
いくつかのバンドルにフィールドを添付する必要があります。PHPスニペットは私のために仕事をするので、モジュールは必要ありません。以下のスニペットは実行する必要があるものです: $field_name = 'field_custom_image'; // Create the field. $field = array( 'field_name' => $field_name, 'type' => 'image', ); field_create_field($field); 次に、このフィールドをバンドルに追加するスニペット: // Create the instance. $instance = array( 'field_name' => $field_name, 'entity_type' => 'node', 'bundle' => 'article', 'label' => 'Image', 'description' => 'An image for the article.', 'required' => TRUE, ); …