Доброго дня!
Пытаюсь проверить поле загрузки Gif файла (image_image) в форме перед отправкой.
Поля формы
public function structure(){
return [
"title" => [
"type" => "field",
"name" => "title",
"label" => __("Title", "plugin-name"),
"field_type" => "text",
"rules" => [
"required",
]
],
"gif" => [
"type" => "group",
"name" => "gif",
"fields" => [
"image_image" => [
"type" => "field",
"name" => "image_image",
"label" => __("Browse File", "plugin-name"),
"field_type" => "file",
"rules" => [
"extensions" => "gif,mp4",
"maxSize" => zf_get_option("zombify_max_upload_size") / 1024
],
"use_as_featured" => true
]
]
]
];
}
Проверка
class BBC_ZF_Tweaks {
public static function edit_gif_quiz_structure( $structure ) {
$structure[ 'gif/image_image' ] = true;
return $structure;
}
}
add_filter( 'plugin-name_structure_gif', array( 'BBC_ZF_Tweaks', 'edit_gif_quiz_structure' ), 10, 1 );