Skeleton phpdoc for post-template.php. Props jacobsantos. see #7659
git-svn-id: https://develop.svn.wordpress.org/trunk@8809 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4705e219df
commit
d7cbc74497
@ -1,21 +1,53 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* WordPress Post Template Functions
|
||||||
|
*
|
||||||
|
* Gets content for the current post in the loop.
|
||||||
|
*
|
||||||
|
* @package WordPress
|
||||||
|
* @subpackage Template
|
||||||
|
*/
|
||||||
|
|
||||||
//
|
/**
|
||||||
// "The Loop" post functions
|
* the_ID() - {@internal Missing Short Description}}
|
||||||
//
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
* @uses $id
|
||||||
|
*/
|
||||||
function the_ID() {
|
function the_ID() {
|
||||||
global $id;
|
global $id;
|
||||||
echo $id;
|
echo $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_the_ID() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.1.0
|
||||||
|
* @uses $id
|
||||||
|
*
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_the_ID() {
|
function get_the_ID() {
|
||||||
global $id;
|
global $id;
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the_title() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
*
|
||||||
|
* @param unknown_type $before
|
||||||
|
* @param unknown_type $after
|
||||||
|
* @param unknown_type $echo
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function the_title($before = '', $after = '', $echo = true) {
|
function the_title($before = '', $after = '', $echo = true) {
|
||||||
$title = get_the_title();
|
$title = get_the_title();
|
||||||
|
|
||||||
@ -30,6 +62,16 @@ function the_title($before = '', $after = '', $echo = true) {
|
|||||||
return $title;
|
return $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the_title_attribute() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.3.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $args
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function the_title_attribute( $args = '' ) {
|
function the_title_attribute( $args = '' ) {
|
||||||
$title = get_the_title();
|
$title = get_the_title();
|
||||||
|
|
||||||
@ -50,6 +92,16 @@ function the_title_attribute( $args = '' ) {
|
|||||||
return $title;
|
return $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_the_title() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_the_title( $id = 0 ) {
|
function get_the_title( $id = 0 ) {
|
||||||
$post = &get_post($id);
|
$post = &get_post($id);
|
||||||
|
|
||||||
@ -64,16 +116,46 @@ function get_the_title( $id = 0 ) {
|
|||||||
return apply_filters( 'the_title', $title );
|
return apply_filters( 'the_title', $title );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the_guid() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.5.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
*/
|
||||||
function the_guid( $id = 0 ) {
|
function the_guid( $id = 0 ) {
|
||||||
echo get_the_guid($id);
|
echo get_the_guid($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_the_guid() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.5.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_the_guid( $id = 0 ) {
|
function get_the_guid( $id = 0 ) {
|
||||||
$post = &get_post($id);
|
$post = &get_post($id);
|
||||||
|
|
||||||
return apply_filters('get_the_guid', $post->guid);
|
return apply_filters('get_the_guid', $post->guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the_content() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
*
|
||||||
|
* @param unknown_type $more_link_text
|
||||||
|
* @param unknown_type $stripteaser
|
||||||
|
* @param unknown_type $more_file
|
||||||
|
*/
|
||||||
function the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') {
|
function the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') {
|
||||||
$content = get_the_content($more_link_text, $stripteaser, $more_file);
|
$content = get_the_content($more_link_text, $stripteaser, $more_file);
|
||||||
$content = apply_filters('the_content', $content);
|
$content = apply_filters('the_content', $content);
|
||||||
@ -81,7 +163,18 @@ function the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '')
|
|||||||
echo $content;
|
echo $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_the_content() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
*
|
||||||
|
* @param unknown_type $more_link_text
|
||||||
|
* @param unknown_type $stripteaser
|
||||||
|
* @param unknown_type $more_file
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') {
|
function get_the_content($more_link_text = NULL, $stripteaser = 0, $more_file = '') {
|
||||||
global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;
|
global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;
|
||||||
|
|
||||||
@ -133,12 +226,28 @@ function get_the_content($more_link_text = NULL, $stripteaser = 0, $more_file =
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the_excerpt() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
* @uses apply_filters() -
|
||||||
|
*/
|
||||||
function the_excerpt() {
|
function the_excerpt() {
|
||||||
echo apply_filters('the_excerpt', get_the_excerpt());
|
echo apply_filters('the_excerpt', get_the_excerpt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_the_excerpt() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 0.71
|
||||||
|
*
|
||||||
|
* @param unknown_type $deprecated
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_the_excerpt($deprecated = '') {
|
function get_the_excerpt($deprecated = '') {
|
||||||
global $post;
|
global $post;
|
||||||
$output = '';
|
$output = '';
|
||||||
@ -151,6 +260,16 @@ function get_the_excerpt($deprecated = '') {
|
|||||||
return apply_filters('get_the_excerpt', $output);
|
return apply_filters('get_the_excerpt', $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* has_excerpt() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.3.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function has_excerpt( $id = 0 ) {
|
function has_excerpt( $id = 0 ) {
|
||||||
$post = &get_post( $id );
|
$post = &get_post( $id );
|
||||||
return ( !empty( $post->post_excerpt ) );
|
return ( !empty( $post->post_excerpt ) );
|
||||||
@ -268,6 +387,16 @@ function sticky_class( $post_id = null ) {
|
|||||||
echo " sticky";
|
echo " sticky";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wp_link_pages() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $args
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function wp_link_pages($args = '') {
|
function wp_link_pages($args = '') {
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'before' => '<p>' . __('Pages:'), 'after' => '</p>',
|
'before' => '<p>' . __('Pages:'), 'after' => '</p>',
|
||||||
@ -348,7 +477,16 @@ function wp_link_pages($args = '') {
|
|||||||
// Post-meta: Custom per-post fields.
|
// Post-meta: Custom per-post fields.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* post_custom() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.5.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $key
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function post_custom( $key = '' ) {
|
function post_custom( $key = '' ) {
|
||||||
$custom = get_post_custom();
|
$custom = get_post_custom();
|
||||||
|
|
||||||
@ -360,6 +498,14 @@ function post_custom( $key = '' ) {
|
|||||||
|
|
||||||
|
|
||||||
// this will probably change at some point...
|
// this will probably change at some point...
|
||||||
|
/**
|
||||||
|
* the_meta() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
|
* @uses apply_filters()
|
||||||
|
*/
|
||||||
function the_meta() {
|
function the_meta() {
|
||||||
if ( $keys = get_post_custom_keys() ) {
|
if ( $keys = get_post_custom_keys() ) {
|
||||||
echo "<ul class='post-meta'>\n";
|
echo "<ul class='post-meta'>\n";
|
||||||
@ -380,6 +526,16 @@ function the_meta() {
|
|||||||
// Pages
|
// Pages
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wp_dropdown_pages() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.1.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $args
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function wp_dropdown_pages($args = '') {
|
function wp_dropdown_pages($args = '') {
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'depth' => 0, 'child_of' => 0,
|
'depth' => 0, 'child_of' => 0,
|
||||||
@ -409,6 +565,16 @@ function wp_dropdown_pages($args = '') {
|
|||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wp_list_pages() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.5.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $args
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function wp_list_pages($args = '') {
|
function wp_list_pages($args = '') {
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'depth' => 0, 'show_date' => '',
|
'depth' => 0, 'show_date' => '',
|
||||||
@ -459,12 +625,30 @@ function wp_list_pages($args = '') {
|
|||||||
// Page helpers
|
// Page helpers
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* walk_page_tree() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.1.0
|
||||||
|
*
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function walk_page_tree() {
|
function walk_page_tree() {
|
||||||
$walker = new Walker_Page;
|
$walker = new Walker_Page;
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
return call_user_func_array(array(&$walker, 'walk'), $args);
|
return call_user_func_array(array(&$walker, 'walk'), $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* walk_page_dropdown_tree() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.1.0
|
||||||
|
*
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function walk_page_dropdown_tree() {
|
function walk_page_dropdown_tree() {
|
||||||
$walker = new Walker_PageDropdown;
|
$walker = new Walker_PageDropdown;
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
@ -475,6 +659,17 @@ function walk_page_dropdown_tree() {
|
|||||||
// Attachments
|
// Attachments
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the_attachment_link() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.0.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @param unknown_type $fullsize
|
||||||
|
* @param unknown_type $max_dims
|
||||||
|
*/
|
||||||
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) {
|
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) {
|
||||||
if ( $fullsize )
|
if ( $fullsize )
|
||||||
echo wp_get_attachment_link($id, 'full', $permalink);
|
echo wp_get_attachment_link($id, 'full', $permalink);
|
||||||
@ -522,6 +717,17 @@ function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false,
|
|||||||
|
|
||||||
|
|
||||||
// deprecated: use wp_get_attachment_image_src()
|
// deprecated: use wp_get_attachment_image_src()
|
||||||
|
/**
|
||||||
|
* get_attachment_icon_src() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.1.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @param unknown_type $fullsize
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_attachment_icon_src( $id = 0, $fullsize = false ) {
|
function get_attachment_icon_src( $id = 0, $fullsize = false ) {
|
||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
if ( !$post = & get_post($id) )
|
if ( !$post = & get_post($id) )
|
||||||
@ -554,6 +760,18 @@ function get_attachment_icon_src( $id = 0, $fullsize = false ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// deprecated: use wp_get_attachment_image()
|
// deprecated: use wp_get_attachment_image()
|
||||||
|
/**
|
||||||
|
* get_attachment_icon() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.0.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @param unknown_type $fullsize
|
||||||
|
* @param unknown_type $max_dims
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
|
function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
|
||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
if ( !$post = & get_post($id) )
|
if ( !$post = & get_post($id) )
|
||||||
@ -598,6 +816,18 @@ function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// deprecated: use wp_get_attachment_image()
|
// deprecated: use wp_get_attachment_image()
|
||||||
|
/**
|
||||||
|
* get_attachment_innerHTML() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.0.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $id
|
||||||
|
* @param unknown_type $fullsize
|
||||||
|
* @param unknown_type $max_dims
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
|
function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
|
||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
if ( !$post = & get_post($id) )
|
if ( !$post = & get_post($id) )
|
||||||
@ -612,6 +842,16 @@ function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false)
|
|||||||
return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
|
return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* prepend_attachment() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 2.0.0
|
||||||
|
*
|
||||||
|
* @param unknown_type $content
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function prepend_attachment($content) {
|
function prepend_attachment($content) {
|
||||||
global $post;
|
global $post;
|
||||||
|
|
||||||
@ -631,6 +871,15 @@ function prepend_attachment($content) {
|
|||||||
// Misc
|
// Misc
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_the_password_form() - {@internal Missing Short Description}}
|
||||||
|
*
|
||||||
|
* {@internal Missing Long Description}}
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function get_the_password_form() {
|
function get_the_password_form() {
|
||||||
global $post;
|
global $post;
|
||||||
$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
|
$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
|
||||||
@ -649,9 +898,11 @@ function get_the_password_form() {
|
|||||||
* You can optional provide a template name and then the check will be specific to
|
* You can optional provide a template name and then the check will be specific to
|
||||||
* that template.
|
* that template.
|
||||||
*
|
*
|
||||||
* @package Template Tags
|
* @since 2.5.0
|
||||||
* @global object $wp_query
|
* @uses $wp_query
|
||||||
|
*
|
||||||
* @param string $template The specific template name if specific matching is required
|
* @param string $template The specific template name if specific matching is required
|
||||||
|
* @return bool False on failure, true if success
|
||||||
*/
|
*/
|
||||||
function is_page_template($template = '') {
|
function is_page_template($template = '') {
|
||||||
if (!is_page()) {
|
if (!is_page()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user