• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「関数リファレンス」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(リンク微調整、原文・言語間リンク追加)
(最新 2008年4月3日 (木) 20:05 Stevish 版に更新、未翻訳)
1行目: 1行目:
 +
{{NeedTrans}}
 +
 
__NOTOC__
 
__NOTOC__
The files of WordPress define many useful PHP functions. Some of the functions, known as [[テンプレートタグ|Template Tags]], are defined especially for use in WordPress themes. There are also some functions related to actions and filters (the [[Plugin API]]), which are therefore used primarily for developing plugins. The rest are used to create the core WordPress functionality.
+
The files of WordPress define many useful PHP functions. Some of the functions, known as [[テンプレートタグ|Template Tags]], are defined especially for use in WordPress themes. There are also some functions related to actions and filters ([[プラグイン API]]), which are therefore used primarily for developing plugins. The rest are used to create the core WordPress functionality.
  
Many of the core WordPress functions may also be useful to plugin developers, and to a lesser extent, possibly theme developers as well. So, this article lists most of the core functions, by category; some of the function names are also links to more detailed documentation in separate pages. Each category also lists the files where its functions can be found (the files are in the <tt>wp-includes</tt> directory of WordPress).
+
Many of the core WordPress functions may also be useful to plugin developers, and to a lesser extent, possibly theme developers as well. So, this article lists most of the core functions, by category; some of the function names are also links to more detailed documentation in separate pages. Each category also lists the files where its functions can be found (the files are in the <code>wp-includes</code> directory of WordPress).
  
'''Note''': This reference applies to Version 2.1 of WordPress, and does not include functions that have been deprecated as of that version of WordPress. An incomplete page for the 2.0.x versions of WordPress can be found at [[:en:Function Reference 2.0.x]].
+
'''Note''': This reference applies to [[Version 2.1]] of WordPress, and does not include functions that have been deprecated as of that version of WordPress. An incomplete page for the 2.0.x versions of WordPress can be found at [[:en:Function Reference 2.0.x|Function Reference 2.0.x]].
  
'''Note''': Functions specifically for templates, which are listed in the [[テンプレートタグ|Template Tags]] article, and contained in files <tt>wp-includes/*_template.php</tt>, are not listed here.
+
'''Note''': Functions specifically for templates, which are listed in the [[テンプレートタグ|Template Tags]] article, and contained in files <code>wp-includes/*_template.php</code>, are not listed here.
  
 
'''Note''': the [http://planetozh.com/projects/wordpress-functions-history/ WordPress Functions History Tool] (unofficial tool) may help in finding when/if a function has been added/dropped.
 
'''Note''': the [http://planetozh.com/projects/wordpress-functions-history/ WordPress Functions History Tool] (unofficial tool) may help in finding when/if a function has been added/dropped.
21行目: 23行目:
 
* Correct errors by moving functions to better categories where appropriate, and of course fixing typos. Note that it is OK for a function to appear in more than one category.
 
* Correct errors by moving functions to better categories where appropriate, and of course fixing typos. Note that it is OK for a function to appear in more than one category.
  
Read [[Contributing to WordPress]] to find out more about how you can contribute to the effort!
+
Read [[WordPress への協力|Contributing to WordPress]] to find out more about how you can contribute to the effort!
  
 
</div>
 
</div>
36行目: 38行目:
 
== Post, Page, and Attachment Functions ==
 
== Post, Page, and Attachment Functions ==
  
These functions are contained in <tt>formatting.php</tt>, <tt>post.php</tt>. See also [[テンプレートタグ|Template Tags]].
+
These functions are contained in <code>formatting.php</code>, <code>post.php</code>. See also [[テンプレートタグ|Template Tags]].
  
* <tt>wp_trim_excerpt</tt>
+
* <code>wp_trim_excerpt</code>
* <tt>get_attached_file</tt>
+
* <code>get_attached_file</code>
* <tt>update_attached_file</tt>
+
* <code>update_attached_file</code>
* <tt>get_children</tt>
+
* <code>get_children</code>
* <tt>get_extended</tt>
+
* <code>get_extended</code>
* [[/get_post|get_post]] - get information on a specific post
+
* [[/get_post|get_post]] /[[:en:Function Reference/get_post|en]] - get information on a specific post
* [[/get_post_mime_type|get_post_mime_type($ID = "")]] - takes a post ID, returns its MIME type
+
* [[/get_post_mime_type|get_post_mime_type($ID = "")]] /[[:en:Function Reference/get_post_mime_type|en]] - takes a post ID, returns its MIME type
* <tt>get_post_status</tt>
+
* <code>get_post_status</code>
* <tt>get_post_type</tt>
+
* <code>get_post_type</code>
* [[テンプレートタグ/get posts|get_posts]]
+
* [[Template Tags/get posts|get_posts]]
* <tt>add_post_meta</tt>
+
* <code>add_post_meta</code>
* <tt>delete_post_meta</tt>
+
* <code>delete_post_meta</code>
* <tt>get_post_meta</tt>
+
* <code>get_post_meta</code>
* <tt>update_post_meta</tt>
+
* <code>update_post_meta</code>
* <tt>get_post_custom</tt>
+
* [[/get post custom|get_post_custom]] /[[:en:Function Reference/get post custom|en]] - retrieves custom fields from a post
* <tt>get_post_custom_keys</tt>
+
* [[/get post custom keys|get_post_custom_keys]] /[[:en:Function Reference/get post custom keys|en]]
* <tt>get_post_custom_values</tt>
+
* [[/get post custom values|get_post_custom_values]] /[[:en:Function Reference/get post custom values|en]]
* [[/wp_delete_post|wp_delete_post($postid)]] - A generic function to delete a post in the post table
+
* [[/wp_delete_post|wp_delete_post($postid)]] /[[:en:Function Reference/wp_delete_post|en]] - A generic function to delete a post in the post table
* [[/wp_get_post_categories|wp_get_post_categories($postid)]] - Retrieves an array of IDs of categories for a post
+
* [[/wp_get_post_categories|wp_get_post_categories($postid)]] /[[:en:Function Reference/wp_get_post_categories|en]] - Retrieves an array of IDs of categories for a post
* <tt>get_recent_posts</tt>
+
* <code>get_recent_posts</code>
* <tt>get_single_post</tt>
+
* <code>get_single_post</code>
* [[/wp_insert_post|wp_insert_post($postarr=array())]] - A generic function for inserting data into the post table
+
* [[/wp_insert_post|wp_insert_post($postarr=array())]] /[[:en:Function Reference/wp_insert_post|en]] - A generic function for inserting data into the post table
* [[/wp_update_post|wp_update_post($postarr=array())]] - A generic function to update data in the post table
+
* [[/wp_update_post|wp_update_post($postarr=array())]] /[[:en:Function Reference/wp_update_post|en]] - A generic function to update data in the post table
* [[/wp_publish_post|wp_publish_post($post_id)]] - Set a post's post_status to published. Calls <tt>wp_update_post</tt>.
+
* [[/wp_publish_post|wp_publish_post($post_id)]] /[[:en:Function Reference/wp_publish_post|en]] - Set a post's post_status to published. Calls <code>wp_update_post</code>.
* <tt>wp_set_post_categories</tt>
+
* <code>wp_set_post_categories</code>
* <tt>get_all_page_ids</tt>
+
* <code>get_all_page_ids</code>
* <tt>get_page</tt>
+
* <code>get_page</code>
* <tt>get_page_by_path</tt>
+
* <code>get_page_by_path</code>
* <tt>get_page_by_title</tt>
+
* <code>get_page_by_title</code>
* <tt>get_page_children</tt>
+
* <code>get_page_children</code>
* <tt>get_page_hierarchy</tt>
+
* <code>get_page_hierarchy</code>
* <tt>get_page_uri</tt>
+
* <code>get_page_uri</code>
* <tt>get_pages</tt>
+
* <code>get_pages</code>
* <tt>generate_page_uri_index</tt>
+
* <code>generate_page_uri_index</code>
* <tt>is_local_attachment</tt>
+
* <code>is_local_attachment</code>
* <tt>wp_insert_attachment</tt>
+
* <code>wp_insert_attachment</code>
* <tt>wp_delete_attachment</tt>
+
* <code>wp_delete_attachment</code>
* <tt>wp_get_attachment_metadata</tt>
+
* <code>wp_get_attachment_metadata</code>
* <tt>wp_update_attachment_metadata</tt>
+
* <code>wp_update_attachment_metadata</code>
* <tt>wp_get_attachment_url</tt>
+
* [[/wp_get_attachment_url|wp_get_attachment_url]] /[[:en:Function Reference/wp_get_attachment_url|en]]
* <tt>wp_get_attachment_thumb_file</tt>
+
* <code>wp_get_attachment_thumb_file</code>
* <tt>wp_get_attachment_thumb_url</tt>
+
* <code>wp_get_attachment_thumb_url</code>
* <tt>wp_attachment_is_image</tt>
+
* <code>wp_attachment_is_image</code>
* <tt>wp_mime_type_icon</tt>
+
* <code>wp_mime_type_icon</code>
* <tt>wp_check_for_changed_slugs</tt>
+
* <code>wp_check_for_changed_slugs</code>
  
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
90行目: 92行目:
 
Functions surrounding the WordPress Terms tables, encompassing categories and tags for classifying posts, pages, links, etc.
 
Functions surrounding the WordPress Terms tables, encompassing categories and tags for classifying posts, pages, links, etc.
  
Category functions in <tt>category.php</tt>.
+
Category functions in <code>category.php</code>.
  
* <tt>get_all_category_ids</tt>
+
* <code>get_all_category_ids</code>
* [[/get_categories|&get_categories($args=''''''')]]
+
* [[/get_categories|&get_categories($args=<nowiki>''</nowiki>)]] /[[:en:Function Reference/get_categories|en]]
* <tt>&get_category</tt>
+
* <code>&get_category</code>
* <tt>get_category_by_path</tt>
+
* <code>get_category_by_path</code>
* <tt>get_category_by_slug</tt>
+
* <code>get_category_by_slug</code>
* <tt>get_cat_ID($cat_name='General')</tt> - Get the ID of a category from its name
+
* <code>get_cat_ID($cat_name='General')</code> - Get the ID of a category from its name
* <tt>get_cat_name($cat_id)</tt> - get the name of a category from its ID
+
* <code>get_cat_name($cat_id)</code> - get the name of a category from its ID
* <tt>[[/cat_is_ancestor_of|cat_is_ancestor_of]]</tt>
+
* [[/cat_is_ancestor_of|cat_is_ancestor_of]] /[[:en:Function Reference/cat_is_ancestor_of|en]]
  
Tag Functions in <tt>category.php</tt>
+
Tag Functions in <code>category.php</code>
  
* <tt>&get_tags</tt>
+
* <code>&get_tags</code>
* <tt>&get_tag</tt>
+
* <code>&get_tag</code>
  
Term Functions in <tt>taxonomy.php</tt>
+
Term Functions in <code>taxonomy.php</code>
  
* <tt>is_taxonomy</tt> - Checks that the taxonomy name exists
+
* <code>is_taxonomy</code> - Checks that the taxonomy name exists
* <tt>is_taxonomy_hierarchical</tt> - Whether the taxonomy object is hierarchical
+
* <code>is_taxonomy_hierarchical</code> - Whether the taxonomy object is hierarchical
* <tt>&get_term</tt>
+
* <code>&get_term</code>
* <tt>get_term_by</tt>
+
* <code>get_term_by</code>
* <tt>get_term_children</tt> - Merge all term children into a single array.
+
* <code>get_term_children</code> - Merge all term children into a single array.
* <tt>&get_terms</tt>
+
* <code>&get_terms</code>
* <tt>is_term</tt> - Check if Term exists
+
* <code>is_term</code> - Check if Term exists
* <tt>wp_get_object_terms</tt> - Returns the terms associated with the given object(s), in the supplied taxonomies
+
* <code>wp_get_object_terms</code> - Returns the terms associated with the given object(s), in the supplied taxonomies
 +
 
 +
Other Category Functions
 +
 
 +
* [[/get_category_link | get_category_link($cat_id)]] /[[:en:Function Reference/get_category_link|en]] - Returns a category URL based on Category ID
  
  
123行目: 129行目:
 
==User and Author Functions==
 
==User and Author Functions==
  
These functions are in <tt>user.php, pluggable.php, registration.php</tt>. See also [[Template Functions]].
+
These functions are in <code>user.php, pluggable.php, registration.php</code>. See also [[テンプレートタグ|Template Functions]].
  
* <tt>get_profile</tt>
+
* <code>get_profile</code>
* [[/get_usernumposts|get_usernumposts]] &mdash; get post count for a specific user
+
* [[/get_usernumposts|get_usernumposts]] /[[:en:Function Reference/get_usernumposts|en]] &mdash; get post count for a specific user
* <tt>delete_usermeta</tt>
+
* [[/delete_usermeta|delete_usermeta]] /[[:en:Function Reference/delete_usermeta|en]] &mdash; remove a usermeta record by user ID
* [[/get_usermeta|get_usermeta]] &mdash; get meta data for a specific user
+
* [[/get_usermeta|get_usermeta]] /[[:en:Function Reference/get_usermeta|en]] &mdash; get meta data for a specific user
* [[/update_usermeta|update_usermeta]] &mdash; Updates a piece of user meta data.
+
* [[/update_usermeta|update_usermeta]] /[[:en:Function Reference/update_usermeta|en]] &mdash; Updates a piece of user meta data.
* <tt>set_current_user</tt>
+
* <code>set_current_user</code>
* <tt>wp_set_current_user</tt>
+
* <code>wp_set_current_user</code>
* <tt>wp_get_current_user</tt>
+
* <code>wp_get_current_user</code>
* [[/get_currentuserinfo|get_currentuserinfo]] &mdash; get information on the current user
+
* [[/get_currentuserinfo|get_currentuserinfo]] /[[:en:Function Reference/get_currentuserinfo|en]] &mdash; get information on the current user
* [[/get_userdata|get_userdata]] &mdash; get information on any user
+
* [[/get_userdata|get_userdata]] /[[:en:Function Reference/get_userdata|en]] &mdash; get information on any user
* <tt>get_userdatabylogin</tt>
+
* <code>get_userdatabylogin</code>
* <tt>wp_login</tt>
+
* <code>wp_login</code>
* <tt>is_user_logged_in</tt>
+
* [[/is_user_logged_in|is_user_logged_in]] /[[:en:Function Reference/is_user_logged_in|en]] &mdash; Checks whether the person viewing the page is logged in
* <tt>auth_redirect</tt>
+
* [[/auth redirect|auth_redirect]] /[[:en:Function Reference/auth redirect|en]] - Checks if a user is logged in, if not, redirects them to login page
* <tt>username_exists</tt>
+
* [[/username exists|username_exists]] /[[:en:Function Reference/username exists|en]] &mdash; Checks whether the given username exists
* <tt>email_exists</tt>
+
* <code>email_exists</code>
* <tt>validate_username</tt>
+
* <code>validate_username</code>
* <tt>wp_insert_user</tt>
+
* <code>wp_insert_user</code>
* <tt>wp_update_user</tt>
+
* <code>wp_update_user</code>
* [[/wp_create_user|wp_create_user]] &mdash; Create a user and add it to the user database.
+
* [[/wp_create_user|wp_create_user]] /[[:en:Function Reference/wp_create_user|en]] &mdash; Create a user and add it to the user database.
  
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
150行目: 156行目:
 
== Feed Functions ==
 
== Feed Functions ==
  
These functions are in <tt>functions.php</tt>, <tt>feed.php</tt>, <tt>rss.php</tt>
+
These functions are in <code>functions.php</code>, <code>feed.php</code>, <code>rss.php</code>
  
* [[/fetch_rss|fetch_rss]] -- retrieve an RSS feed from a URL with automatic caching (included in rss_functions.php)
+
* [[/fetch_rss|fetch_rss]] /[[:en:Function Reference/fetch_rss|en]] -- retrieve an RSS feed from a URL with automatic caching (included in rss_functions.php)
* [[/wp_rss|wp_rss]] -- retrieve and display an RSS feed as an unordered list (included in rss_functions.php)
+
* [[/wp_rss|wp_rss]] /[[:en:Function Reference/wp_rss|en]] -- retrieve and display an RSS feed as an unordered list (included in rss_functions.php)
* [[/get_rss|get_rss]] -- retrieve and display an RSS feed as a list (ordering optional) (included in rss_functions.php)
+
* [[/get_rss|get_rss]] /[[:en:Function Reference/get_rss|en]] -- retrieve and display an RSS feed as a list (ordering optional) (included in rss_functions.php)
* <tt>do_feed</tt>
+
* <code>do_feed</code>
* <tt>do_feed_rdf</tt>
+
* <code>do_feed_rdf</code>
* <tt>do_feed_rss</tt>
+
* <code>do_feed_rss</code>
* <tt>do_feed_rss2</tt>
+
* <code>do_feed_rss2</code>
* <tt>do_feed_atom</tt>
+
* <code>do_feed_atom</code>
* <tt>get_bloginfo_rss</tt>
+
* <code>get_bloginfo_rss</code>
* <tt>bloginfo_rss</tt>
+
* <code>bloginfo_rss</code>
* <tt>get_the_title_rss</tt>
+
* <code>get_the_title_rss</code>
* <tt>the_title_rss</tt>
+
* <code>the_title_rss</code>
* <tt>the_content_rss</tt>
+
* <code>the_content_rss</code>
* <tt>the_excerpt_rss</tt>
+
* <code>the_excerpt_rss</code>
* <tt>permalink_single_rss</tt>
+
* <code>permalink_single_rss</code>
* <tt>comment_link</tt>
+
* <code>comment_link</code>
* <tt>get_comment_author_rss</tt>
+
* <code>get_comment_author_rss</code>
* <tt>comment_author_rss</tt>
+
* <code>comment_author_rss</code>
* <tt>comment_text_rss</tt>
+
* <code>comment_text_rss</code>
* <tt>comments_rss_link</tt>
+
* <code>comments_rss_link</code>
* <tt>comments_rss</tt>
+
* <code>comments_rss</code>
* <tt>get_author_rss_link</tt>
+
* <code>get_author_rss_link</code>
* <tt>get_category_rss_link</tt>
+
* <code>[[/get_category_feed_link|get_category_rss_link]]</code> /[[:en:Function Reference/get_category_feed_link|en]]
* <tt>get_the_category_rss</tt>
+
* <code>[[/get_category_feed_link|get_category_feed_link]]</code> /[[:en:Function Reference/get_category_feed_link|en]](2.5 or later)
* <tt>the_category_rss</tt>
+
* <code>get_the_category_rss</code>
* <tt>rss_enclosure</tt>
+
* <code>the_category_rss</code>
 +
* <code>rss_enclosure</code>
 +
* <code>get_search_feed_link</code> (2.5 or later)
 +
* <code>get_search_comments_feed_link</code> (2.5 or later)
  
 
|- valign="top"
 
|- valign="top"
184行目: 193行目:
 
== Comment, Ping, and Trackback Functions ==
 
== Comment, Ping, and Trackback Functions ==
  
These functions are found in <tt>comment.php</tt>, <tt>functions.php</tt>, <tt>post.php</tt>. See also [[Template Functions]].
+
These functions are found in <code>comment.php</code>, <code>functions.php</code>, <code>post.php</code>. See also [[テンプレートタグ|Template Functions]].
  
* <tt>check_comment</tt>
+
* <code>check_comment</code>
* [[/get_approved_comments|get_approved_comments]]
+
* [[/get_approved_comments|get_approved_comments]] /[[:en:Function Reference/get_approved_comments|en]]
* <tt>get_comment</tt>
+
* [[/get_comment|get_comment]] /[[:en:Function Reference/get_comment|en]]
* <tt>get_lastcommentmodified</tt>
+
* <code>get_lastcommentmodified</code>
* <tt>sanitize_comment_cookies</tt>
+
* <code>sanitize_comment_cookies</code>
* <tt>wp_allow_comment</tt>
+
* <code>wp_allow_comment</code>
* <tt>wp_delete_comment</tt>
+
* <code>wp_delete_comment</code>
* <tt>wp_get_comment_status</tt>
+
* <code>wp_get_comment_status</code>
* <tt>wp_get_current_commenter</tt>
+
* <code>wp_get_current_commenter</code>
* <tt>wp_insert_comment</tt>
+
* <code>wp_insert_comment</code>
* <tt>wp_filter_comment</tt>
+
* <code>wp_filter_comment</code>
* <tt>wp_throttle_comment_flood</tt>
+
* <code>wp_throttle_comment_flood</code>
* <tt>wp_new_comment</tt>
+
* <code>wp_new_comment</code>
* <tt>wp_set_comment_status</tt>
+
* <code>wp_set_comment_status</code>
* <tt>wp_update_comment</tt>
+
* <code>wp_update_comment</code>
* <tt>wp_update_comment_count</tt>
+
* <code>wp_update_comment_count</code>
* <tt>discover_pingback_server_uri</tt>
+
* <code>discover_pingback_server_uri</code>
* <tt>do_all_pings</tt>
+
* <code>do_all_pings</code>
* <tt>do_trackbacks</tt>
+
* <code>do_trackbacks</code>
* <tt>generic_ping</tt>
+
* <code>generic_ping</code>
* <tt>pingback</tt>
+
* <code>pingback</code>
* <tt>privacy_ping_filter</tt>
+
* <code>privacy_ping_filter</code>
* <tt>trackback</tt>
+
* <code>trackback</code>
* <tt>weblog_ping</tt>
+
* <code>weblog_ping</code>
* <tt>do_enclose</tt>
+
* <code>do_enclose</code>
* <tt>add_ping</tt>
+
* <code>add_ping</code>
* <tt>get_enclosed</tt>
+
* <code>get_enclosed</code>
* <tt>get_pung</tt>
+
* <code>get_pung</code>
* <tt>get_to_ping</tt>
+
* <code>get_to_ping</code>
* <tt>trackback_url_list</tt>
+
* <code>trackback_url_list</code>
  
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
221行目: 230行目:
 
== Action, Filter, and Plugin Functions ==
 
== Action, Filter, and Plugin Functions ==
  
These functions are contained in <tt>plugin.php</tt>. See also [[Plugin API]].
+
These functions are contained in <code>plugin.php</code>. See also [[プラグイン API|Plugin API]].
  
* [[/add_filter|add_filter]]
+
* [[/add_filter|add_filter]] /[[:en:Function Reference/add_filter|en]]
* <tt>apply_filters</tt>
+
* [[/apply_filters|apply_filters]] /[[:en:Function Reference/apply_filters|en]]
* <tt>merge_filters</tt>
+
* [[/merge_filters|merge_filters]] /[[:en:Function Reference/merge_filters|en]]
* <tt>remove_filter</tt>
+
* [[/remove_filter|remove_filter]] /[[:en:Function Reference/remove_filter|en]]
* [[/add_action|add_action]]
+
* [[/add_action|add_action]] /[[:en:Function Reference/add_action|en]]
* [[/do_action|do_action]]
+
* [[/do_action|do_action]] /[[:en:Function Reference/do_action|en]]
* <tt>did_action</tt>
+
* [[/did_action|did_action]] /[[:en:Function Reference/did_action|en]]
* <tt>do_action_ref_array</tt>
+
* [[/do_action_ref_array|do_action_ref_array]] /[[:en:Function Reference/do_action_ref_array|en]]
* <tt>remove_action</tt>
+
* [[/remove_action|remove_action]] /[[:en:Function Reference/remove_action|en]]
* <tt>plugin_basename</tt>
+
* [[/plugin_basename|plugin_basename]] /[[:en:Function Reference/plugin_basename|en]]
* [[/register_activation_hook|register_activation_hook]]
+
* [[/register_activation_hook|register_activation_hook]] /[[:en:Function Reference/register_activation_hook|en]]
* [[/register_deactivation_hook|register_deactivation_hook]]
+
* [[/register_deactivation_hook|register_deactivation_hook]] /[[:en:Function Reference/register_deactivation_hook|en]]
  
 
|- valign="top"
 
|- valign="top"
241行目: 250行目:
 
== Theme-Related Functions ==
 
== Theme-Related Functions ==
  
These functions are found in <tt>theme.php</tt>.
+
These functions are found in <code>theme.php</code>.
  
* <tt>get_stylesheet</tt>
+
* <code>get_stylesheet</code>
* <tt>get_stylesheet_directory</tt>
+
* <code>get_stylesheet_directory</code>
* <tt>get_stylesheet_directory_uri</tt>
+
* <code>get_stylesheet_directory_uri</code>
* <tt>get_stylesheet_uri</tt>
+
* <code>get_stylesheet_uri</code>
* <tt>get_locale_stylesheet_uri</tt>
+
* <code>get_locale_stylesheet_uri</code>
* <tt>get_template</tt>
+
* <code>get_template</code>
* <tt>get_template_directory</tt>
+
* <code>get_template_directory</code>
* <tt>get_template_directory_uri</tt>
+
* <code>get_template_directory_uri</code>
* [[/get_theme_data|get_theme_data]]
+
* [[/get_theme_data|get_theme_data]] /[[:en:Function Reference/get_theme_data|en]]
* <tt>get_themes</tt>
+
* <code>get_themes</code>
* <tt>get_theme</tt>
+
* <code>get_theme</code>
* <tt>get_current_theme</tt>
+
* <code>get_current_theme</code>
* <tt>get_theme_root</tt>
+
* <code>get_theme_root</code>
* <tt>get_theme_root_uri</tt>
+
* <code>get_theme_root_uri</code>
* <tt>get_query_template</tt>
+
* <code>get_query_template</code>
* <tt>get_404_template</tt>
+
* <code>get_404_template</code>
* <tt>get_archive_template</tt>
+
* <code>get_archive_template</code>
* <tt>get_author_template</tt>
+
* <code>get_author_template</code>
* <tt>get_category_template</tt>
+
* <code>get_category_template</code>
* <tt>get_date_template</tt>
+
* <code>get_date_template</code>
* <tt>get_home_template</tt>
+
* <code>get_home_template</code>
* <tt>get_page_template</tt>
+
* <code>get_page_template</code>
* <tt>get_paged_template</tt>
+
* <code>get_paged_template</code>
* <tt>get_search_template</tt>
+
* <code>get_search_template</code>
* <tt>get_single_template</tt>
+
* <code>get_single_template</code>
* <tt>get_attachment_template</tt>
+
* <code>get_attachment_template</code>
* <tt>get_comments_popup_template</tt>
+
* <code>get_comments_popup_template</code>
* <tt>load_template</tt>
+
* <code>load_template</code>
* <tt>locale_stylesheet</tt>
+
* <code>locale_stylesheet</code>
* <tt>validate_current_theme</tt>
+
* <code>validate_current_theme</code>
* <tt>get_theme_mod</tt>
+
* <code>get_theme_mod</code>
* <tt>set_theme_mod</tt>
+
* <code>set_theme_mod</code>
* <tt>get_header_textcolor</tt>
+
* <code>get_header_textcolor</code>
* <tt>get_header_image</tt>
+
* <code>get_header_image</code>
* <tt>header_image</tt>
+
* <code>header_image</code>
* <tt>add_custom_image_header</tt>
+
* <code>add_custom_image_header</code>
  
  
285行目: 294行目:
 
== Formatting Functions ==
 
== Formatting Functions ==
  
These functions are contained in <tt>formatting.php</tt>, <tt>functions.php</tt>, <tt>kses.php</tt>.
+
These functions are contained in <code>formatting.php</code>, <code>functions.php</code>, <code>kses.php</code>.
  
* [[/wptexturize|wptexturize( $text )]]
+
* [[/wptexturize|wptexturize( $text )]] /[[:en:Function Reference/wptexturize|en]]
* [[/clean_pre|clean_pre( $text )]] - Returns the text without BR tags, and with P tags turned into line-breaks
+
* [[/clean_pre|clean_pre( $text )]] /[[:en:Function Reference/clean_pre|en]] - Returns the text without BR tags, and with P tags turned into line-breaks
* [[/wpautop|wpautop( $pee, $br = 1 )]] - Returns the text with HTML formatting for paragraphs
+
* [[/wpautop|wpautop( $pee, $br = 1 )]] /[[:en:Function Reference/wpautop|en]] - Returns the text with HTML formatting for paragraphs
* [[/seems_utf8|seems_utf8($Str)]] - Returns true if given string seems like it is UTF8-encoded
+
* [[/seems_utf8|seems_utf8($Str)]] /[[:en:Function Reference/seems_utf8|en]] - Returns true if given string seems like it is UTF8-encoded
* [[/wp_specialchars|wp_specialchars( $text, $quotes = 0 )]] - Like the PHP function htmlspecialchars except it doesn't double-encode HTML entities
+
* [[/wp_specialchars|wp_specialchars( $text, $quotes = 0 )]] /[[:en:Function Reference/wp_specialchars|en]] - Like the PHP function htmlspecialchars except it doesn't double-encode HTML entities
* <tt>utf8_uri_encode</tt>
+
* <code>utf8_uri_encode</code>
* [[/remove_accents|remove_accents($string)]] - Returns a string with accents or umlauts without these
+
* [[/remove_accents|remove_accents($string)]] /[[:en:Function Reference/remove_accents|en]] - Returns a string with accents or umlauts without these
* <tt>sanitize_file_name</tt>
+
* <code>sanitize_file_name</code>
* [[/sanitize_user|sanitize_user( $username, $strict = false )]] - Makes the username more machine-readable. Strict option for pure ASCII only.
+
* [[/sanitize_user|sanitize_user( $username, $strict = false )]] /[[:en:Function Reference/sanitize_user|en]] - Makes the username more machine-readable. Strict option for pure ASCII only.
* [[/sanitize_title|sanitize_title($title, $fallback_title = '')]]
+
* [[/sanitize_title|sanitize_title($title, $fallback_title = '')]] /[[:en:Function Reference/sanitize_title|en]]
* [[/sanitize_title_with_dashes|sanitize_title_with_dashes($title)]]
+
* [[/sanitize_title_with_dashes|sanitize_title_with_dashes($title)]] /[[:en:Function Reference/sanitize_title_with_dashes|en]]
* [[/convert_chars|convert_chars($content, $flag = 'obsolete')]] - Translation of invalid Unicode references range to valid range
+
* [[/convert_chars|convert_chars($content, $flag = 'obsolete')]] /[[:en:Function Reference/convert_chars|en]] - Translation of invalid Unicode references range to valid range
* <tt>funky_javascript_fix</tt>
+
* <code>funky_javascript_fix</code>
* [[/balanceTags|balanceTags($text, $is_comment = 0)]] - Balances Tags of string using a modified stack. Can be disabled by configuration.
+
* [[/balanceTags|balanceTags($text, $is_comment = 0)]] /[[:en:Function Reference/balanceTags|en]] - Balances Tags of string using a modified stack. Can be disabled by configuration.
* <tt>force_balance_tags</tt>
+
* [[/force_balance_tags|force_balance_tags]] /[[:en:Function Reference/force_balance_tags|en]]
* <tt>format_to_edit</tt>
+
* <code>format_to_edit</code>
* <tt>format_to_post</tt>
+
* <code>format_to_post</code>
* [[/zeroise|zeroise($number,$threshold)]] - Adds leading zeros when necessary
+
* [[/zeroise|zeroise($number,$threshold)]] /[[:en:Function Reference/zeroise|en]] - Adds leading zeros when necessary
* <tt>backslashit</tt>
+
* <code>backslashit</code>
* <tt>trailingslashit</tt>
+
* <code>trailingslashit</code>
* <tt>addslashes_gpc</tt>
+
* <code>addslashes_gpc</code>
* <tt>stripslashes_deep</tt>
+
* <code>stripslashes_deep</code>
* <tt>antispambot</tt> - converts email address to anti-spam version
+
* <code>antispambot</code> - converts email address to anti-spam version
* <tt>make_clickable</tt>
+
* <code>make_clickable</code>
* <tt>wp_rel_nofollow</tt>
+
* <code>wp_rel_nofollow</code>
* <tt>convert_smilies</tt>
+
* <code>convert_smilies</code>
* <tt>is_email</tt>
+
* <code>is_email</code>
* <tt>wp_iso_descrambler</tt>
+
* <code>wp_iso_descrambler</code>
* <tt>popuplinks</tt> - converts a link into a popup link that will open in a different window
+
* <code>popuplinks</code> - converts a link into a popup link that will open in a different window
* <tt>sanitize_email</tt>
+
* <code>sanitize_email</code>
* [[/ent2ncr|ent2ncr($text)]]  - Returns HTML entity as its number representation.
+
* [[/ent2ncr|ent2ncr($text)]] /[[:en:Function Reference/ent2ncr|en]]  - Returns HTML entity as its number representation.
* <tt>wp_richedit_pre</tt>
+
* <code>wp_richedit_pre</code>
* <tt>clean_url</tt>
+
* <code>clean_url</code>
* <tt>htmlentities2</tt>
+
* <code>htmlentities2</code>
* <tt>js_escape</tt>
+
* <code>js_escape</code>
* <tt>attribute_escape</tt>
+
* <code>attribute_escape</code>
* <tt>wp_make_link_relative</tt> - makes an absolute link into a relative link
+
* <code>wp_make_link_relative</code> - makes an absolute link into a relative link
* <tt>add_magic_quotes</tt>
+
* <code>add_magic_quotes</code>
* <tt>wp_kses</tt>
+
* [[/wp_kses|wp_kses]] /[[:en:Function Reference/wp_kses|en]]
* <tt>wp_kses_hook</tt>
+
* <code>wp_kses_hook</code>
* <tt>wp_kses_version</tt>
+
* <code>wp_kses_version</code>
* <tt>wp_kses_split</tt>
+
* <code>wp_kses_split</code>
* <tt>wp_kses_split2</tt>
+
* <code>wp_kses_split2</code>
* <tt>wp_kses_attr</tt>
+
* <code>wp_kses_attr</code>
* <tt>wp_kses_hair</tt>
+
* <code>wp_kses_hair</code>
* <tt>wp_kses_check_attr_val</tt>
+
* <code>wp_kses_check_attr_val</code>
* <tt>wp_kses_bad_protocol</tt>
+
* <code>wp_kses_bad_protocol</code>
* <tt>wp_kses_no_null</tt>
+
* <code>wp_kses_no_null</code>
* <tt>wp_kses_strip_slashes</tt>
+
* <code>wp_kses_strip_slashes</code>
* <tt>wp_kses_array_lc</tt>
+
* <code>wp_kses_array_lc</code>
* <tt>wp_kses_js_entities</tt>
+
* <code>wp_kses_js_entities</code>
* <tt>wp_kses_html_error</tt>
+
* <code>wp_kses_html_error</code>
* <tt>wp_kses_bad_protocol_once</tt>
+
* <code>wp_kses_bad_protocol_once</code>
* <tt>wp_kses_bad_protocol_once2</tt>
+
* <code>wp_kses_bad_protocol_once2</code>
* <tt>wp_kses_normalize_entities</tt>
+
* <code>wp_kses_normalize_entities</code>
* <tt>wp_kses_normalize_entities2</tt>
+
* <code>wp_kses_normalize_entities2</code>
* <tt>wp_kses_decode_entities</tt>
+
* <code>wp_kses_decode_entities</code>
* <tt>wp_filter_kses</tt>
+
* <code>wp_filter_kses</code>
* <tt>wp_filter_post_kses</tt>
+
* <code>wp_filter_post_kses</code>
* <tt>wp_filter_nohtml_kses</tt>
+
* <code>wp_filter_nohtml_kses</code>
  
 
|- valign="top"
 
|- valign="top"
353行目: 362行目:
 
== Miscellaneous Functions ==
 
== Miscellaneous Functions ==
  
These functions are contained in <tt>formatting.php</tt>, <tt>functions.php</tt>, <tt>bookmarks.php</tt>, <tt>cron.php</tt>, <tt>l10n.php</tt>, <tt>user.php</tt>, <tt>pluggable.php</tt>
+
These functions are contained in <code>formatting.php</code>, <code>functions.php</code>, <code>bookmarks.php</code>, <code>cron.php</code>, <code>l10n.php</code>, <code>user.php</code>, <code>pluggable.php</code>
  
 
Time/Date Functions
 
Time/Date Functions
  
* <tt>get_gmt_from_date</tt>
+
* <code>get_gmt_from_date</code> - Changes timezone for a datetime string, from local time to gmt.
* <tt>get_date_from_gmt</tt>
+
* <code>get_date_from_gmt</code> - Changes timezone for a datetime string, from gmt to local time.
* <tt>iso8601_timezone_to_offset</tt>
+
* <code>iso8601_timezone_to_offset</code>
* <tt>iso8601_to_datetime</tt>
+
* <code>iso8601_to_datetime</code>
* <tt>human_time_diff</tt>
+
* <code>human_time_diff</code>
* <tt>mysql2date</tt>
+
* <code>mysql2date</code>
* [[/current time|current_time]]
+
* [[/current time|current_time]] /[[:en:Function Reference/current time|en]]
* <tt>date_i18n</tt>
+
* <code>date_i18n</code>
* <tt>get_weekendstartend</tt>
+
* <code>get_weekendstartend</code>
* <tt>get_lastpostdate</tt>
+
* <code>get_lastpostdate</code>
* <tt>get_lastpostmodified</tt>
+
* <code>get_lastpostmodified</code>
* <tt>is_new_day</tt>
+
* <code>is_new_day</code>
  
 
Serialization
 
Serialization
  
* <tt>maybe_serialize</tt>
+
* <code>maybe_serialize</code>
* <tt>maybe_unserialize</tt>
+
* <code>maybe_unserialize</code>
* <tt>is_serialized</tt>
+
* <code>is_serialized</code>
* <tt>is_serialized_string</tt>
+
* <code>is_serialized_string</code>
  
 
Options
 
Options
  
* [[/get option|get_option]]
+
* [[/get option|get_option]] /[[:en:Function Reference/get option|en]]
* [[/form option|form_option]]
+
* [[/form option|form_option]] /[[:en:Function Reference/form option|en]]
* <tt>get_alloptions</tt>
+
* <code>get_alloptions</code>
* [[/update option|update_option]]
+
* [[/update option|update_option]] /[[:en:Function Reference/update option|en]]
* [[/add option|add_option]]
+
* [[/add option|add_option]] /[[:en:Function Reference/add option|add_option]]
* [[/delete option|delete_option]]
+
* [[/delete option|delete_option]] /[[:en:Function Reference/delete option|en]]
* <tt>get_user_option</tt>
+
* <code>get_user_option</code>
* <tt>update_user_option</tt>
+
* <code>update_user_option</code>
  
 
XMLRPC
 
XMLRPC
  
* <tt>xmlrpc_getposttitle</tt>
+
* <code>xmlrpc_getposttitle</code>
* <tt>xmlrpc_getpostcategory</tt>
+
* <code>xmlrpc_getpostcategory</code>
* <tt>xmlrpc_removepostdata</tt>
+
* <code>xmlrpc_removepostdata</code>
* <tt>user_pass_ok</tt>
+
* <code>user_pass_ok</code>
  
 
Localization
 
Localization
399行目: 408行目:
 
See also [[Translating WordPress]].
 
See also [[Translating WordPress]].
  
* <tt>get_locale</tt>
+
* <code>get_locale</code>
* <tt>__</tt>
+
* <code>__</code>
* <tt>_e</tt>
+
* <code>_e</code>
* <tt>_ngettext</tt>
+
* <code>_ngettext</code>
* <tt>load_textdomain</tt>
+
* <code>load_textdomain</code>
* <tt>load_default_textdomain</tt>
+
* <code>load_default_textdomain</code>
* <tt>load_plugin_textdomain</tt>
+
* <code>load_plugin_textdomain</code>
* <tt>load_theme_textdomain</tt>
+
* <code>load_theme_textdomain</code>
  
 
Cron (Scheduling)
 
Cron (Scheduling)
  
* <tt>[[/wp_schedule_single_event|wp_schedule_single_event]]</tt>
+
* [[/wp_schedule_single_event|wp_schedule_single_event]] /[[:en:Function Reference/wp_schedule_single_event|en]]
* <tt>[[/wp_schedule_event|wp_schedule_event]]</tt>
+
* [[/wp_schedule_event|wp_schedule_event]] /[[:en:Function Reference/wp_schedule_event|en]]
* <tt>wp_reschedule_event</tt>
+
* <code>wp_reschedule_event</code>
* <tt>[[/wp_unschedule_event|wp_unschedule_event]]</tt>
+
* [[/wp_unschedule_event|wp_unschedule_event]] /[[:en:Function Reference/wp_unschedule_event|en]]
* <tt>[[/wp_clear_scheduled_hook|wp_clear_scheduled_hook]]</tt>
+
* [[/wp_clear_scheduled_hook|wp_clear_scheduled_hook]] /[[:en:Function Reference/wp_clear_scheduled_hook|en]]
* <tt>[[/wp_next_scheduled|wp_next_scheduled]]</tt>
+
* [[/wp_next_scheduled|wp_next_scheduled]] /[[:en:Function Reference/wp_next_scheduled|en]]
* <tt>spawn_cron</tt>
+
* <code>spawn_cron</code>
* <tt>wp_cron</tt>
+
* <code>wp_cron</code>
* <tt>wp_get_schedules</tt>
+
* <code>wp_get_schedules</code>
* <tt>wp_get_schedule</tt>
+
* <code>wp_get_schedule</code>
  
 
Miscellaneous
 
Miscellaneous
  
* <tt>gzip_compression</tt>
+
* <code>gzip_compression</code>
* <tt>make_url_footnote</tt>
+
* <code>make_url_footnote</code>
* <tt>wp_get_http_headers</tt>
+
* <code>wp_get_http_headers</code>
* <tt>add_query_arg</tt>
+
* <code>add_query_arg</code>
* <tt>remove_query_arg</tt>
+
* <code>remove_query_arg</code>
* <tt>wp_remote_fopen</tt>
+
* <code>wp_remote_fopen</code>
* <tt>wp</tt>
+
* <code>wp</code>
* <tt>status_header</tt>
+
* <code>status_header</code>
* <tt>nocache_headers</tt>
+
* <code>nocache_headers</code>
* <tt>cache_javascript_headers</tt>
+
* <code>cache_javascript_headers</code>
* <tt>get_num_queries</tt>
+
* <code>get_num_queries</code>
* <tt>bool_from_yn</tt> - converts a "Y/N" variable into boolean true/false
+
* <code>bool_from_yn</code> - converts a "Y/N" variable into boolean true/false
* <tt>do_robots</tt>
+
* <code>do_robots</code>
* <tt>is_blog_installed</tt>
+
* <code>is_blog_installed</code>
* <tt>wp_nonce_url</tt>
+
* <code>wp_nonce_url</code>
* <tt>wp_nonce_field</tt>
+
* <code>wp_nonce_field</code>
* <tt>wp_referer_field</tt>
+
* <code>wp_referer_field</code>
* <tt>wp_original_referer_field</tt>
+
* <code>wp_original_referer_field</code>
* <tt>wp_get_referer</tt>
+
* <code>wp_get_referer</code>
* <tt>wp_get_original_referer</tt>
+
* <code>wp_get_original_referer</code>
* <tt>wp_mkdir_p</tt>
+
* <code>wp_mkdir_p</code>
* <tt>wp_upload_dir</tt>
+
* <code>wp_upload_dir</code>
* <tt>wp_upload_bits</tt>
+
* <code>wp_upload_bits</code>
* <tt>wp_check_filetype</tt>
+
* <code>wp_check_filetype</code>
* <tt>wp_explain_nonce</tt>
+
* <code>wp_explain_nonce</code>
* <tt>wp_nonce_ays</tt>
+
* <code>wp_nonce_ays</code>
* <tt>wp_die</tt>
+
* <code>wp_die</code>
* <tt>get_bookmark</tt>
+
* <code>get_bookmark</code>
* <tt>get_bookmarks</tt>
+
* <code>get_bookmarks</code>
* [[/wp mail|wp_mail]]
+
* [[/wp mail|wp_mail]] /[[:en:Function Reference/wp mail|en]]
* <tt>check_admin_referer</tt>
+
* <code>check_admin_referer</code>
* <tt>check_ajax_referer</tt>
+
* <code>check_ajax_referer</code>
* <tt>wp_redirect</tt>
+
* [[/wp_redirect|wp_redirect]] /[[:en:Function Reference/wp_redirect|en]]
* <tt>wp_get_cookie_login</tt>
+
* <code>wp_get_cookie_login</code>
* <tt>wp_setcookie</tt>
+
* <code>wp_setcookie</code>
* <tt>wp_clearcookie</tt>
+
* <code>wp_clearcookie</code>
* <tt>wp_notify_postauthor</tt>
+
* <code>wp_notify_postauthor</code>
* <tt>wp_notify_moderator</tt>
+
* <code>wp_notify_moderator</code>
* <tt>wp_new_user_notification</tt>
+
* <code>wp_new_user_notification</code>
* <tt>wp_verify_nonce</tt>
+
* <code>wp_verify_nonce</code>
* <tt>wp_create_nonce</tt>
+
* <code>wp_create_nonce</code>
* <tt>wp_salt</tt>
+
* <code>wp_salt</code>
* <tt>wp_hash</tt>
+
* <code>wp_hash</code>
  
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
471行目: 480行目:
 
== Classes ==
 
== Classes ==
  
The following classes were created by WordPress developers, and are found in files <tt>capabilities.php</tt>,  
+
The following classes were created by WordPress developers, and are found in files <code>capabilities.php</code>,  
<tt>classes.php</tt>, <tt>class-snoopy.php</tt>, <tt>locale.php</tt>, <tt>query.php</tt>, <tt>rewrite.php</tt>, <tt>script-loader.php</tt>, <tt>wp-db.php</tt>:
+
<code>classes.php</code>, <code>class-snoopy.php</code>, <code>locale.php</code>, <code>query.php</code>, <code>rewrite.php</code>, <code>script-loader.php</code>code>, <code>wp-db.php</code>:
  
 
* WP - general request handling
 
* WP - general request handling
 
* WP_Ajax_Response - AJAX handling
 
* WP_Ajax_Response - AJAX handling
* [[/WP_Cache|WP_Object_Cache]] (formerly <tt>WP_Cache</tt>) - Object cache (and functions <tt>wp_cache_add, wp_cache_close, wp_cache_delete, wp_cache_flush, wp_cache_get, wp_cache_init, wp_cache_replace, wp_cache_set</tt>)
+
* [[/WP_Cache|WP_Object_Cache]] /[[:en:Function Reference/WP_Cache|en]] (formerly <code>WP_Cache</code>) - Object cache (and functions <code>wp_cache_add, wp_cache_close, wp_cache_delete, wp_cache_flush, wp_cache_get, wp_cache_init, wp_cache_replace, wp_cache_set</code>)
* WP_Error - error handling (and function <tt>is_wp_error</tt>)
+
* WP_Error - error handling (and function <code>is_wp_error</code>)
* <tt>WP_Locale</tt> - handles date and time locales
+
* <code>WP_Locale</code> - handles date and time locales
* [[/WP_Query|WP_Query]] - Request parsing and manipulation, posts fetching (with functions <tt>get_query_var, [[テンプレートタグ/query posts|query_posts]], have_posts, in_the_loop, rewind_posts, the_post, wp_old_slug_redirect, setup_postdata</tt>, as well as the [[Conditional Tags]] <tt>is_*</tt>)
+
* [[/WP_Query|WP_Query]] /[[:en:Function Reference/WP_Query|en]] - Request parsing and manipulation, posts fetching (with functions <code>get_query_var, [[テンプレートタグ/query posts|query_posts]], have_posts, in_the_loop, rewind_posts, the_post, wp_old_slug_redirect, setup_postdata</code>, as well as the [[Conditional Tags]] <code>is_*</code>)
* [[/WP_Rewrite|WP_Rewrite]] - Rewrite rules (and functions <tt>add_rewrite_rule, add_rewrite_tag, add_feed, add_rewrite_endpoint, url_to_postid</tt>)
+
* [[/WP_Rewrite|WP_Rewrite]] /[[:en:Function Reference/WP_Rewrite|en]] - Rewrite rules (and functions <code>add_rewrite_rule, add_rewrite_tag, add_feed, add_rewrite_endpoint, url_to_postid</code>)
* WP_Roles, WP_Role, WP_User - Users and capabilities (and functions <tt>map_meta_cap, current_user_can, get_role, add_role, remove_role</tt>)
+
* WP_Roles, WP_Role, WP_User - Users and capabilities (and functions <code>map_meta_cap, current_user_can, get_role, add_role, remove_role</code>)
* WP_Scripts - JavaScript loading (and functions <tt>wp_print_scripts, wp_register_script, wp_deregister_script, wp_enqueue_script</tt>)
+
* WP_Scripts - JavaScript loading (and functions <code>wp_print_scripts, wp_register_script, wp_deregister_script, [[/wp_enqueue_script|wp_enqueue_script]]</code> /[[:en:Function Reference/wp_enqueue_script|en]])
* [[/Walker Class|Walker]], Walker_Page, Walker_PageDropdown, Walker_Category, Walker_CategoryDropdown - Display tree-like data
+
* [[/Walker Class|Walker]] /[[:en:Function Reference/Walker Class|en]], Walker_Page, Walker_PageDropdown, Walker_Category, Walker_CategoryDropdown - Display tree-like data
* [[/wpdb Class|wpdb]] - Database interface
+
* [[/wpdb Class|wpdb]] /[[:en:Function Reference/wpdb Class|en]] - Database interface
  
The following classes were created by outside developers, and are found in files <tt>class-IXR.php</tt>, <tt>class-pop3.php</tt>, <tt>class-snoopy.php</tt>, <tt>gettext.php</tt>, <tt>rss.php</tt>, <tt>streams.php</tt>:
+
The following classes were created by outside developers, and are found in files <code>class-IXR.php</code>, <code>class-pop3.php</code>, <code>class-snoopy.php</code>, <code>gettext.php</code>, <code>rss.php</code>, <code>streams.php</code>:
  
 
* [http://scripts.incutio.com/xmlrpc/ IXR] - XML-RPC Classes, including IXR_Value, IXR_Message, IXR_Server, IXR_IntrospectionServer, IXR_Request, IXR_Client, IXR_ClientMulticall, IXR_Error, IXR_Date, IXR_Base64  
 
* [http://scripts.incutio.com/xmlrpc/ IXR] - XML-RPC Classes, including IXR_Value, IXR_Message, IXR_Server, IXR_IntrospectionServer, IXR_Request, IXR_Client, IXR_ClientMulticall, IXR_Error, IXR_Date, IXR_Base64  
 
* [http://sourceforge.net/projects/snoopy/ Snoopy] - HTTP client
 
* [http://sourceforge.net/projects/snoopy/ Snoopy] - HTTP client
 
* gettext_reader (part of [http://savannah.nongnu.org/projects/php-gettext/ PHP-gettext]) - Localization Class
 
* gettext_reader (part of [http://savannah.nongnu.org/projects/php-gettext/ PHP-gettext]) - Localization Class
* [http://magpierss.sourceforge.net/ RSS Classes (MagpieRSS and RSSCache)] (and functions <tt>fetch_rss, is_info, is_success, is_redirect, is_error, is_client_error, is_server_error, parse_w3cdtf, wp_rss, get_rss</tt>)
+
* [http://magpierss.sourceforge.net/ RSS Classes (MagpieRSS and RSSCache)] (and functions <code>fetch_rss, is_info, is_success, is_redirect, is_error, is_client_error, is_server_error, parse_w3cdtf, wp_rss, get_rss</code>)
 
* POP3: SquirrelMail wrapper
 
* POP3: SquirrelMail wrapper
* <tt>StreamReader, StringReader, FileReader, CachedFileReader</tt>
+
* <code>StreamReader, StringReader, FileReader, CachedFileReader</code>
 
   
 
   
 
|}
 
|}
 
{{原文|Function Reference}}
 
  
 
{{stub}}
 
{{stub}}
 +
 +
{{原文|Function Reference|55894}}
  
 
{{DEFAULTSORT:かんすうりふあれんす}}
 
{{DEFAULTSORT:かんすうりふあれんす}}

2008年4月4日 (金) 18:47時点における版

このページ「関数リファレンス」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています


The files of WordPress define many useful PHP functions. Some of the functions, known as Template Tags, are defined especially for use in WordPress themes. There are also some functions related to actions and filters (プラグイン API), which are therefore used primarily for developing plugins. The rest are used to create the core WordPress functionality.

Many of the core WordPress functions may also be useful to plugin developers, and to a lesser extent, possibly theme developers as well. So, this article lists most of the core functions, by category; some of the function names are also links to more detailed documentation in separate pages. Each category also lists the files where its functions can be found (the files are in the wp-includes directory of WordPress).

Note: This reference applies to Version 2.1 of WordPress, and does not include functions that have been deprecated as of that version of WordPress. An incomplete page for the 2.0.x versions of WordPress can be found at Function Reference 2.0.x.

Note: Functions specifically for templates, which are listed in the Template Tags article, and contained in files wp-includes/*_template.php, are not listed here.

Note: the WordPress Functions History Tool (unofficial tool) may help in finding when/if a function has been added/dropped.

You can help make this page more complete!

Here are some things you can do to help:

  • Add documentation to un-documented functions, by creating sub-pages or at least by adding short comments in the lists below. If you create a subpage for a function, please include information and examples of usage of that function, if possible, per the examples found in Template Tags.
  • List more functions here, following the category structure.
  • Remove functions from the list, if you think they could not possibly be useful to plugin developers, or if they have been deprecated.
  • Correct errors by moving functions to better categories where appropriate, and of course fixing typos. Note that it is OK for a function to appear in more than one category.

Read Contributing to WordPress to find out more about how you can contribute to the effort!


Functions by category

Post, Page, and Attachment Functions

These functions are contained in formatting.php, post.php. See also Template Tags.

Category, Tag and Taxonomy Functions

Functions surrounding the WordPress Terms tables, encompassing categories and tags for classifying posts, pages, links, etc.

Category functions in category.php.

  • get_all_category_ids
  • &get_categories($args='') /en
  • &get_category
  • get_category_by_path
  • get_category_by_slug
  • get_cat_ID($cat_name='General') - Get the ID of a category from its name
  • get_cat_name($cat_id) - get the name of a category from its ID
  • cat_is_ancestor_of /en

Tag Functions in category.php

  • &get_tags
  • &get_tag

Term Functions in taxonomy.php

  • is_taxonomy - Checks that the taxonomy name exists
  • is_taxonomy_hierarchical - Whether the taxonomy object is hierarchical
  • &get_term
  • get_term_by
  • get_term_children - Merge all term children into a single array.
  • &get_terms
  • is_term - Check if Term exists
  • wp_get_object_terms - Returns the terms associated with the given object(s), in the supplied taxonomies

Other Category Functions


User and Author Functions

These functions are in user.php, pluggable.php, registration.php. See also Template Functions.

Feed Functions

These functions are in functions.php, feed.php, rss.php

  • fetch_rss /en -- retrieve an RSS feed from a URL with automatic caching (included in rss_functions.php)
  • wp_rss /en -- retrieve and display an RSS feed as an unordered list (included in rss_functions.php)
  • get_rss /en -- retrieve and display an RSS feed as a list (ordering optional) (included in rss_functions.php)
  • do_feed
  • do_feed_rdf
  • do_feed_rss
  • do_feed_rss2
  • do_feed_atom
  • get_bloginfo_rss
  • bloginfo_rss
  • get_the_title_rss
  • the_title_rss
  • the_content_rss
  • the_excerpt_rss
  • permalink_single_rss
  • comment_link
  • get_comment_author_rss
  • comment_author_rss
  • comment_text_rss
  • comments_rss_link
  • comments_rss
  • get_author_rss_link
  • get_category_rss_link /en
  • get_category_feed_link /en(2.5 or later)
  • get_the_category_rss
  • the_category_rss
  • rss_enclosure
  • get_search_feed_link (2.5 or later)
  • get_search_comments_feed_link (2.5 or later)

Comment, Ping, and Trackback Functions

These functions are found in comment.php, functions.php, post.php. See also Template Functions.

  • check_comment
  • get_approved_comments /en
  • get_comment /en
  • get_lastcommentmodified
  • sanitize_comment_cookies
  • wp_allow_comment
  • wp_delete_comment
  • wp_get_comment_status
  • wp_get_current_commenter
  • wp_insert_comment
  • wp_filter_comment
  • wp_throttle_comment_flood
  • wp_new_comment
  • wp_set_comment_status
  • wp_update_comment
  • wp_update_comment_count
  • discover_pingback_server_uri
  • do_all_pings
  • do_trackbacks
  • generic_ping
  • pingback
  • privacy_ping_filter
  • trackback
  • weblog_ping
  • do_enclose
  • add_ping
  • get_enclosed
  • get_pung
  • get_to_ping
  • trackback_url_list

Action, Filter, and Plugin Functions

These functions are contained in plugin.php. See also Plugin API.

Theme-Related Functions

These functions are found in theme.php.

  • get_stylesheet
  • get_stylesheet_directory
  • get_stylesheet_directory_uri
  • get_stylesheet_uri
  • get_locale_stylesheet_uri
  • get_template
  • get_template_directory
  • get_template_directory_uri
  • get_theme_data /en
  • get_themes
  • get_theme
  • get_current_theme
  • get_theme_root
  • get_theme_root_uri
  • get_query_template
  • get_404_template
  • get_archive_template
  • get_author_template
  • get_category_template
  • get_date_template
  • get_home_template
  • get_page_template
  • get_paged_template
  • get_search_template
  • get_single_template
  • get_attachment_template
  • get_comments_popup_template
  • load_template
  • locale_stylesheet
  • validate_current_theme
  • get_theme_mod
  • set_theme_mod
  • get_header_textcolor
  • get_header_image
  • header_image
  • add_custom_image_header


Formatting Functions

These functions are contained in formatting.php, functions.php, kses.php.

Miscellaneous Functions

These functions are contained in formatting.php, functions.php, bookmarks.php, cron.php, l10n.php, user.php, pluggable.php

Time/Date Functions

  • get_gmt_from_date - Changes timezone for a datetime string, from local time to gmt.
  • get_date_from_gmt - Changes timezone for a datetime string, from gmt to local time.
  • iso8601_timezone_to_offset
  • iso8601_to_datetime
  • human_time_diff
  • mysql2date
  • current_time /en
  • date_i18n
  • get_weekendstartend
  • get_lastpostdate
  • get_lastpostmodified
  • is_new_day

Serialization

  • maybe_serialize
  • maybe_unserialize
  • is_serialized
  • is_serialized_string

Options

XMLRPC

  • xmlrpc_getposttitle
  • xmlrpc_getpostcategory
  • xmlrpc_removepostdata
  • user_pass_ok

Localization

See also Translating WordPress.

  • get_locale
  • __
  • _e
  • _ngettext
  • load_textdomain
  • load_default_textdomain
  • load_plugin_textdomain
  • load_theme_textdomain

Cron (Scheduling)

Miscellaneous

  • gzip_compression
  • make_url_footnote
  • wp_get_http_headers
  • add_query_arg
  • remove_query_arg
  • wp_remote_fopen
  • wp
  • status_header
  • nocache_headers
  • cache_javascript_headers
  • get_num_queries
  • bool_from_yn - converts a "Y/N" variable into boolean true/false
  • do_robots
  • is_blog_installed
  • wp_nonce_url
  • wp_nonce_field
  • wp_referer_field
  • wp_original_referer_field
  • wp_get_referer
  • wp_get_original_referer
  • wp_mkdir_p
  • wp_upload_dir
  • wp_upload_bits
  • wp_check_filetype
  • wp_explain_nonce
  • wp_nonce_ays
  • wp_die
  • get_bookmark
  • get_bookmarks
  • wp_mail /en
  • check_admin_referer
  • check_ajax_referer
  • wp_redirect /en
  • wp_get_cookie_login
  • wp_setcookie
  • wp_clearcookie
  • wp_notify_postauthor
  • wp_notify_moderator
  • wp_new_user_notification
  • wp_verify_nonce
  • wp_create_nonce
  • wp_salt
  • wp_hash

Classes

The following classes were created by WordPress developers, and are found in files capabilities.php, classes.php, class-snoopy.php, locale.php, query.php, rewrite.php, script-loader.phpcode>, wp-db.php:

  • WP - general request handling
  • WP_Ajax_Response - AJAX handling
  • WP_Object_Cache /en (formerly WP_Cache) - Object cache (and functions wp_cache_add, wp_cache_close, wp_cache_delete, wp_cache_flush, wp_cache_get, wp_cache_init, wp_cache_replace, wp_cache_set)
  • WP_Error - error handling (and function is_wp_error)
  • WP_Locale - handles date and time locales
  • WP_Query /en - Request parsing and manipulation, posts fetching (with functions get_query_var, query_posts, have_posts, in_the_loop, rewind_posts, the_post, wp_old_slug_redirect, setup_postdata, as well as the Conditional Tags is_*)
  • WP_Rewrite /en - Rewrite rules (and functions add_rewrite_rule, add_rewrite_tag, add_feed, add_rewrite_endpoint, url_to_postid)
  • WP_Roles, WP_Role, WP_User - Users and capabilities (and functions map_meta_cap, current_user_can, get_role, add_role, remove_role)
  • WP_Scripts - JavaScript loading (and functions wp_print_scripts, wp_register_script, wp_deregister_script, wp_enqueue_script /en)
  • Walker /en, Walker_Page, Walker_PageDropdown, Walker_Category, Walker_CategoryDropdown - Display tree-like data
  • wpdb /en - Database interface

The following classes were created by outside developers, and are found in files class-IXR.php, class-pop3.php, class-snoopy.php, gettext.php, rss.php, streams.php:

  • IXR - XML-RPC Classes, including IXR_Value, IXR_Message, IXR_Server, IXR_IntrospectionServer, IXR_Request, IXR_Client, IXR_ClientMulticall, IXR_Error, IXR_Date, IXR_Base64
  • Snoopy - HTTP client
  • gettext_reader (part of PHP-gettext) - Localization Class
  • RSS Classes (MagpieRSS and RSSCache) (and functions fetch_rss, is_info, is_success, is_redirect, is_error, is_client_error, is_server_error, parse_w3cdtf, wp_rss, get_rss)
  • POP3: SquirrelMail wrapper
  • StreamReader, StringReader, FileReader, CachedFileReader

テンプレート:stub

最新英語版: WordPress Codex » Function Reference最新版との差分