register_importer

函数


register_importer ( $id, $name, $description, $callback )
参数
  • (string)
    $id
    Importer tag. Used to uniquely identify importer.
    Required:
  • (string)
    $name
    Importer name and title.
    Required:
  • (string)
    $description
    Importer description.
    Required:
  • (callable)
    $callback
    Callback to run.
    Required:
返回值
  • (void|WP_Error) Void on success. WP_Error when $callback is WP_Error.
定义位置
  • wp-admin/includes/import.php
    , line 54
引入
2.0.0
弃用

为WordPress注册导入器。

function register_importer( $id, $name, $description, $callback ) {
	global $wp_importers;
	if ( is_wp_error( $callback ) ) {
		return $callback;
	}
	$wp_importers[ $id ] = array( $name, $description, $callback );
}