[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

/wp-includes/ -> general-template.php (summary)

General template tags that can go anywhere in a template.

File Size: 2049 lines (69 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 58 functions

  get_header()
  get_footer()
  get_sidebar()
  get_search_form()
  wp_loginout()
  wp_logout_url()
  wp_login_url()
  wp_lostpassword_url()
  wp_register()
  wp_meta()
  bloginfo()
  get_bloginfo()
  wp_title()
  single_post_title()
  single_cat_title()
  single_tag_title()
  single_month_title()
  get_archives_link()
  wp_get_archives()
  calendar_week_mod()
  get_calendar()
  delete_get_calendar_cache()
  allowed_tags()
  the_date_xml()
  the_date()
  the_modified_date()
  get_the_modified_date()
  the_time()
  get_the_time()
  get_post_time()
  the_modified_time()
  get_the_modified_time()
  get_post_modified_time()
  the_weekday()
  the_weekday_date()
  wp_head()
  wp_footer()
  automatic_feed_links()
  feed_links()
  feed_links_extra()
  rsd_link()
  wlwmanifest_link()
  noindex()
  rich_edit_exists()
  user_can_richedit()
  wp_default_editor()
  the_editor()
  get_search_query()
  the_search_query()
  language_attributes()
  paginate_links()
  wp_admin_css_color()
  wp_admin_css_uri()
  wp_admin_css()
  add_thickbox()
  wp_generator()
  the_generator()
  get_the_generator()

Functions
Functions that are not part of a class:

get_header( $name = null )   X-Ref
Load header template.

Includes the header template for a theme or if a name is specified then a
specialised header will be included. If the theme contains no header.php file
then the header from the default theme will be included.

For the parameter, if the file is called "header-special.php" then specify
"special".

param: string $name The name of the specialised header.

get_footer( $name = null )   X-Ref
Load footer template.

Includes the footer template for a theme or if a name is specified then a
specialised footer will be included. If the theme contains no footer.php file
then the footer from the default theme will be included.

For the parameter, if the file is called "footer-special.php" then specify
"special".

param: string $name The name of the specialised footer.

get_sidebar( $name = null )   X-Ref
Load sidebar template.

Includes the sidebar template for a theme or if a name is specified then a
specialised sidebar will be included. If the theme contains no sidebar.php
file then the sidebar from the default theme will be included.

For the parameter, if the file is called "sidebar-special.php" then specify
"special".

param: string $name The name of the specialised sidebar.

get_search_form()   X-Ref
Display search form.

Will first attempt to locate the searchform.php file in either the child or
the parent, then load it. If it doesn't exist, then the default search form
will be displayed. The default search form is HTML, which will be displayed.
There is a filter applied to the search form HTML in order to edit or replace
it. The filter is 'get_search_form'.

This function is primarily used by themes which want to hardcode the search
form into the sidebar and also by the search widget in WordPress.

There is also an action that is called whenever the function is run called,
'get_search_form'. This can be useful for outputting JavaScript that the
search relies on or various formatting that applies to the beginning of the
search. To give a few examples of what it can be used for.


wp_loginout($redirect = '')   X-Ref
Display the Log In/Out link.

Displays a link, which allows the user to navigate to the Log In page to log in
or log out depending on whether or not they are currently logged in.

param: string $redirect Optional path to redirect to on login/logout.

wp_logout_url($redirect = '')   X-Ref
Returns the Log Out URL.

Returns the URL that allows the user to log out of the site

param: string $redirect Path to redirect to on logout.

wp_login_url($redirect = '')   X-Ref
Returns the Log In URL.

Returns the URL that allows the user to log in to the site

param: string $redirect Path to redirect to on login.

wp_lostpassword_url($redirect = '')   X-Ref
Returns the Lost Password URL.

Returns the URL that allows the user to retrieve the lost password

param: string $redirect Path to redirect to on login.

wp_register( $before = '<li>', $after = '</li>' )   X-Ref
Display the Registration or Admin link.

Display a link which allows the user to navigate to the registration page if
not logged in and registration is enabled or to the dashboard if logged in.

param: string $before Text to output before the link (defaults to <li>).
param: string $after Text to output after the link (defaults to </li>).

wp_meta()   X-Ref
Theme container function for the 'wp_meta' action.

The 'wp_meta' action can have several purposes, depending on how you use it,
but one purpose might have been to allow for theme switching.


bloginfo($show='')   X-Ref
Display information about the blog.

param: string $show What to display.

get_bloginfo($show = '', $filter = 'raw')   X-Ref
Retrieve information about the blog.

Some show parameter values are deprecated and will be removed in future
versions. Care should be taken to check the function contents and know what
the deprecated blog info options are. Options without "// DEPRECATED" are
the preferred and recommended ways to get the information.

The possible values for the 'show' parameter are listed below.
<ol>
<li><strong>url<strong> - Blog URI to homepage.</li>
<li><strong>wpurl</strong> - Blog URI path to WordPress.</li>
<li><strong>description</strong> - Secondary title</li>
</ol>

The feed URL options can be retrieved from 'rdf_url' (RSS 0.91),
'rss_url' (RSS 1.0), 'rss2_url' (RSS 2.0), or 'atom_url' (Atom feed). The
comment feeds can be retrieved from the 'comments_atom_url' (Atom comment
feed) or 'comments_rss2_url' (RSS 2.0 comment feed).

There are many other options and you should check the function contents:
{@source 32 37}

param: string $show Blog info to retrieve.
param: string $filter How to filter what is retrieved.
return: string Mostly string values, might be empty.

wp_title($sep = '&raquo;', $display = true, $seplocation = '')   X-Ref
Display or retrieve page title for all areas of blog.

By default, the page title will display the separator before the page title,
so that the blog title will be before the page title. This is not good for
title display, since the blog title shows up on most tabs and not what is
important, which is the page that the user is looking at.

There are also SEO benefits to having the blog title after or to the 'right'
or the page title. However, it is mostly common sense to have the blog title
to the right with most browsers supporting tabs. You can achieve this by
using the seplocation parameter and setting the value to 'right'. This change
was introduced around 2.5.0, in case backwards compatibility of themes is
important.

param: string $sep Optional, default is '&raquo;'. How to separate the various items within the page title.
param: bool $display Optional, default is true. Whether to display or retrieve title.
param: string $seplocation Optional. Direction to display title, 'right'.
return: string|null String on retrieve, null when displaying.

single_post_title($prefix = '', $display = true)   X-Ref
Display or retrieve page title for post.

This is optimized for single.php template file for displaying the post title.
Only useful for posts, does not support pages for example.

It does not support placing the separator after the title, but by leaving the
prefix parameter empty, you can set the title separator manually. The prefix
does not automatically place a space between the prefix, so if there should
be a space, the parameter value will need to have it at the end.

param: string $prefix Optional. What to display before the title.
param: bool $display Optional, default is true. Whether to display or retrieve title.
return: string|null Title when retrieving, null when displaying or failure.

single_cat_title($prefix = '', $display = true )   X-Ref
Display or retrieve page title for category archive.

This is useful for category template file or files, because it is optimized
for category page title and with less overhead than {@link wp_title()}.

It does not support placing the separator after the title, but by leaving the
prefix parameter empty, you can set the title separator manually. The prefix
does not automatically place a space between the prefix, so if there should
be a space, the parameter value will need to have it at the end.

param: string $prefix Optional. What to display before the title.
param: bool $display Optional, default is true. Whether to display or retrieve title.
return: string|null Title when retrieving, null when displaying or failure.

single_tag_title($prefix = '', $display = true )   X-Ref
Display or retrieve page title for tag post archive.

Useful for tag template files for displaying the tag page title. It has less
overhead than {@link wp_title()}, because of its limited implementation.

It does not support placing the separator after the title, but by leaving the
prefix parameter empty, you can set the title separator manually. The prefix
does not automatically place a space between the prefix, so if there should
be a space, the parameter value will need to have it at the end.

param: string $prefix Optional. What to display before the title.
param: bool $display Optional, default is true. Whether to display or retrieve title.
return: string|null Title when retrieving, null when displaying or failure.

single_month_title($prefix = '', $display = true )   X-Ref
Display or retrieve page title for post archive based on date.

Useful for when the template only needs to display the month and year, if
either are available. Optimized for just this purpose, so if it is all that
is needed, should be better than {@link wp_title()}.

It does not support placing the separator after the title, but by leaving the
prefix parameter empty, you can set the title separator manually. The prefix
does not automatically place a space between the prefix, so if there should
be a space, the parameter value will need to have it at the end.

param: string $prefix Optional. What to display before the title.
param: bool $display Optional, default is true. Whether to display or retrieve title.
return: string|null Title when retrieving, null when displaying or failure.

get_archives_link($url, $text, $format = 'html', $before = '', $after = '')   X-Ref
Retrieve archive link content based on predefined or custom code.

The format can be one of four styles. The 'link' for head element, 'option'
for use in the select element, 'html' for use in list (either ol or ul HTML
elements). Custom content is also supported using the before and after
parameters.

The 'link' format uses the link HTML element with the <em>archives</em>
relationship. The before and after parameters are not used. The text
parameter is used to describe the link.

The 'option' format uses the option HTML element for use in select element.
The value is the url parameter and the before and after parameters are used
between the text description.

The 'html' format, which is the default, uses the li HTML element for use in
the list HTML elements. The before parameter is before the link and the after
parameter is after the closing link.

The custom format uses the before parameter before the link ('a' HTML
element) and the after parameter after the closing link tag. If the above
three values for the format are not used, then custom format is assumed.

author: Orien
param: string $url URL to archive.
param: string $text Archive text description.
param: string $format Optional, default is 'html'. Can be 'link', 'option', 'html', or custom.
param: string $before Optional.
param: string $after Optional.
return: string HTML link content for archive.

wp_get_archives($args = '')   X-Ref
Display archive links based on type and format.

The 'type' argument offers a few choices and by default will display monthly
archive links. The other options for values are 'daily', 'weekly', 'monthly',
'yearly', 'postbypost' or 'alpha'. Both 'postbypost' and 'alpha' display the
same archive link list, the difference between the two is that 'alpha'
will order by post title and 'postbypost' will order by post date.

The date archives will logically display dates with links to the archive post
page. The 'postbypost' and 'alpha' values for 'type' argument will display
the post titles.

The 'limit' argument will only display a limited amount of links, specified
by the 'limit' integer value. By default, there is no limit. The
'show_post_count' argument will show how many posts are within the archive.
By default, the 'show_post_count' argument is set to false.

For the 'format', 'before', and 'after' arguments, see {@link
get_archives_link()}. The values of these arguments have to do with that
function.

param: string|array $args Optional. Override defaults.

calendar_week_mod($num)   X-Ref
Get number of days since the start of the week.

param: int $num Number of day.
return: int Days since the start of the week.

get_calendar($initial = true)   X-Ref
Display calendar with days that have posts as links.

The calendar is cached, which will be retrieved, if it exists. If there are
no posts for the month, then it will not be displayed.

param: bool $initial Optional, default is true. Use initial calendar names.

delete_get_calendar_cache()   X-Ref
Purge the cached results of get_calendar.


allowed_tags()   X-Ref
Display all of the allowed tags in HTML format with attributes.

This is useful for displaying in the comment area, which elements and
attributes are supported. As well as any plugins which want to display it.

return: string HTML allowed tags entity encoded.

the_date_xml()   X-Ref
Outputs the date in iso8601 format for xml files.


the_date($d='', $before='', $after='', $echo = true)   X-Ref
Display or Retrieve the date the post was written.

Will only output the date if the current post's date is different from the
previous one output.

param: string $d Optional. PHP date format defaults to the date_format option if not specified.
param: string $before Optional. Output before the date.
param: string $after Optional. Output after the date.
param: bool $echo Optional, default is display. Whether to echo the date or return it.
return: string|null Null if displaying, string if retrieving.

the_modified_date($d = '')   X-Ref
Display the date on which the post was last modified.

param: string $d Optional. PHP date format.
return: string

get_the_modified_date($d = '')   X-Ref
Retrieve the date on which the post was last modified.

param: string $d Optional. PHP date format. Defaults to the "date_format" option
return: string

the_time( $d = '' )   X-Ref
Display the time at which the post was written.

param: string $d Either 'G', 'U', or php date format.

get_the_time( $d = '', $post = null )   X-Ref
Retrieve the time at which the post was written.

param: string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
param: int|object $post Optional post ID or object. Default is global $post object.
return: string

get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false )   X-Ref
Retrieve the time at which the post was written.

param: string $d Either 'G', 'U', or php date format.
param: bool $gmt Whether of not to return the gmt time.
param: int|object $post Optional post ID or object. Default is global $post object.
param: bool $translate Whether to translate the time string or not
return: string

the_modified_time($d = '')   X-Ref
Display the time at which the post was last modified.

param: string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option.

get_the_modified_time($d = '')   X-Ref
Retrieve the time at which the post was last modified.

param: string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
return: string

get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false )   X-Ref
Retrieve the time at which the post was last modified.

param: string $d Either 'G', 'U', or php date format.
param: bool $gmt Whether of not to return the gmt time.
param: int|object $post A post_id or post object
param: bool translate Whether to translate the result or not
return: string Returns timestamp

the_weekday()   X-Ref
Display the weekday on which the post was written.


the_weekday_date($before='',$after='')   X-Ref
Display the weekday on which the post was written.

Will only output the weekday if the current post's weekday is different from
the previous one output.

param: string $before output before the date.
param: string $after output after the date.

wp_head()   X-Ref
Fire the wp_head action


wp_footer()   X-Ref
Fire the wp_footer action


automatic_feed_links( $add = true )   X-Ref
Enable/disable automatic general feed link outputting.

param: boolean $add Add or remove links. Defaults to true.

feed_links( $args )   X-Ref
Display the links to the general feeds.

param: array $args Optional arguments.

feed_links_extra( $args )   X-Ref
Display the links to the extra feeds such as category feeds.

param: array $args Optional arguments.

rsd_link()   X-Ref
Display the link to the Really Simple Discovery service endpoint.


wlwmanifest_link()   X-Ref
Display the link to the Windows Live Writer manifest file.


noindex()   X-Ref
Display a noindex meta tag if required by the blog configuration.

If a blog is marked as not being public then the noindex meta tag will be
output to tell web robots not to index the page content.


rich_edit_exists()   X-Ref
Determine if TinyMCE is available.

Checks to see if the user has deleted the tinymce files to slim down there WordPress install.

return: bool Whether of not TinyMCE exists.

user_can_richedit()   X-Ref
Whether or not the user should have a WYSIWIG editor.

Checks that the user requires a WYSIWIG editor and that the editor is
supported in the users browser.

return: bool

wp_default_editor()   X-Ref
Find out which editor should be displayed by default.

Works out which of the two editors to display as the current editor for a
user.

return: string Either 'tinymce', or 'html', or 'test'

the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2)   X-Ref
Display visual editor forms: TinyMCE, or HTML, or both.

The amount of rows the text area will have for the content has to be between
3 and 100 or will default at 12. There is only one option used for all users,
named 'default_post_edit_rows'.

If the user can not use the rich editor (TinyMCE), then the switch button
will not be displayed.

param: string $content Textarea content.
param: string $id HTML ID attribute value.
param: string $prev_id HTML ID name for switching back and forth between visual editors.
param: bool $media_buttons Optional, default is true. Whether to display media buttons.
param: int $tab_index Optional, default is 2. Tabindex for textarea element.

get_search_query()   X-Ref
Retrieve the contents of the search WordPress query variable.

return: string

the_search_query()   X-Ref
Display the contents of the search query variable.

The search query string is passed through {@link esc_attr()}
to ensure that it is safe for placing in an html attribute.


language_attributes($doctype = 'html')   X-Ref
Display the language attributes for the html tag.

Builds up a set of html attributes containing the text direction and language
information for the page.

param: string $doctype The type of html document (xhtml|html).

paginate_links( $args = '' )   X-Ref
Retrieve paginated link for archive post pages.

Technically, the function can be used to create paginated link list for any
area. The 'base' argument is used to reference the url, which will be used to
create the paginated links. The 'format' argument is then used for replacing
the page number. It is however, most likely and by default, to be used on the
archive post pages.

The 'type' argument controls format of the returned value. The default is
'plain', which is just a string with the links separated by a newline
character. The other possible values are either 'array' or 'list'. The
'array' value will return an array of the paginated link list to offer full
control of display. The 'list' value will place all of the paginated links in
an unordered HTML list.

The 'total' argument is the total amount of pages and is an integer. The
'current' argument is the current page number and is also an integer.

An example of the 'base' argument is "http://example.com/all_posts.php%_%"
and the '%_%' is required. The '%_%' will be replaced by the contents of in
the 'format' argument. An example for the 'format' argument is "?page=%#%"
and the '%#%' is also required. The '%#%' will be replaced with the page
number.

You can include the previous and next links in the list by setting the
'prev_next' argument to true, which it is by default. You can set the
previous text, by using the 'prev_text' argument. You can set the next text
by setting the 'next_text' argument.

If the 'show_all' argument is set to true, then it will show all of the pages
instead of a short list of the pages near the current page. By default, the
'show_all' is set to false and controlled by the 'end_size' and 'mid_size'
arguments. The 'end_size' argument is how many numbers on either the start
and the end list edges, by default is 1. The 'mid_size' argument is how many
numbers to either side of current page, but not including current page.

It is possible to add query vars to the link by using the 'add_args' argument
and see {@link add_query_arg()} for more information.

param: string|array $args Optional. Override defaults.
return: array|string String of page links or array of page links.

wp_admin_css_color($key, $name, $url, $colors = array()   X-Ref
Registers an admin colour scheme css file.

Allows a plugin to register a new admin colour scheme. For example:
<code>
wp_admin_css_color('classic', __('Classic'), admin_url("css/colors-classic.css"),
array('#07273E', '#14568A', '#D54E21', '#2683AE'));
</code>

param: string $key The unique key for this theme.
param: string $name The name of the theme.
param: string $url The url of the css file containing the colour scheme.
param: array @colors An array of CSS color definitions which are used to give the user a feel for the theme.

wp_admin_css_uri( $file = 'wp-admin' )   X-Ref
Display the URL of a WordPress admin CSS file.

param: string $file file relative to wp-admin/ without its ".css" extension.

wp_admin_css( $file = 'wp-admin', $force_echo = false )   X-Ref
Enqueues or directly prints a stylesheet link to the specified CSS file.

"Intelligently" decides to enqueue or to print the CSS file. If the
'wp_print_styles' action has *not* yet been called, the CSS file will be
enqueued. If the wp_print_styles action *has* been called, the CSS link will
be printed. Printing may be forced by passing TRUE as the $force_echo
(second) parameter.

For backward compatibility with WordPress 2.3 calling method: If the $file
(first) parameter does not correspond to a registered CSS file, we assume
$file is a file relative to wp-admin/ without its ".css" extension. A
stylesheet link to that generated URL is printed.

param: string $file Style handle name or file name (without ".css" extension) relative to wp-admin/
param: bool $force_echo Optional.  Force the stylesheet link to be printed rather than enqueued.

add_thickbox()   X-Ref
Enqueues the default ThickBox js and css.

If any of the settings need to be changed, this can be done with another js
file similar to media-upload.js and theme-preview.js. That file should
require array('thickbox') to ensure it is loaded after.


wp_generator()   X-Ref
Display the XHTML generator that is generated on the wp_head hook.


the_generator( $type )   X-Ref
Display the generator XML or Comment for RSS, ATOM, etc.

Returns the correct generator type for the requested output format. Allows
for a plugin to filter generators overall the the_generator filter.

param: string $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).

get_the_generator( $type )   X-Ref
Creates the generator XML or Comment for RSS, ATOM, etc.

Returns the correct generator type for the requested output format. Allows
for a plugin to filter generators on an individual basis using the
'get_the_generator_{$type}' filter.

param: string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export).
return: string The HTML content for the generator.



Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7