WordPressを読む 53-4 /blog/wp-includes/deprecated.php 4
2015/02/19
目次
- 1 /blog/wp-includes/deprecated.php 4
- 2 関数 get_the_author_nickname()
- 3 関数 the_author_nickname()
- 4 関数 get_the_author_email()
- 5 関数 the_author_email()
- 6 関数 get_the_author_icq()
- 7 関数 the_author_icq()
- 8 関数 get_the_author_yim()
- 9 関数 the_author_yim()
- 10 関数 get_the_author_msn()
- 11 関数 the_author_msn()
- 12 関数 get_the_author_aim()
- 13 関数 the_author_aim()
- 14 関数 get_author_name()
- 15 関数 get_the_author_url()
- 16 関数 the_author_url()
- 17 関数 get_the_author_ID()
- 18 関数 the_author_ID()
- 19 関数 the_content_rss()
- 20 関数 make_url_footnote()
- 21 関数 _c()
- 22 関数 translate_with_context()
- 23 関数 _nc()
- 24 関数 __ngettext()
- 25 関数 __ngettext_noop()
- 26 関数 get_alloptions()
- 27 関数 get_the_attachment_link()
- 28 関数 get_attachment_icon_src()
/blog/wp-includes/deprecated.php 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the nickname of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('nickname') * @see get_the_author_meta() * * @return string The author's nickname. */ function get_the_author_nickname() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' ); return get_the_author_meta('nickname'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the nickname of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('nickname') * @see the_author_meta() */ function the_author_nickname() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' ); the_author_meta('nickname'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the email of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('email') * @see get_the_author_meta() * * @return string The author's username. */ function get_the_author_email() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' ); return get_the_author_meta('email'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the email of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('email') * @see the_author_meta() */ function the_author_email() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' ); the_author_meta('email'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the ICQ number of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('icq') * @see get_the_author_meta() * * @return string The author's ICQ number. */ function get_the_author_icq() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' ); return get_the_author_meta('icq'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the ICQ number of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('icq') * @see the_author_meta() */ function the_author_icq() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' ); the_author_meta('icq'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the Yahoo! IM name of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('yim') * @see get_the_author_meta() * * @return string The author's Yahoo! IM name. */ function get_the_author_yim() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' ); return get_the_author_meta('yim'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the Yahoo! IM name of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('yim') * @see the_author_meta() */ function the_author_yim() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' ); the_author_meta('yim'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the MSN address of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('msn') * @see get_the_author_meta() * * @return string The author's MSN address. */ function get_the_author_msn() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' ); return get_the_author_meta('msn'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the MSN address of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('msn') * @see the_author_meta() */ function the_author_msn() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' ); the_author_meta('msn'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the AIM address of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('aim') * @see get_the_author_meta() * * @return string The author's AIM address. */ function get_the_author_aim() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' ); return get_the_author_meta('aim'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the AIM address of the author of the current post. * * @since 0.71 * @see the_author_meta() * @deprecated 2.8.0 * @deprecated Use the_author_meta('aim') */ function the_author_aim() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' ); the_author_meta('aim'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | /** * Retrieve the specified author's preferred display name. * * @since 1.0.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('display_name') * @see get_the_author_meta() * * @param int $auth_id The ID of the author. * @return string The author's display name. */ function get_author_name( $auth_id = false ) { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' ); return get_the_author_meta('display_name', $auth_id); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the URL to the home page of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('url') * @see get_the_author_meta() * * @return string The URL to the author's page. */ function get_the_author_url() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' ); return get_the_author_meta('url'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the URL to the home page of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('url') * @see the_author_meta() */ function the_author_url() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' ); the_author_meta('url'); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve the ID of the author of the current post. * * @since 1.5.0 * @deprecated 2.8.0 * @deprecated Use get_the_author_meta('ID') * @see get_the_author_meta() * * @return int The author's ID. */ function get_the_author_ID() { _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' ); return get_the_author_meta('ID'); } |
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Display the ID of the author of the current post. * * @since 0.71 * @deprecated 2.8.0 * @deprecated Use the_author_meta('ID') * @see the_author_meta() */ function the_author_ID() { _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' ); the_author_meta('ID'); } |
関数 the_content_rss()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | /** * Display the post content for the feed. * * For encoding the html or the $encode_html parameter, there are three possible * values. '0' will make urls footnotes and use make_url_footnote(). '1' will * encode special characters and automatically display all of the content. The * value of '2' will strip all HTML tags from the content. * * Also note that you cannot set the amount of words and not set the html * encoding. If that is the case, then the html encoding will default to 2, * which will strip all HTML tags. * * To restrict the amount of words of the content, you can use the cut * parameter. If the content is less than the amount, then there won't be any * dots added to the end. If there is content left over, then dots will be added * and the rest of the content will be removed. * * @since 0.71 * @uses apply_filters() Calls 'the_content_rss' on the content before processing. * * @deprecated 2.9.0 * @deprecated Use the_content_feed() * @see the_content_feed() * * @param string $more_link_text Optional. Text to display when more content is available but not displayed. * @param int|bool $stripteaser Optional. Default is 0. * @param string $more_file Optional. * @param int $cut Optional. Amount of words to keep for the content. * @param int $encode_html Optional. How to encode the content. */ function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { _deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' ); $content = get_the_content($more_link_text, $stripteaser); $content = apply_filters('the_content_rss', $content); if ( $cut && !$encode_html ) $encode_html = 2; if ( 1== $encode_html ) { $content = esc_html($content); $cut = 0; } elseif ( 0 == $encode_html ) { $content = make_url_footnote($content); } elseif ( 2 == $encode_html ) { $content = strip_tags($content); } if ( $cut ) { $blah = explode(' ', $content); if ( count($blah) > $cut ) { $k = $cut; $use_dotdotdot = 1; } else { $k = count($blah); $use_dotdotdot = 0; } /** @todo Check performance, might be faster to use array slice instead. */ for ( $i=0; $i<$k; $i++ ) $excerpt .= $blah[$i].' '; $excerpt .= ($use_dotdotdot) ? '...' : ''; $content = $excerpt; } $content = str_replace(']]>', ']]>', $content); echo $content; } |
関数 make_url_footnote()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | /** * Strip HTML and put links at the bottom of stripped content. * * Searches for all of the links, strips them out of the content, and places * them at the bottom of the content with numbers. * * @since 0.71 * @deprecated 2.9.0 * * @param string $content Content to get links * @return string HTML stripped out of content with links at the bottom. */ function make_url_footnote( $content ) { _deprecated_function( __FUNCTION__, '2.9', '' ); preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches ); $links_summary = "\n"; for ( $i=0; $i<count($matches[0]); $i++ ) { $link_match = $matches[0][$i]; $link_number = '['.($i+1).']'; $link_url = $matches[2][$i]; $link_text = $matches[4][$i]; $content = str_replace( $link_match, $link_text . ' ' . $link_number, $content ); $link_url = ( ( strtolower( substr( $link_url, 0, 7 ) ) != 'http://' ) && ( strtolower( substr( $link_url, 0, 8 ) ) != 'https://' ) ) ? get_option( 'home' ) . $link_url : $link_url; $links_summary .= "\n" . $link_number . ' ' . $link_url; } $content = strip_tags( $content ); $content .= $links_summary; return $content; } |
関数 _c()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | /** * Retrieve translated string with vertical bar context * * Quite a few times, there will be collisions with similar translatable text * found in more than two places but with different translated context. * * In order to use the separate contexts, the _c() function is used and the * translatable string uses a pipe ('|') which has the context the string is in. * * When the translated string is returned, it is everything before the pipe, not * including the pipe character. If there is no pipe in the translated text then * everything is returned. * * @since 2.2.0 * @deprecated 2.9.0 * @deprecated Use _x() * @see _x() * * @param string $text Text to translate * @param string $domain Optional. Domain to retrieve the translated text * @return string Translated context string without pipe */ function _c( $text, $domain = 'default' ) { _deprecated_function( __FUNCTION__, '2.9', '_x()' ); return before_last_bar( translate( $text, $domain ) ); } |
関数 translate_with_context()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | /** * Translates $text like translate(), but assumes that the text * contains a context after its last vertical bar. * * @since 2.5.0 * @uses translate() * @deprecated 3.0.0 * @deprecated Use _x() * @see _x() * * @param string $text Text to translate * @param string $domain Domain to retrieve the translated text * @return string Translated text */ function translate_with_context( $text, $domain = 'default' ) { _deprecated_function( __FUNCTION__, '2.9', '_x()' ); return before_last_bar( translate( $text, $domain ) ); } |
関数 _nc()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /** * A version of _n(), which supports contexts. * Strips everything from the translation after the last bar. * * @since 2.7.0 * @deprecated 3.0.0 * @deprecated Use _nx() * @see _nx() * @see _n() For parameters. * @see _c() For parameters. _c() is deprecated. * */ function _nc( $single, $plural, $number, $domain = 'default' ) { _deprecated_function( __FUNCTION__, '2.9', '_nx()' ); return before_last_bar( _n( $single, $plural, $number, $domain ) ); } |
関数 __ngettext()
1 2 3 4 5 6 7 8 9 10 11 12 13 | /** * Retrieve the plural or single form based on the amount. * * @since 1.2.0 * @deprecated 2.8.0 * @deprecated Use _n() * @see _n() */ function __ngettext() { _deprecated_function( __FUNCTION__, '2.8', '_n()' ); $args = func_get_args(); return call_user_func_array('_n', $args); } |
関数 __ngettext_noop()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Register plural strings in POT file, but don't translate them. * * @since 2.5.0 * @deprecated 2.8.0 * @deprecated Use _n_noop() * @see _n_noop() */ function __ngettext_noop() { _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' ); $args = func_get_args(); return call_user_func_array('_n_noop', $args); } |
関数 get_alloptions()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Retrieve all autoload options, or all options if no autoloaded ones exist. * * @since 1.0.0 * @deprecated 3.0.0 * @deprecated Use wp_load_alloptions()) * @see wp_load_alloptions() * * @return array List of all options. */ function get_alloptions() { _deprecated_function( __FUNCTION__, '3.0', 'wp_load_alloptions()' ); return wp_load_alloptions(); } |
関数 get_the_attachment_link()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | /** * Retrieve HTML content of attachment image with link. * * @since 2.0.0 * @deprecated 2.5.0 * @deprecated Use wp_get_attachment_link() * @see wp_get_attachment_link() * * @param int $id Optional. Post ID. * @param bool $fullsize Optional, default is false. Whether to use full size image. * @param array $max_dims Optional. Max image dimensions. * @param bool $permalink Optional, default is false. Whether to include permalink to image. * @return string */ function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' ); $id = (int) $id; $_post = get_post($id); if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) return __('Missing Attachment'); if ( $permalink ) $url = get_attachment_link($_post->ID); $post_title = esc_attr($_post->post_title); $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); return "<a href='$url' title='$post_title'>$innerHTML</a>"; } |
関数 get_attachment_icon_src()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | /** * Retrieve icon URL and Path. * * @since 2.1.0 * @deprecated 2.5.0 * @deprecated Use wp_get_attachment_image_src() * @see wp_get_attachment_image_src() * * @param int $id Optional. Post ID. * @param bool $fullsize Optional, default to false. Whether to have full image. * @return array Icon URL and full path to file, respectively. */ function get_attachment_icon_src( $id = 0, $fullsize = false ) { _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' ); $id = (int) $id; if ( !$post = get_post($id) ) return false; $file = get_attached_file( $post->ID ); if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) { // We have a thumbnail desired, specified and existing $src_file = basename($src); } elseif ( wp_attachment_is_image( $post->ID ) ) { // We have an image without a thumbnail $src = wp_get_attachment_url( $post->ID ); $src_file = & $file; } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { // No thumb, no image. We'll look for a mime-related icon instead. $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); $src_file = $icon_dir . '/' . basename($src); } if ( !isset($src) || !$src ) return false; return array($src, $src_file); } |