WordPressを読む 53-2 /blog/wp-includes/deprecated.php 2
2015/02/11
目次
- 1 /blog/wp-includes/deprecated.php 2
- 2 関数 get_linkobjects()
- 3 関数 get_linksbyname_withrating()
- 4 関数 get_links_withrating()
- 5 関数 get_autotoggle()
- 6 関数 list_cats()
- 7 関数 wp_list_cats()
- 8 関数 dropdown_cats()
- 9 関数 list_authors()
- 10 関数 wp_get_post_cats()
- 11 関数 wp_set_post_cats()
- 12 関数 get_archives()
- 13 関数 get_author_link()
- 14 関数 link_pages()
- 15 関数 get_settings()
- 16 関数 permalink_link()
- 17 関数 permalink_single_rss()
- 18 関数 wp_get_links()
/blog/wp-includes/deprecated.php 2
関数 get_linkobjects()
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 | /** * Gets an array of link objects associated with category n. * * Usage: * <code> * $links = get_linkobjects(1); * if ($links) { * foreach ($links as $link) { * echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>'; * } * } * * * Fields are: * <ol> * <li>link_id</li> * <li>link_url</li> * <li>link_name</li> * <li>link_image</li> * <li>link_target</li> * <li>link_category</li> * <li>link_description</li> * <li>link_visible</li> * <li>link_owner</li> * <li>link_rating</li> * <li>link_updated</li> * <li>link_rel</li> * <li>link_notes</li> * </ol> * * @since 1.0.1 * @deprecated 2.1.0 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param int $category The category to use. If no category supplied uses all * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the * order which will return links in a random order. * @param int $limit Limit to X entries. If not specified, all entries are shown. * @return unknown */ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); $links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ; $links_array = array(); foreach ($links as $link) $links_array[] = $link; return $links_array; } |
関数 get_linksbyname_withrating()
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 | /** * Gets the links associated with category 'cat_name' and display rating stars/chars. * * @since 0.71 * @deprecated 2.1.0 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param string $cat_name The category name to use. If no match is found uses all * @param string $before The html to output before the link * @param string $after The html to output after the link * @param string $between The html to output between the link/image and its description. Not used if no image or show_images is true * @param bool $show_images Whether to show images (if defined). * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the * order which will return links in a random order. * @param bool $show_description Whether to show the description if show_images=false/not defined * @param int $limit Limit to X entries. If not specified, all entries are shown. * @param int $show_updated Whether to show last updated timestamp */ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } |
関数 get_links_withrating()
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 | /** * Gets the links associated with category n and display rating stars/chars. * * @since 0.71 * @deprecated 2.1.0 * @deprecated Use get_bookmarks() * @see get_bookmarks() * * @param int $category The category to use. If no category supplied uses all * @param string $before The html to output before the link * @param string $after The html to output after the link * @param string $between The html to output between the link/image and its description. Not used if no image or show_images == true * @param bool $show_images Whether to show images (if defined). * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', * 'description', or 'rating'. Or maybe owner. If you start the name with an * underscore the order will be reversed. You can also specify 'rand' as the * order which will return links in a random order. * @param bool $show_description Whether to show the description if show_images=false/not defined. * @param string $limit Limit to X entries. If not specified, all entries are shown. * @param int $show_updated Whether to show last updated timestamp */ function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } |
関数 get_autotoggle()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Gets the auto_toggle setting. * * @since 0.71 * @deprecated 2.1.0 * @deprecated No alternative function available * * @param int $id The category to get. If no category supplied uses 0 * @return int Only returns 0. */ function get_autotoggle($id = 0) { _deprecated_function( __FUNCTION__, '2.1' ); return 0; } |
関数 list_cats()
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 | /** * @since 0.71 * @deprecated 2.1.0 * @deprecated Use wp_list_categories() * @see wp_list_categories() * * @param int $optionall * @param string $all * @param string $sort_column * @param string $sort_order * @param string $file * @param bool $list * @param int $optiondates * @param int $optioncount * @param int $hide_empty * @param int $use_desc_for_title * @param bool $children * @param int $child_of * @param int $categories * @param int $recurse * @param string $feed * @param string $feed_image * @param string $exclude * @param bool $hierarchical * @return unknown */ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { _deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' ); $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); return wp_list_cats($query); } |
関数 wp_list_cats()
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 | /** * @since 1.2.0 * @deprecated 2.1.0 * @deprecated Use wp_list_categories() * @see wp_list_categories() * * @param string|array $args * @return unknown */ function wp_list_cats($args = '') { _deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' ); $r = wp_parse_args( $args ); // Map to new names. if ( isset($r['optionall']) && isset($r['all'])) $r['show_option_all'] = $r['all']; if ( isset($r['sort_column']) ) $r['orderby'] = $r['sort_column']; if ( isset($r['sort_order']) ) $r['order'] = $r['sort_order']; if ( isset($r['optiondates']) ) $r['show_last_update'] = $r['optiondates']; if ( isset($r['optioncount']) ) $r['show_count'] = $r['optioncount']; if ( isset($r['list']) ) $r['style'] = $r['list'] ? 'list' : 'break'; $r['title_li'] = ''; return wp_list_categories($r); } |
関数 dropdown_cats()
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 | /** * @since 0.71 * @deprecated 2.1.0 * @deprecated Use wp_dropdown_categories() * @see wp_dropdown_categories() * * @param int $optionall * @param string $all * @param string $orderby * @param string $order * @param int $show_last_update * @param int $show_count * @param int $hide_empty * @param bool $optionnone * @param int $selected * @param int $exclude * @return unknown */ function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, $selected = 0, $exclude = 0) { _deprecated_function( __FUNCTION__, '2.1', 'wp_dropdown_categories()' ); $show_option_all = ''; if ( $optionall ) $show_option_all = $all; $show_option_none = ''; if ( $optionnone ) $show_option_none = __('None'); $vars = compact('show_option_all', 'show_option_none', 'orderby', 'order', 'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude'); $query = add_query_arg($vars, ''); return wp_dropdown_categories($query); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /** * List authors. * * @since 1.2.0 * @deprecated 2.1.0 * @deprecated Use wp_list_authors() * @see wp_list_authors() * * @param bool $optioncount * @param bool $exclude_admin * @param bool $show_fullname * @param bool $hide_empty * @param string $feed * @param string $feed_image * @return unknown */ function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { _deprecated_function( __FUNCTION__, '2.1', 'wp_list_authors()' ); $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); return wp_list_authors($args); } |
関数 wp_get_post_cats()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * @since 1.0.1 * @deprecated 2.1.0 * @deprecated Use wp_get_post_categories() * @see wp_get_post_categories() * * @param int $blogid Not Used * @param int $post_ID * @return unknown */ function wp_get_post_cats($blogid = '1', $post_ID = 0) { _deprecated_function( __FUNCTION__, '2.1', 'wp_get_post_categories()' ); return wp_get_post_categories($post_ID); } |
関数 wp_set_post_cats()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /** * Sets the categories that the post id belongs to. * * @since 1.0.1 * @deprecated 2.1.0 * @deprecated Use wp_set_post_categories() * @see wp_set_post_categories() * * @param int $blogid Not used * @param int $post_ID * @param array $post_categories * @return unknown */ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { _deprecated_function( __FUNCTION__, '2.1', 'wp_set_post_categories()' ); return wp_set_post_categories($post_ID, $post_categories); } |
関数 get_archives()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | /** * @since 0.71 * @deprecated 2.1.0 * @deprecated Use wp_get_archives() * @see wp_get_archives() * * @param string $type * @param string $limit * @param string $format * @param string $before * @param string $after * @param bool $show_post_count * @return unknown */ function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { _deprecated_function( __FUNCTION__, '2.1', 'wp_get_archives()' ); $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); return wp_get_archives($args); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /** * Returns or Prints link to the author's posts. * * @since 1.2.0 * @deprecated 2.1.0 * @deprecated Use get_author_posts_url() * @see get_author_posts_url() * * @param bool $echo * @param int $author_id * @param string $author_nicename Optional. * @return string|null */ function get_author_link($echo, $author_id, $author_nicename = '') { _deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' ); $link = get_author_posts_url($author_id, $author_nicename); if ( $echo ) echo $link; return $link; } |
関数 link_pages()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /** * Print list of pages based on arguments. * * @since 0.71 * @deprecated 2.1.0 * @deprecated Use wp_link_pages() * @see wp_link_pages() * * @param string $before * @param string $after * @param string $next_or_number * @param string $nextpagelink * @param string $previouspagelink * @param string $pagelink * @param string $more_file * @return string */ function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { _deprecated_function( __FUNCTION__, '2.1', 'wp_link_pages()' ); $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); return wp_link_pages($args); } |
関数 get_settings()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /** * Get value based on option. * * @since 0.71 * @deprecated 2.1.0 * @deprecated Use get_option() * @see get_option() * * @param string $option * @return string */ function get_settings($option) { _deprecated_function( __FUNCTION__, '2.1', 'get_option()' ); return get_option($option); } |
関数 permalink_link()
1 2 3 4 5 6 7 8 9 10 11 12 | /** * Print the permalink of the current post in the loop. * * @since 0.71 * @deprecated 1.2.0 * @deprecated Use the_permalink() * @see the_permalink() */ function permalink_link() { _deprecated_function( __FUNCTION__, '1.2', 'the_permalink()' ); the_permalink(); } |
関数 permalink_single_rss()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /** * Print the permalink to the RSS feed. * * @since 0.71 * @deprecated 2.3.0 * @deprecated Use the_permalink_rss() * @see the_permalink_rss() * * @param string $deprecated */ function permalink_single_rss($deprecated = '') { _deprecated_function( __FUNCTION__, '2.3', 'the_permalink_rss()' ); the_permalink_rss(); } |
関数 wp_get_links()
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 | /** * Gets the links associated with category. * * @see get_links() for argument information that can be used in $args * @since 1.0.1 * @deprecated 2.1.0 * @deprecated Use wp_list_bookmarks() * @see wp_list_bookmarks() * * @param string $args a query string * @return null|string */ function wp_get_links($args = '') { _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' ); if ( strpos( $args, '=' ) === false ) { $cat_id = $args; $args = add_query_arg( 'category', $cat_id, $args ); } $defaults = array( 'after' => '<br />', 'before' => '', 'between' => ' ', 'categorize' => 0, 'category' => '', 'echo' => true, 'limit' => -1, 'orderby' => 'name', 'show_description' => true, 'show_images' => true, 'show_rating' => false, 'show_updated' => true, 'title_li' => '', ); $r = wp_parse_args( $args, $defaults ); return wp_list_bookmarks($r); } |