This WordPress plugin imports posts from CSV (Comma Separated Value) files into your
WordPress blog.
a CSV file and the plugin will take care of the rest.
ul>
This plugin is forked from https://wordpress.org/plugins/csv-importer/ by dvkob
此插件是dvkob从https://wordpress.org/plugins/csv-importer/派生的
in order to keep up with changes to the core WordPress.
为了跟上对核心WordPress的更改。 p>
This importer writes directly to the database.
此导入器直接写入数据库。
It does not go through the internal
它不通过内部
WordPress objects for creating posts etc. That may be an advantage to you (it will
用于创建帖子等的WordPress对象。这对您可能是一个优势(它将
be faster for large imports) but do be aware of any data integrity issues that may arrise.
对于大型导入,速度更快),但请注意可能会出现的任何数据完整性问题。 p>
Only UTF-8 encoding is supported, both with and without Byte Order Marks (BOM).
仅支持带或不带字节顺序标记(BOM)的UTF-8编码。 p>
The development repository for this plugin can be found here:
此插件的开发库可以在这里找到: p>
https://github.com/academe/csv-importer-improved
https://github.com/academe/csv-importer-improved p>
Please feel free to raise issues there, and submit pull requests, as well as through
请随时在此处提出问题,提交请求以及通过
the normal WordPress channels.
正常的WordPress渠道。 p>
Usage
用法 h3>
Click on the CSV Importer link on your WordPress admin page, choose the
点击WordPress管理页面上的CSV导入器链接,选择
file you would like to import and click Import.
您要导入的文件,然后单击导入。
The examples
directory
examples code>目录
inside the plugin’s directory contains several files that demonstrate
插件目录中包含几个演示
的文件
how to use the plugin.
如何使用插件。
The best way to get started is to import one of
最好的入门方法是导入
之一
these files and look at the results.
这些文件并查看结果。 p>
CSV is a tabular format that consists of rows and columns.
CSV是一种由行和列组成的表格格式。
Each row in
每行
a CSV file represents a post;
CSV文件代表帖子;
each column identifies a piece of information
每列标识一条信息
that comprises a post.
包含一个帖子。 p>
You can create new posts, or update existing posts by supplying the csv_post_id
您可以通过提供csv_post_id
创建新帖子或更新现有帖子
field pointing to an existing post.
指向现有帖子的字段。
When updating, all field names you provide
更新时,您提供的所有字段名称
in the CSV file will be updated – even if blank – but fields you don’t list at
CSV文件中的内容会更新-即使为空-但您未在
列出的字段
the head of the CSV file will be left intact.
CSV文件的头部将保持不变。 p>
Basic post information
基本信息 h4>
csv_post_id
– optional, used to update an existing post.-
csv_post_id code> –可选,用于更新现有帖子。 li>csv_post_title
– title of the post-
csv_post_title code> –帖子标题 li>csv_post_post
– body of the post-
csv_post_post code> –帖子正文 li>csv_post_type
– post
, page
or a custom post type.
-
csv_post_type code> – post code>, page code>或自定义帖子类型。
From 0.3.2, csv_post_type
column supports custom post types.
从0.3.2开始, csv_post_type code>列支持自定义帖子类型。
Refer to the WordPress
请参阅WordPress
documentation on custom post types for more info
有关自定义帖子类型的文档以获取更多信息
on how to set up custom post types.
有关如何设置自定义帖子类型的信息。 li>
csv_post_excerpt
– post excerpt-
csv_post_excerpt code> –摘录 li>csv_post_categories
– a comma separated list of category names or ids.
-
csv_post_categories code> –用逗号分隔的类别名称或ID列表。
The list must be enclosed in quotes, e.g.
该列表必须用引号引起来,例如
“EC > UK, Island”.
“ EC>英国,岛屿”。
If a chain of subcategories does not exist, e.g.
如果不存在子类别链,例如
Animalia > Chordata > Mammalia
Animalia> Chordata> Mammalia code>
then they will all be created and the post assigned to the end of the chain.
然后将它们全部创建,并将帖子分配到链的末尾。
The parent category can also be defined using its id, e.g.
父类别也可以使用其ID定义,例如
42 > Primates > Callitrichidae, where 42
is an
42>灵长类> Callitrichidae,其中 42 code>是
existing category id.
现有类别ID。 li>
csv_post_tags
– a “quoted” comma separated list of tags.-
csv_post_tags code> –用逗号分隔的标记列表。 li>csv_post_date
– most standard formats are supported.
-
csv_post_date code> –支持大多数标准格式。
For example, now
, 11/16/2009 0:00
, 1999-12-31 23:55:00
, +例如, now code>, 2009/11/16 0:00 code>, 1999-12-31 23:55:00 code>, + 1 week
,
1周 code>,
next Thursday, last year
are all valid.
下个星期四,去年 code>全部有效。For technical
对于技术
details, consult PHP's strtotime()
function documentation.
详细信息,请查阅PHP的 strtotime() code>函数文档。
li>
ul>
Custom fields
自定义字段 h4>
Any column that doesn’t start with csv_
is considered to be a custom field
任何以 csv _ code>开头的列均被视为自定义字段
name.
名称。
The data in that column will be imported as the custom fields value.
该列中的数据将作为自定义字段值导入。 p>
All custom fields must be unique.
所有自定义字段必须唯一。
Multiple fields with the same name will be
具有相同名称的多个字段将
updated to the same value if updating an existing post.
如果更新现有帖子,则更新为相同的值。
Prior to version 0.6.0 loading the same field name multiple times to an existing
在版本0.6.0之前,将相同的字段名称多次加载到现有的
post would create multiple custom fields.
帖子将创建多个自定义字段。 p>
General remarks
一般说明 h4>
- WordPress pages don’t have categories or tags.
- WordPress页面没有类别或标签。 li>
- Most columns are optional.
- 大多数列是可选的。
Either csv_post_title
, csv_post_post
or
csv_post_title code>, csv_post_post code>或
csv_post_excerpt are sufficient to create a post.
csv_post_excerpt足以创建一个帖子。
If all of these
如果所有这些
columns are empty in a row, the plugin will skip that row.
列连续为空,插件将跳过该行。 li>
- The plugin will attempt to reuse existing categories or tags;
- 该插件将尝试重用现有的类别或标签;
if an
如果
existing category or tag cannot be found, the plugin will create it.
找不到现有的类别或标签,插件将创建它。 li>
- To specify a category that has a greater than sign (>) in the name, use
- 要指定名称中带有大于号(>)的类别,请使用
the HTML entity >
HTML实体> code> li>
ul>
Advanced usage
高级用法 h4>
csv_post_author
– numeric user id or login name.-
csv_post_author code> –数字用户ID或登录名。If not specified or
如果未指定或
user does not exist, the plugin will assign the posts to the user
用户不存在,插件会将帖子分配给用户
performing the import.
执行导入。 li>
csv_post_slug
– post slug used in permalinks.-
csv_post_slug code> –永久链接中使用的后。 li>csv_post_parent
– post parent id.-
csv_post_parent code> –发布父ID。 li>
ul>
Custom taxonomies
自定义分类法 h3>
New in version 0.3.0
版本0.3.0的新功能 strong> p>Once custom taxonomies are set up in your theme’s functions.php file or
一旦在主题的functions.php文件或
中设置了自定义分类法,
by using a 3rd party plugin, csv_ctax_(taxonomy name)
columns can be
通过使用第三方插件, csv_ctax_(分类名称) code>列可以
used to assign imported data to the taxonomies.
用于将导入的数据分配给分类法。 p>
Non-hierarchical taxonomies
非分级分类法 strong> p>The syntax for non-hierarchical taxonomies is straightforward and is essentially
非分层分类法的语法很简单,并且本质上是
the same as the csv_post_tags
syntax.
与 csv_post_tags code>语法相同。 p>Hierarchical taxonomies
分级分类法 strong> p>The syntax for hierarchical taxonomies is more complicated.
层次分类法的语法更加复杂。
Each hierarchical
每个等级
taxonomy field is a tiny two-column CSV file, where the order of columns
分类字段是一个很小的两列CSV文件,其中列的顺序
matters
.
很重要 em>。
The first column contains the name of the parent term and the second
第一列包含父项的名称,第二列
column contains the name of the child term.
列包含子术语的名称。
Top level terms have to be preceded
顶级条款必须优先于
either by an empty string or a 0 (zero).
可以是空字符串,也可以是0(零)。 p>
Sample examples/custom-taxonomies.csv
file included with the plugin
插件随附的
示例 examples / custom-taxonomies.csv code>文件
illustrates custom taxonomy support.
说明了自定义分类支持。
To see how it works, make sure to set up
要查看其工作原理,请确保设置
custom taxonomies from functions.inc.php
.
functions.inc.php code>中的自定义分类法。 p>Make sure that the quotation marks used as text delimiters in csv_ctax_
确保在 csv_ctax _ code>
中用作文本定界符的引号columns are regular ASCII double quotes, not typographical quotes like “
列是常规的ASCII双引号,而不是“
”等印刷引号
(U+201C) and ” (U+201D).
(U + 201C)和”(U + 201D)。 p>
Comments
评论 h3>
New in version 0.3.1
0.3.1版的新功能 strong> p>An example file with comments is included in the examples
directory.
examples code>目录中包含带有注释的示例文件。
In short, comments can be imported along with posts by specifying columns
简而言之,可以通过指定列将评论与帖子一起导入
such as csv_comment_*_author
, csv_comment_*_content
etc, where * is
例如 csv_comment _ * _ author code>, csv_comment _ * _ content code>等,其中*是
a comment ID number.
评论ID号。
This ID doesn’t go into WordPress.
此ID不适用于WordPress。
It is only there
只有那里
to have the connection information in the CSV file.
在CSV文件中包含连接信息。 p>
Credits
积分 h3>
This plugin uses php-csv-parser by Kazuyoshi Tlacaelel.<
此插件使用Kazuyoshi Tlacaelel的 php-csv-parser 。<
br />
br />
It was inspired by JayBlogger's CSV Import plugin
它的灵感来自JayBlogger的 CSV导入插件
.
p>
Contributors:
贡献者: p>
- Kevin Hagerty (post_author support)
- Kevin Hagerty(作者后支持) li>
- Edir Pedro (root category option and tableless HTML markup)
- Edir Pedro(根类别选项和无表HTML标记) li>
- Frank Loeffler (comments support)
- 弗兰克·洛夫勒(评论支持) li>
- Micah Gates (subcategory syntax)
- Micah Gates(子类别语法) li>
- David Hollander (deprecation warnings, linebreak handling)
- David Hollander(弃用警告,换行处理) li>
ul>