register_importer()
Registers importer for WordPress.
Хуков нет.
Возвращает
null|WP_Error
. Void on success. WP_Error when $callback is WP_Error.
Использование
register_importer( $id, $name, $description, $callback );
- $id(строка) (обязательный)
- Importer tag. Used to uniquely identify importer.
- $name(строка) (обязательный)
- Importer name and title.
- $description(строка) (обязательный)
- Importer description.
- $callback(callable) (обязательный)
- Callback to run.
Заметки
- Global. Массив. $wp_importers
Список изменений
С версии 2.0.0 | Введена. |
Код register_importer() register importer WP 6.5.2
function register_importer( $id, $name, $description, $callback ) { global $wp_importers; if ( is_wp_error( $callback ) ) { return $callback; } $wp_importers[ $id ] = array( $name, $description, $callback ); }