logo资料库

wordpress函数说明(已汉化中文).pdf

第1页 / 共30页
第2页 / 共30页
第3页 / 共30页
第4页 / 共30页
第5页 / 共30页
第6页 / 共30页
第7页 / 共30页
第8页 / 共30页
资料共30页,剩余部分请下载后查看
终于有人翻译成中文了,呵呵,以后开发更加方便~转载如下: Functions by category 分类函数 1、Post, Page, Attachment and Bookmarks Functions 文章,页面,附件和链接的函数 get_adjacent_post 返 回 邻 近 的 文 章 的 信 息 数 组 , 详 情 见 : http://codex.wordpress.org/Function_Reference/get_adjacent_post. get_children 检 索 附 件 、 版 本 、 子 页 面 等 信 息 , 一 般 情 况 下 由 父 文 章 执 行 , 详 情 见 : http://codex.wordpress.org/Function_Reference/get_children. get_extended 获取文章 more 标签分割的数组.$post 是文章的内容 get_next_post 获取下一篇邻近的文章信息. get_post 返回单篇文章的信息数组或对象,$id 是文章 id,注意这里只能用变量,详情见: http://codex.wordpress.org/Function_Reference/get_post. get_post_ancestors 返回基于文章 ID 的父文章的信息数组. get_post_mime_type 返回基于附件 ID 的方式类型信息. get_post_status 返回基于文章 ID 的文章状态. get_post_type 返回基于文章 ID 的文章类型.
get_previous_post 返回上一篇邻近的文章信息. get_posts 获取一系列文章的集合,详情见:http://codex.wordpress.org/Template_Tags/get_posts. is_post 已弃用. is_single 判断是否规定的单篇日志. is_sticky 判断文章是否置顶. register_post_type 注 册 发 布 情 类 型 , 详 见 : http://codex.wordpress.org/Function_Reference/register_post_type. wp_get_recent_posts 返回最近发布的文章数组. wp_get_single_post 返回单篇文章的的数组或对象,同 get_post(). wp_delete_post 删除文章、页面或附件,$force_delete 为 true 时不经过回收站. wp_insert_post 发 表 一 片 文 章 或 页 面 , 详 情 见 : http://codex.wordpress.org/Function_Reference/wp_insert_post. wp_publish_post
通过更改文章状态来发表文章 wp_update_post 更新一篇文章,详情见:http://codex.wordpress.org/Function_Reference/wp_update_post. get_all_page_ids 返回所有页面的数组. get_page 返 回 一 个 页 面 的 对 象 或 数 组 , 详 情 见 : http://codex.wordpress.org/Function_Reference/get_page. get_page_link 获取页面的链接,$id 是页面 ID,$leavename 判断是否允许使用页面名, $sample 判断 是否示例链接 get_page_by_path 获取一篇基于地址的页面对象或数组,$page_path 是页面地址,$output 指定输出类型是 否对象或数组,默认是对象. get_page_by_title 获取一篇基于标题的页面对象或数组,$page_title 是页面标题, $output 是输出类型, 默认对象, $post_type 是文章类型,默认 page. get_page_children 在编号相匹配的页面列表中检索子页面,$page_id 是父页面的 ID,$pages 是被检索的页 面数组. get_page_hierarchy 返回一个数组,该数组按页面排序次序进行排序,$posts 是页面的集合,$parent 是父 ID. get_page_uri 获取指定 Id 的页面 uri.
get_pages 获取页面的集合,详情见:http://codex.wordpress.org/Function_Reference/get_pages. is_page 判断是否当前或指定的页面. page_uri_index 为页面 URI 检索所有页面与附件。检索以页面为父级的文章的附件。 wp_list_pages 输 出 页 面 的 列 表 , $args 详 情 见 : http://codex.wordpress.org/Template_Tags/wp_list_pages. add_post_meta 为 指 定 文 章 添 加 自 定 义 ( meta ) 字 段 , 详 情 见 : http://codex.wordpress.org/Function_Reference/add_post_meta. delete_post_meta 从 指 定 文 章 中 删 除 含 有 指 定 关 键 字 的 所 有 自 定 义 字 段 , 详 情 见 : http://codex.wordpress.org/Function_Reference/delete_post_meta. get_post_custom 返回指定文章的自定义字段. get_post_custom_keys 获取指定文章的自定义字段名. get_post_custom_values 获取指定文章的自定义字段名的值. get_post_meta 返 回 指 定 文 章 中 含 有 指 定 关 键 字 自 定 义 字 段 的 值 , 详 情 见 : http://codex.wordpress.org/Function_Reference/get_post_meta.
update_post_meta 为指定文章更新自定义(meta)字段. get_attached_file 获取一个附件的地址.$attachment_id 是附件的 ID, $unfiltered 判断是否使用过滤器. is_attachment 判断附件是否被显示. is_local_attachment 判断 url 地址是否为本地的附件. update_attached_file 更新一个附件. $file 是附件地址 wp_attachment_is_image 判断指定的附件是否为图片. wp_insert_attachment 为 指 定 的 页 面 插 入 一 个 附 件 , 详 情 见 : http://codex.wordpress.org/Function_Reference/wp_insert_attachment. wp_delete_attachment 删除指定的附件,$postid 是附件 ID,$force_delete 为 true 时不经过回收站. wp_get_attachment_image 返回一个附件的 html,$attachment_id 是附件 ID,$size 是(thumbnail, medium, large or full),$icon 是替代的图标地址. wp_get_attachment_image_src 返回一个附件的 src,$attachment_id 是附件 ID,$size 是(thumbnail, medium, large or full), $icon 是替代的图标地址. wp_get_attachment_metadata
返回一个附件的元数据,$post_id 是附件 ID,$unfiltered 判断是否使用过滤器. wp_get_attachment_thumb_file 获取附件的缩略图地址. wp_get_attachment_thumb_url 获取附件缩略图地址. wp_get_attachment_url 获取附件的 url. wp_check_for_changed_slugs 检查已发表文章中经改动的缩略名并保存原有缩略名. wp_count_posts 输出文章的统计数组,type 为文章类型,’readable’是可读性. wp_mime_type_icon 检索 MIME 类型的图标. wp_update_attachment_metadata 更新指定附件的 MIME 类型. get_bookmark 获取一个链接的数组. $bookmark 是书签 ID, $output 是输出方式(OBJECT, ARRAY_N, or ARRAY_A). get_bookmarks 返 回 书 签 的 数 组 . 详 情 见 : $args http://codex.wordpress.org/Function_Reference/get_bookmarks. wp_list_bookmarks 输 出 书 签 的 数 组 . $args 详 情 见 :
http://codex.wordpress.org/Template_Tags/wp_list_bookmarks. 相关废弃标签: get_links_list() 和 get_links(). wp_get_post_categories 返回文章的类型 ID 数组. wp_set_post_categories 设置文章分类 ID. wp_get_post_tags 获取文章的标签 ID. wp_set_post_tags 设置文章的标签,$tags 是要添加的标签字符串数组,$append 默认为 false 覆盖已有标 签,true 为添加. wp_get_post_terms 获取文章的分类法数组, 默认是’post_tag’. wp_set_post_terms 设置文章的分类法,$tags 是要添加的标签字符串数组,$taxonomy 是分类方法,默认’ post_tag’,$append 默认为 false 覆盖已有标签,true 为添加. add_meta_box 插件开发者可通过该函数在 Write Post,Write Page 和 Write Link 编辑页面内添加版块. 详情见:http://codex.wordpress.org/Function_Reference/add_meta_box. get_the_ID 返回当前文章的 ID. get_the_author 获取文章的标签 ID. get_the_content
获取文章的内容,$more_link_text 是更多的链接文字, $stripteaser 在更多内容前显示内 容摘要, $more_file 可选,不使用. wp_trim_excerpt 必要时为文章生成内容摘要. 摘要应在 55 字以内,如果总字数多于该数目,摘要结尾 应添加字符串’[...]‘。如果少于 55 个字符,显示摘要全文。 2、Category, Tag and Taxonomy Functions 分类、标签和分类法函数 cat_is_ancestor_of 判断$cat1 是否为$cat2 的祖先分类. get_all_category_ids 返回所有分类的数组. get_cat_ID 根据分类名获取其 ID. get_cat_name 分居分类 ID 获取其名称. get_categories $args 详 情 见 : 返 回 多 个 分 类 的 数 组 . http://codex.wordpress.org/Function_Reference/get_categories. get_category 返回单个分类的详细信息对象或数组。 get_category_by_path 根据地址获取分类的详细信息对象或数组。 get_category_by_slug 根据别名获取分类的详细信息对象或数组。
分享到:
收藏