関数 get_bloginfo()
2014/12/25
関数 get_bloginfo()
定義ファイル :/blog/wp-includes/general-template.php 2
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | function get_bloginfo( $show = '', $filter = 'raw' ) { switch( $show ) { case 'home' : // DEPRECATED case 'siteurl' : // DEPRECATED _deprecated_argument( __FUNCTION__, '2.2', sprintf( __('The <code>%s</code> option is deprecated for the family of <code>bloginfo()</code> functions.' ), $show ) . ' ' . sprintf( __( 'Use the <code>%s</code> option instead.' ), 'url' ) ); case 'url' : $output = home_url(); break; case 'wpurl' : $output = site_url(); break; case 'description': $output = get_option('blogdescription'); break; case 'rdf_url': $output = get_feed_link('rdf'); break; case 'rss_url': $output = get_feed_link('rss'); break; case 'rss2_url': $output = get_feed_link('rss2'); break; case 'atom_url': $output = get_feed_link('atom'); break; case 'comments_atom_url': $output = get_feed_link('comments_atom'); break; case 'comments_rss2_url': $output = get_feed_link('comments_rss2'); break; case 'pingback_url': $output = site_url( 'xmlrpc.php' ); break; case 'stylesheet_url': $output = get_stylesheet_uri(); break; case 'stylesheet_directory': $output = get_stylesheet_directory_uri(); break; case 'template_directory': case 'template_url': $output = get_template_directory_uri(); break; case 'admin_email': $output = get_option('admin_email'); break; case 'charset': $output = get_option('blog_charset'); if ('' == $output) $output = 'UTF-8'; break; case 'html_type' : $output = get_option('html_type'); break; case 'version': global $wp_version; $output = $wp_version; break; case 'language': $output = get_locale(); $output = str_replace('_', '-', $output); break; case 'text_direction': //_deprecated_argument( __FUNCTION__, '2.2', sprintf( __('The <code>%s</code> option is deprecated for the family of <code>bloginfo()</code> functions.' ), $show ) . ' ' . sprintf( __( 'Use the <code>%s</code> function instead.' ), 'is_rtl()' ) ); if ( function_exists( 'is_rtl' ) ) { $output = is_rtl() ? 'rtl' : 'ltr'; } else { $output = 'ltr'; } break; case 'name': default: $output = get_option('blogname'); break; } $url = true; if (strpos($show, 'url') === false && strpos($show, 'directory') === false && strpos($show, 'home') === false) $url = false; if ( 'display' == $filter ) { if ( $url ) { $output = apply_filters( 'bloginfo_url', $output, $show ); } else { $output = apply_filters( 'bloginfo', $output, $show ); } } return $output; } |