{"id":156243,"date":"2013-01-09T14:01:23","date_gmt":"2013-01-09T05:01:23","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/2013\/01\/09\/%e3%83%98%e3%83%83%e3%83%80%e3%83%bc%e3%81%8c%e3%83%89%e3%82%a2%e3%83%83%e3%83%97%e3%81%aa%e3%81%ae%e3%81%a7%e3%81%99%e3%81%8c%e2%80%a6\/"},"modified":"2013-01-09T14:01:23","modified_gmt":"2013-01-09T05:01:23","slug":"%e3%83%98%e3%83%83%e3%83%80%e3%83%bc%e3%81%8c%e3%83%89%e3%82%a2%e3%83%83%e3%83%97%e3%81%aa%e3%81%ae%e3%81%a7%e3%81%99%e3%81%8c%e2%80%a6","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/%e3%83%98%e3%83%83%e3%83%80%e3%83%bc%e3%81%8c%e3%83%89%e3%82%a2%e3%83%83%e3%83%97%e3%81%aa%e3%81%ae%e3%81%a7%e3%81%99%e3%81%8c%e2%80%a6\/","title":{"rendered":"\u30d8\u30c3\u30c0\u30fc\u304c\u30c9\u30a2\u30c3\u30d7\u306a\u306e\u3067\u3059\u304c\u2026"},"content":{"rendered":"<p>\u56fd\u5916\u6709\u6599\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30d8\u30c3\u30c0\u30fc\u753b\u50cf\u304c\u51c4\u304f\u30a2\u30c3\u30d7\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u30d4\u30af\u30bb\u30eb\u5909\u66f4(800px\u524d\u5f8c)\u306a\u3069\u3082\u8a66\u3057\u307e\u3057\u305f\u304c\u76f4\u308a\u307e\u305b\u3093\u3002<br \/>\n\u304d\u3063\u3068php\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u306e\u5f71\u97ff\u306a\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u9055\u3046\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n\u3069\u306a\u305f\u304b\u89e3\u6c7a\u3057\u3066\u9802\u3051\u307e\u3059\u304b\uff1f<\/p>\n<p>\u5909\u66f4\u3059\u308b\u306e\u306f\u3001header.php\u306a\u306e\u304b\u3001functions.php\u306a\u306e\u304b\u3082\u5206\u304b\u3089\u306a\u3044\u7a0b\u306b\u7121\u77e5\u3067\u3059\u3002<br \/>\n\u3069\u3053\u3092\u3069\u3046\u4fee\u6b63\u3057\u305f\u3089\u3001\u89e3\u6c7a\u51fa\u6765\u307e\u3059\u304b\uff1f<\/p>\n<p>\uff08\u4e0b\u8a18\u306b\u3001header.php\u3068functions.php\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6dfb\u4ed8\u3057\u307e\u3059\uff09<\/p>\n<p>\u3010header.php\u3011&#8212;&#8212;&#8212;-<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;!&#8211;[if lt IE 7 ]&gt;&lt;html class=&#8221;ie ie6&#8243; &lt;?php language_attributes();?&gt;&gt; &lt;![endif]&#8211;&gt;<br \/>\n&lt;!&#8211;[if IE 7 ]&gt;&lt;html class=&#8221;ie ie7&#8243; &lt;?php language_attributes();?&gt;&gt; &lt;![endif]&#8211;&gt;<br \/>\n&lt;!&#8211;[if IE 8 ]&gt;&lt;html class=&#8221;ie ie8&#8243; &lt;?php language_attributes();?&gt;&gt; &lt;![endif]&#8211;&gt;<br \/>\n&lt;!&#8211;[if IE 9 ]&gt;&lt;html class=&#8221;ie ie9&#8243; &lt;?php language_attributes();?&gt;&gt; &lt;![endif]&#8211;&gt;<br \/>\n&lt;!&#8211;[if (gt IE 9)|!(IE)]&gt;&lt;!&#8211;&gt;&lt;html &lt;?php language_attributes();?&gt;&gt; &lt;!&#8211;&lt;![endif]&#8211;&gt;<br \/>\n&lt;head&gt;<br \/>\n\t&lt;title&gt;&lt;?php if ( is_category() ) {<br \/>\n\t\techo __(&#8216;Category Archive for &quot;&#8217;, &#8216;theme1722&#8217;); single_cat_title(); echo __(&#8216;&quot; | &#8216;, &#8216;theme1722&#8217;); bloginfo( &#8216;name&#8217; );<br \/>\n\t} elseif ( is_tag() ) {<br \/>\n\t\techo __(&#8216;Tag Archive for &quot;&#8217;, &#8216;theme1722&#8217;); single_tag_title(); echo __(&#8216;&quot; | &#8216;, &#8216;theme1722&#8217;); bloginfo( &#8216;name&#8217; );<br \/>\n\t} elseif ( is_archive() ) {<br \/>\n\t\twp_title(&#8221;); echo __(&#8216; Archive | &#8216;, &#8216;theme1722&#8217;); bloginfo( &#8216;name&#8217; );<br \/>\n\t} elseif ( is_search() ) {<br \/>\n\t\techo __(&#8216;Search for &quot;&#8217;, &#8216;theme1722&#8217;).wp_specialchars($s).__(&#8216;&quot; | &#8216;, &#8216;theme1722&#8217;); bloginfo( &#8216;name&#8217; );<br \/>\n\t} elseif ( is_home() || is_front_page()) {<br \/>\n\t\tbloginfo( &#8216;name&#8217; ); echo &#8216; | &#8216;; bloginfo( &#8216;description&#8217; );<br \/>\n\t}  elseif ( is_404() ) {<br \/>\n\t\techo __(&#8216;Error 404 Not Found | &#8216;, &#8216;theme1722&#8217;); bloginfo( &#8216;name&#8217; );<br \/>\n\t} elseif ( is_single() ) {<br \/>\n\t\twp_title(&#8221;);<br \/>\n\t} else {<br \/>\n\t\techo wp_title( &#8216; | &#8216;, false, right ); bloginfo( &#8216;name&#8217; );<br \/>\n\t} ?&gt;&lt;\/title&gt;<br \/>\n\t&lt;meta name=&#8221;description&#8221; content=&#8221;&lt;?php wp_title(); echo &#8216; | &#8216;; bloginfo( &#8216;description&#8217; ); ?&gt;&#8221; \/&gt;<br \/>\n\t&lt;meta charset=&#8221;&lt;?php bloginfo( &#8216;charset&#8217; ); ?&gt;&#8221; \/&gt;<br \/>\n\t&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width,initial-scale=1.0&#8243;&gt;<br \/>\n\t&lt;link rel=&#8221;profile&#8221; href=&#8221;http:\/\/gmpg.org\/xfn\/11&#8243; \/&gt;<br \/>\n\t&lt;link rel=&#8221;icon&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/favicon.ico&#8221; type=&#8221;image\/x-icon&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;pingback&#8221; href=&#8221;&lt;?php bloginfo( &#8216;pingback_url&#8217; ); ?&gt;&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;alternate&#8221; type=&#8221;application\/rss+xml&#8221; title=&#8221;&lt;?php bloginfo( &#8216;name&#8217; ); ?&gt;&#8221; href=&#8221;&lt;?php bloginfo( &#8216;rss2_url&#8217; ); ?&gt;&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;alternate&#8221; type=&#8221;application\/atom+xml&#8221; title=&#8221;&lt;?php bloginfo( &#8216;name&#8217; ); ?&gt;&#8221; href=&#8221;&lt;?php bloginfo( &#8216;atom_url&#8217; ); ?&gt;&#8221; \/&gt;<br \/>\n\t&lt;?php \/* The HTML5 Shim is required for older browsers, mainly older versions IE *\/ ?&gt;<br \/>\n\t&lt;!&#8211;[if lt IE 8]&gt;<br \/>\n    &lt;div style=&#8217; clear: both; text-align:center; position: relative;&#8217;&gt;<br \/>\n    \t<a href=\"http:\/\/www.microsoft.com\/windows\/internet-explorer\/default.aspx?ocid=ie6_countdown_bannercode\">&lt;img src=&#8221;http:\/\/storage.ie6countdown.com\/assets\/100\/images\/banners\/warning_bar_0000_us.jpg&#8221; border=&#8221;0&#8243; alt=&#8221;&#8221; \/&gt;<\/a><br \/>\n    &lt;\/div&gt;<br \/>\n\t&lt;![endif]&#8211;&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/normalize.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;stylesheet_url&#8217; ); ?&gt;&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/prettyPhoto.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/cameraslideshow.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/flexslider.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/skeleton.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/touchTouch.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/320.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/480.css&#8221; \/&gt;<br \/>\n\t&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;all&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/768.css&#8221; \/&gt;<br \/>\n\t&lt;!&#8211;[if lt IE 9]&gt;<br \/>\n  \t\t&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/css\/ie.css&#8221;&gt;<br \/>\n\t&lt;![endif]&#8211;&gt;<br \/>\n\t&lt;?php<br \/>\n\t\t\/* We add some JavaScript to pages with the comment form<br \/>\n\t\t * to support sites with threaded comments (when in use).<br \/>\n\t\t *\/<br \/>\n\t\tif ( is_singular() &amp;&amp; get_option( &#8216;thread_comments&#8217; ) )<br \/>\n\t\t\twp_enqueue_script( &#8216;comment-reply&#8217; );<\/p>\n<p>\t\t\/* Always have wp_head() just before the closing &lt;\/head&gt;<br \/>\n\t\t * tag of your theme, or you will break many plugins, which<br \/>\n\t\t * generally use this hook to add elements to &lt;head&gt; such<br \/>\n\t\t * as styles, scripts, and meta tags.<br \/>\n\t\t *\/<br \/>\n\t\twp_head();<br \/>\n\t?&gt;<br \/>\n  &lt;!&#8211;[if lt IE 9]&gt;<br \/>\n  &lt;style type=&#8221;text\/css&#8221;&gt;<br \/>\n\t.flex-control-paging li a\t{<br \/>\n      behavior:url(&lt;?php bloginfo(&#8216;stylesheet_directory&#8217;); ?&gt;\/PIE.php)<br \/>\n    }<br \/>\n  &lt;\/style&gt;<br \/>\n  &lt;![endif]&#8211;&gt;<br \/>\n  &lt;!&#8211;[if (gt IE 9)|!(IE)]&gt;&lt;!&#8211;&gt;<br \/>\n\t&lt;script src=&#8221;&lt;?php bloginfo( &#8216;template_url&#8217; ); ?&gt;\/js\/jquery.mobile.customized.min.js&#8221; type=&#8221;text\/javascript&#8221;&gt;&lt;\/script&gt;<br \/>\n  &lt;!&#8211;&lt;![endif]&#8211;&gt;<\/p>\n<p>\t&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n  \t\/\/ initialise plugins<br \/>\n\t\tjQuery(function(){<br \/>\n\t\t\t\/\/ main navigation init<br \/>\n\t\t\tjQuery(&#8216;ul.sf-menu&#8217;).superfish({<br \/>\n\t\t\t\tdelay:       &lt;?php echo of_get_option(&#8216;sf_delay&#8217;); ?&gt;, \t\t\/\/ one second delay on mouseout<br \/>\n\t\t\t\tanimation:   {opacity:'&lt;?php echo of_get_option(&#8216;sf_f_animation&#8217;); ?&gt;'&lt;?php if (of_get_option(&#8216;sf_sl_animation&#8217;)==&#8217;show&#8217;) { ?&gt;,height:'&lt;?php echo of_get_option(&#8216;sf_sl_animation&#8217;); ?&gt;'&lt;?php } ?&gt;}, \/\/ fade-in and slide-down animation<br \/>\n\t\t\t\tspeed:       &#8216;&lt;?php echo of_get_option(&#8216;sf_speed&#8217;); ?&gt;&#8217;,  \/\/ faster animation speed<br \/>\n\t\t\t\tautoArrows:  &lt;?php echo of_get_option(&#8216;sf_arrows&#8217;); ?&gt;,   \/\/ generation of arrow mark-up (for submenu)<br \/>\n\t\t\t\tdropShadows: &lt;?php echo of_get_option(&#8216;sf_shadows&#8217;); ?&gt;   \/\/ drop shadows (for submenu)<br \/>\n\t\t\t});<\/p>\n<p>\t\t\t\/\/ prettyphoto init<br \/>\n\t\t\tjQuery(&#8220;a[rel^=&#8217;prettyPhoto&#8217;]&#8221;).prettyPhoto({<br \/>\n\t\t\t\tanimation_speed:&#8217;normal&#8217;,<br \/>\n\t\t\t\tslideshow:5000,<br \/>\n\t\t\t\tautoplay_slideshow: false,<br \/>\n\t\t\t\toverlay_gallery: true<br \/>\n\t\t\t});<\/p>\n<p>\t\t\t\/\/ Initialize the gallery<br \/>\n\t\t\tjQuery(&#8220;#gallery .touch-item&#8221;).touchTouch();<\/p>\n<p>\t\t});<\/p>\n<p>\t\t\/\/ Init for audiojs<br \/>\n\t\taudiojs.events.ready(function() {<br \/>\n\t\t\tvar as = audiojs.createAll();<br \/>\n\t\t});<br \/>\n\t\t$(function(){<br \/>\n\t\t\t$(&#8216;.sf-menu &gt; li&#8217;).append(&#8216;&lt;span class=&#8221;bg-menu&#8221;&gt;&lt;\/span&gt;&#8217;);<br \/>\n\t\t\t$(&#8216;.featured-thumbnail a, #gallery .portfolio li a.image-wrap, .post-single .featured-thumbnail, .author-info .avatar, .popular-posts li .post-thumb a, article.testimonial .featured-thumbnail, .testi-single .featured-thumbnail&#8217;).append(&#8216;&lt;span class=&#8221;stroke&#8221;&gt;&lt;\/span&gt;&#8217;);<br \/>\n\t\t\t$(&#8216;.featured-thumbnail a, #gallery .portfolio li a.image-wrap, .popular-posts li .post-thumb a&#8217;).hover(<br \/>\n\t\t\t\tfunction(){$(this).find(&#8216;.stroke&#8217;).stop().animate({opacity:0}, 350)},<br \/>\n\t\t\t\tfunction(){$(this).find(&#8216;.stroke&#8217;).stop().animate({opacity:.75}, 350)}<br \/>\n\t\t\t);<br \/>\n\t\t\t$(&#8216;.recent-posts.events li:nth-child(4n)&#8217;).addClass(&#8216;nomargin&#8217;);<br \/>\n\t\t\tif ($.browser.msie &amp;&amp; $.browser.version &lt; 10) {<br \/>\n\t\t\t\tjQuery(&#8216;input[type=&#8221;submit&#8221;], input[type=&#8221;reset&#8221;]&#8217;).hover(function(){<br \/>\n\t\t\t\t  \tjQuery(this).addClass(&#8216;submit-hover&#8217;)<br \/>\n\t\t\t\t },<br \/>\n\t\t\t\t\t function(){<br \/>\n\t\t\t\t\t  jQuery(this).removeClass(&#8216;submit-hover&#8217;)<br \/>\n\t\t\t\t });<br \/>\n\t\t\t}<br \/>\n\t\t});<br \/>\n\t&lt;\/script&gt;<br \/>\n\t&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n\t\tjQuery(window).load(function() {<br \/>\n\t\t\t$(&#8216;#topnav&#8217;).css({display:&#8217;block&#8217;});<br \/>\n\t\t});<br \/>\n\t&lt;\/script&gt;<\/p>\n<p>\t&lt;!&#8211;[if (gt IE 9)|!(IE)]&gt;&lt;!&#8211;&gt;<br \/>\n\t&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n\t\tjQuery(function(){<br \/>\n\t\t\tjQuery(&#8216;.sf-menu&#8217;).mobileMenu({<br \/>\n\t\t\t\tcombine: false,<br \/>\n\t\t\t\tswitchWidth:768,<br \/>\n\t\t\t\tprependTo: &#8216;nav.primary&#8217;<br \/>\n\t\t\t});<br \/>\n\t\t})<br \/>\n\t&lt;\/script&gt;<br \/>\n\t&lt;!&#8211;&lt;![endif]&#8211;&gt;<\/p>\n<p>  &lt;!&#8211; Custom CSS &#8211;&gt;<br \/>\n\t&lt;?php if(of_get_option(&#8216;custom_css&#8217;) != &#8221;){?&gt;<br \/>\n  &lt;style type=&#8221;text\/css&#8221;&gt;<br \/>\n  \t&lt;?php echo of_get_option(&#8216;custom_css&#8217; ) ?&gt;<br \/>\n  &lt;\/style&gt;<br \/>\n  &lt;?php }?&gt;<\/p>\n<p>  &lt;style type=&#8221;text\/css&#8221;&gt;<br \/>\n\t\t&lt;?php $background = of_get_option(&#8216;body_background&#8217;);<br \/>\n\t\t\tif ($background != &#8221;) {<br \/>\n\t\t\t\tif ($background[&#8216;image&#8217;] != &#8221;) {<br \/>\n\t\t\t\t\techo &#8216;body { background-image:url(&#8216;.$background[&#8216;image&#8217;]. &#8216;); background-repeat:&#8217;.$background[&#8216;repeat&#8217;].&#8217;; background-position:&#8217;.$background[&#8216;position&#8217;].&#8217;;  background-attachment:&#8217;.$background[&#8216;attachment&#8217;].&#8217;; }&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t\tif($background[&#8216;color&#8217;] != &#8221;) {<br \/>\n\t\t\t\t\techo &#8216;body { background-color:&#8217;.$background[&#8216;color&#8217;]. &#8216;}&#8217;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t};<br \/>\n\t\t?&gt;<\/p>\n<p>\t\t&lt;?php $header_styling = of_get_option(&#8216;header_color&#8217;);<br \/>\n\t\t\tif($header_styling != &#8221;) {<br \/>\n\t\t\t\techo &#8216;#header {background-color:&#8217;.$header_styling.&#8217;}&#8217;;<br \/>\n\t\t\t}<br \/>\n\t\t?&gt;<\/p>\n<p>\t\t&lt;?php $links_styling = of_get_option(&#8216;links_color&#8217;);<br \/>\n\t\t\tif($links_styling) {<br \/>\n\t\t\t\techo &#8216;a{color:&#8217;.$links_styling.&#8217;}&#8217;;<br \/>\n\t\t\t\techo &#8216;.button {background:&#8217;.$links_styling.&#8217;}&#8217;;<br \/>\n\t\t\t}<br \/>\n\t\t?&gt;<\/p>\n<p>\t\t&lt;?php $body_typography = of_get_option(&#8216;body_typography&#8217;);<br \/>\n\t\t\tif($body_typography) {<br \/>\n\t\t\t\techo &#8216;body {font-family:&#8217;.$body_typography[&#8216;face&#8217;].&#8217;; color:&#8217;.$body_typography[&#8216;color&#8217;].&#8217;}&#8217;;<br \/>\n\t\t\t\techo &#8216;#main {font-size:&#8217;.$body_typography[&#8216;size&#8217;].&#8217;; font-style:&#8217;.$body_typography[&#8216;style&#8217;].&#8217;;}&#8217;;<br \/>\n\t\t\t}<br \/>\n\t\t?&gt;<br \/>\n  &lt;\/style&gt;<br \/>\n&lt;\/head&gt;<\/p>\n<p>&lt;body &lt;?php body_class(); ?&gt;&gt;<\/p>\n<p>&lt;div id=&#8221;main&#8221;&gt;&lt;!&#8211; this encompasses the entire Web site &#8211;&gt;<br \/>\n\t&lt;header id=&#8221;header&#8221;&gt;<br \/>\n\t\t&lt;div class=&#8221;row-top&#8221;&gt;<br \/>\n\t\t\t&lt;div class=&#8221;content-box clearfix&#8221;&gt;<br \/>\n\t\t\t\t&lt;div id=&#8221;widget-header&#8221;&gt;<br \/>\n\t\t\t\t\t&lt;?php if ( ! dynamic_sidebar( &#8216;Header&#8217; ) ) : ?&gt;&lt;!&#8211; Wigitized Header &#8211;&gt;&lt;?php endif ?&gt;<br \/>\n\t\t\t\t&lt;\/div&gt;&lt;!&#8211;#widget-header&#8211;&gt;<br \/>\n\t\t\t&lt;\/div&gt;<br \/>\n\t\t&lt;\/div&gt;&lt;!&#8211;.row-top&#8211;&gt;<br \/>\n\t\t&lt;div class=&#8221;row-logo&#8221;&gt;<br \/>\n\t\t\t&lt;div class=&#8221;content-box clearfix&#8221;&gt;<br \/>\n\t\t\t\t&lt;div class=&#8221;logo&#8221;&gt;<br \/>\n\t\t\t\t  &lt;?php if(of_get_option(&#8216;logo_type&#8217;) == &#8216;text_logo&#8217;){?&gt;<br \/>\n\t\t\t\t\t&lt;?php if( is_front_page() || is_home() || is_404() ) { ?&gt;<br \/>\n\t\t\t\t\t  &lt;h1&gt;<a>\/&#8221; title=&#8221;&lt;?php bloginfo(&#8216;description&#8217;); ?&gt;&#8221;&gt;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;<\/a>&lt;\/h1&gt;<br \/>\n\t\t\t\t\t&lt;?php } else { ?&gt;<br \/>\n\t\t\t\t\t  &lt;h2&gt;<a>\/&#8221; title=&#8221;&lt;?php bloginfo(&#8216;description&#8217;); ?&gt;&#8221;&gt;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;<\/a>&lt;\/h2&gt;<br \/>\n\t\t\t\t\t&lt;?php } ?&gt;<br \/>\n\t\t\t\t  &lt;?php } else { ?&gt;<br \/>\n\t\t\t\t\t&lt;?php if(of_get_option(&#8216;logo_url&#8217;) != &#8221;){ ?&gt;<br \/>\n\t\t\t\t\t\t<a>\/&#8221; id=&#8221;logo&#8221;&gt;&lt;img src=&#8221;&lt;?php echo of_get_option(&#8216;logo_url&#8217;, &#8220;&#8221; ); ?&gt;&#8221; alt=&#8221;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&#8221; title=&#8221;&lt;?php bloginfo(&#8216;description&#8217;); ?&gt;&#8221;&gt;<\/a><br \/>\n\t\t\t\t\t&lt;?php } else { ?&gt;<br \/>\n\t\t\t\t\t\t<a>\/&#8221; id=&#8221;logo&#8221;&gt;&lt;img src=&#8221;&lt;?php bloginfo(&#8216;template_url&#8217;); ?&gt;\/images\/logo.png&#8221; alt=&#8221;&lt;?php bloginfo(&#8216;name&#8217;); ?&gt;&#8221; title=&#8221;&lt;?php bloginfo(&#8216;description&#8217;); ?&gt;&#8221;&gt;<\/a><br \/>\n\t\t\t\t\t&lt;?php } ?&gt;<br \/>\n\t\t\t\t  &lt;?php }?&gt;<br \/>\n\t\t\t\t  &lt;p class=&#8221;tagline&#8221;&gt;&lt;?php bloginfo(&#8216;description&#8217;); ?&gt;&lt;\/p&gt;<br \/>\n\t\t\t\t&lt;\/div&gt;<br \/>\n\t\t\t\t&lt;nav class=&#8221;primary&#8221;&gt;<br \/>\n\t\t\t\t  &lt;?php wp_nav_menu( array(<br \/>\n\t\t\t\t\t&#8216;container&#8217;       =&gt; &#8216;ul&#8217;,<br \/>\n\t\t\t\t\t&#8216;menu_class&#8217;      =&gt; &#8216;sf-menu&#8217;,<br \/>\n\t\t\t\t\t&#8216;menu_id&#8217;         =&gt; &#8216;topnav&#8217;,<br \/>\n\t\t\t\t\t&#8216;depth&#8217;           =&gt; 0,<br \/>\n\t\t\t\t\t&#8216;theme_location&#8217; =&gt; &#8216;header_menu&#8217;<br \/>\n\t\t\t\t\t));<br \/>\n\t\t\t\t  ?&gt;<br \/>\n\t\t\t\t&lt;\/nav&gt;&lt;!&#8211;.primary&#8211;&gt;<br \/>\n\t\t\t\t&lt;div class=&#8221;clear&#8221;&gt;&lt;\/div&gt;<br \/>\n\t\t\t&lt;\/div&gt;<br \/>\n\t\t&lt;\/div&gt;&lt;!&#8211;.row-logo&#8211;&gt;<br \/>\n\t&lt;\/header&gt;<br \/>\n\t&lt;div class=&#8221;bg-content&#8221;&gt;<br \/>\n\t&lt;?php if( is_front_page() ) { ?&gt;<br \/>\n\t\t&lt;section id=&#8221;slider-wrapper&#8221;&gt;<br \/>\n\t\t\t&lt;div class=&#8221;slider-container&#8221;&gt;<br \/>\n\t\t\t\t&lt;?php include_once(TEMPLATEPATH . &#8216;\/slider.php&#8217;); ?&gt;<br \/>\n\t\t\t&lt;\/div&gt;<br \/>\n\t\t&lt;\/section&gt;&lt;!&#8211;#slider&#8211;&gt;<br \/>\n\t&lt;?php } ?&gt;<br \/>\n\t&lt;div class=&#8221;content-box bg&#8221;&gt;<br \/>\n\t\t&lt;div class=&#8221;primary_content_wrap&#8221;&gt;<\/p>\n<p>\u3010functions.php\u3011&#8212;&#8212;&#8212;-<br \/>\n&lt;?php<br \/>\n\/**<br \/>\n * Main WordPress API<br \/>\n *<br \/>\n * @package WordPress<br \/>\n *\/<\/p>\n<p>require( ABSPATH . WPINC . &#8216;\/option.php&#8217; );<\/p>\n<p>\/**<br \/>\n * Converts given date string into a different format.<br \/>\n *<br \/>\n * $format should be either a PHP date format string, e.g. &#8216;U&#8217; for a Unix<br \/>\n * timestamp, or &#8216;G&#8217; for a Unix timestamp assuming that $date is GMT.<br \/>\n *<br \/>\n * If $translate is true then the given date and format string will<br \/>\n * be passed to date_i18n() for translation.<br \/>\n *<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @param string $format Format of the date to return.<br \/>\n * @param string $date Date string to convert.<br \/>\n * @param bool $translate Whether the return date should be translated. Default is true.<br \/>\n * @return string|int Formatted date string, or Unix timestamp.<br \/>\n *\/<br \/>\nfunction mysql2date( $format, $date, $translate = true ) {<br \/>\n\tif ( empty( $date ) )<br \/>\n\t\treturn false;<\/p>\n<p>\tif ( &#8216;G&#8217; == $format )<br \/>\n\t\treturn strtotime( $date . &#8216; +0000&#8217; );<\/p>\n<p>\t$i = strtotime( $date );<\/p>\n<p>\tif ( &#8216;U&#8217; == $format )<br \/>\n\t\treturn $i;<\/p>\n<p>\tif ( $translate )<br \/>\n\t\treturn date_i18n( $format, $i );<br \/>\n\telse<br \/>\n\t\treturn date( $format, $i );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve the current time based on specified type.<br \/>\n *<br \/>\n * The &#8216;mysql&#8217; type will return the time in the format for MySQL DATETIME field.<br \/>\n * The &#8216;timestamp&#8217; type will return the current timestamp.<br \/>\n *<br \/>\n * If $gmt is set to either &#8216;1&#8217; or &#8216;true&#8217;, then both types will use GMT time.<br \/>\n * if $gmt is false, the output is adjusted with the GMT offset in the WordPress option.<br \/>\n *<br \/>\n * @since 1.0.0<br \/>\n *<br \/>\n * @param string $type Either &#8216;mysql&#8217; or &#8216;timestamp&#8217;.<br \/>\n * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false.<br \/>\n * @return int|string String if $type is &#8216;gmt&#8217;, int if $type is &#8216;timestamp&#8217;.<br \/>\n *\/<br \/>\nfunction current_time( $type, $gmt = 0 ) {<br \/>\n\tswitch ( $type ) {<br \/>\n\t\tcase &#8216;mysql&#8217;:<br \/>\n\t\t\treturn ( $gmt ) ? gmdate( &#8216;Y-m-d H:i:s&#8217; ) : gmdate( &#8216;Y-m-d H:i:s&#8217;, ( time() + ( get_option( &#8216;gmt_offset&#8217; ) * HOUR_IN_SECONDS ) ) );<br \/>\n\t\t\tbreak;<br \/>\n\t\tcase &#8216;timestamp&#8217;:<br \/>\n\t\t\treturn ( $gmt ) ? time() : time() + ( get_option( &#8216;gmt_offset&#8217; ) * HOUR_IN_SECONDS );<br \/>\n\t\t\tbreak;<br \/>\n\t}<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve the date in localized format, based on timestamp.<br \/>\n *<br \/>\n * If the locale specifies the locale month and weekday, then the locale will<br \/>\n * take over the format for the date. If it isn&#8217;t, then the date format string<br \/>\n * will be used instead.<br \/>\n *<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @param string $dateformatstring Format to display the date.<br \/>\n * @param int $unixtimestamp Optional. Unix timestamp.<br \/>\n * @param bool $gmt Optional, default is false. Whether to convert to GMT for time.<br \/>\n * @return string The date, translated if locale specifies it.<br \/>\n *\/<br \/>\nfunction date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {<br \/>\n\tglobal $wp_locale;<br \/>\n\t$i = $unixtimestamp;<\/p>\n<p>\tif ( false === $i ) {<br \/>\n\t\tif ( ! $gmt )<br \/>\n\t\t\t$i = current_time( &#8216;timestamp&#8217; );<br \/>\n\t\telse<br \/>\n\t\t\t$i = time();<br \/>\n\t\t\/\/ we should not let date() interfere with our<br \/>\n\t\t\/\/ specially computed timestamp<br \/>\n\t\t$gmt = true;<br \/>\n\t}<\/p>\n<p>\t\/\/ store original value for language with untypical grammars<br \/>\n\t\/\/ see https:\/\/core.trac.wordpress.org\/ticket\/9396<br \/>\n\t$req_format = $dateformatstring;<\/p>\n<p>\t$datefunc = $gmt? &#8216;gmdate&#8217; : &#8216;date&#8217;;<\/p>\n<p>\tif ( ( !empty( $wp_locale-&gt;month ) ) &amp;&amp; ( !empty( $wp_locale-&gt;weekday ) ) ) {<br \/>\n\t\t$datemonth = $wp_locale-&gt;get_month( $datefunc( &#8216;m&#8217;, $i ) );<br \/>\n\t\t$datemonth_abbrev = $wp_locale-&gt;get_month_abbrev( $datemonth );<br \/>\n\t\t$dateweekday = $wp_locale-&gt;get_weekday( $datefunc( &#8216;w&#8217;, $i ) );<br \/>\n\t\t$dateweekday_abbrev = $wp_locale-&gt;get_weekday_abbrev( $dateweekday );<br \/>\n\t\t$datemeridiem = $wp_locale-&gt;get_meridiem( $datefunc( &#8216;a&#8217;, $i ) );<br \/>\n\t\t$datemeridiem_capital = $wp_locale-&gt;get_meridiem( $datefunc( &#8216;A&#8217;, $i ) );<br \/>\n\t\t$dateformatstring = &#8216; &#8216;.$dateformatstring;<br \/>\n\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])D\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $dateweekday_abbrev ), $dateformatstring );<br \/>\n\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])F\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $datemonth ), $dateformatstring );<br \/>\n\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])l\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $dateweekday ), $dateformatstring );<br \/>\n\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])M\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $datemonth_abbrev ), $dateformatstring );<br \/>\n\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])a\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $datemeridiem ), $dateformatstring );<br \/>\n\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])A\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $datemeridiem_capital ), $dateformatstring );<\/p>\n<p>\t\t$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );<br \/>\n\t}<br \/>\n\t$timezone_formats = array( &#8216;P&#8217;, &#8216;I&#8217;, &#8216;O&#8217;, &#8216;T&#8217;, &#8216;Z&#8217;, &#8216;e&#8217; );<br \/>\n\t$timezone_formats_re = implode( &#8216;|&#8217;, $timezone_formats );<br \/>\n\tif ( preg_match( &#8220;\/$timezone_formats_re\/&#8221;, $dateformatstring ) ) {<br \/>\n\t\t$timezone_string = get_option( &#8216;timezone_string&#8217; );<br \/>\n\t\tif ( $timezone_string ) {<br \/>\n\t\t\t$timezone_object = timezone_open( $timezone_string );<br \/>\n\t\t\t$date_object = date_create( null, $timezone_object );<br \/>\n\t\t\tforeach( $timezone_formats as $timezone_format ) {<br \/>\n\t\t\t\tif ( false !== strpos( $dateformatstring, $timezone_format ) ) {<br \/>\n\t\t\t\t\t$formatted = date_format( $date_object, $timezone_format );<br \/>\n\t\t\t\t\t$dateformatstring = &#8216; &#8216;.$dateformatstring;<br \/>\n\t\t\t\t\t$dateformatstring = preg_replace( &#8220;\/([^\\\\\\])$timezone_format\/&#8221;, &#8220;\\\\1&#8221; . backslashit( $formatted ), $dateformatstring );<br \/>\n\t\t\t\t\t$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t}<br \/>\n\t$j = @$datefunc( $dateformatstring, $i );<br \/>\n\t\/\/ allow plugins to redo this entirely for languages with untypical grammars<br \/>\n\t$j = apply_filters(&#8216;date_i18n&#8217;, $j, $req_format, $i, $gmt);<br \/>\n\treturn $j;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Convert integer number to format based on the locale.<br \/>\n *<br \/>\n * @since 2.3.0<br \/>\n *<br \/>\n * @param int $number The number to convert based on locale.<br \/>\n * @param int $decimals Precision of the number of decimal places.<br \/>\n * @return string Converted number in string format.<br \/>\n *\/<br \/>\nfunction number_format_i18n( $number, $decimals = 0 ) {<br \/>\n\tglobal $wp_locale;<br \/>\n\t$formatted = number_format( $number, absint( $decimals ), $wp_locale-&gt;number_format[&#8216;decimal_point&#8217;], $wp_locale-&gt;number_format[&#8216;thousands_sep&#8217;] );<br \/>\n\treturn apply_filters( &#8216;number_format_i18n&#8217;, $formatted );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Convert number of bytes largest unit bytes will fit into.<br \/>\n *<br \/>\n * It is easier to read 1kB than 1024 bytes and 1MB than 1048576 bytes. Converts<br \/>\n * number of bytes to human readable number by taking the number of that unit<br \/>\n * that the bytes will go into it. Supports TB value.<br \/>\n *<br \/>\n * Please note that integers in PHP are limited to 32 bits, unless they are on<br \/>\n * 64 bit architecture, then they have 64 bit size. If you need to place the<br \/>\n * larger size then what PHP integer type will hold, then use a string. It will<br \/>\n * be converted to a double, which should always have 64 bit length.<br \/>\n *<br \/>\n * Technically the correct unit names for powers of 1024 are KiB, MiB etc.<br \/>\n * @link http:\/\/en.wikipedia.org\/wiki\/Byte<br \/>\n *<br \/>\n * @since 2.3.0<br \/>\n *<br \/>\n * @param int|string $bytes Number of bytes. Note max integer size for integers.<br \/>\n * @param int $decimals Precision of number of decimal places. Deprecated.<br \/>\n * @return bool|string False on failure. Number string on success.<br \/>\n *\/<br \/>\nfunction size_format( $bytes, $decimals = 0 ) {<br \/>\n\t$quant = array(<br \/>\n\t\t\/\/ ========================= Origin ====<br \/>\n\t\t&#8216;TB&#8217; =&gt; 1099511627776,  \/\/ pow( 1024, 4)<br \/>\n\t\t&#8216;GB&#8217; =&gt; 1073741824,     \/\/ pow( 1024, 3)<br \/>\n\t\t&#8216;MB&#8217; =&gt; 1048576,        \/\/ pow( 1024, 2)<br \/>\n\t\t&#8216;kB&#8217; =&gt; 1024,           \/\/ pow( 1024, 1)<br \/>\n\t\t&#8216;B &#8216; =&gt; 1,              \/\/ pow( 1024, 0)<br \/>\n\t);<br \/>\n\tforeach ( $quant as $unit =&gt; $mag )<br \/>\n\t\tif ( doubleval($bytes) &gt;= $mag )<br \/>\n\t\t\treturn number_format_i18n( $bytes \/ $mag, $decimals ) . &#8216; &#8216; . $unit;<\/p>\n<p>\treturn false;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Get the week start and end from the datetime or date string from mysql.<br \/>\n *<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @param string $mysqlstring Date or datetime field type from mysql.<br \/>\n * @param int $start_of_week Optional. Start of the week as an integer.<br \/>\n * @return array Keys are &#8216;start&#8217; and &#8216;end&#8217;.<br \/>\n *\/<br \/>\nfunction get_weekstartend( $mysqlstring, $start_of_week = &#8221; ) {<br \/>\n\t$my = substr( $mysqlstring, 0, 4 ); \/\/ Mysql string Year<br \/>\n\t$mm = substr( $mysqlstring, 8, 2 ); \/\/ Mysql string Month<br \/>\n\t$md = substr( $mysqlstring, 5, 2 ); \/\/ Mysql string day<br \/>\n\t$day = mktime( 0, 0, 0, $md, $mm, $my ); \/\/ The timestamp for mysqlstring day.<br \/>\n\t$weekday = date( &#8216;w&#8217;, $day ); \/\/ The day of the week from the timestamp<br \/>\n\tif ( !is_numeric($start_of_week) )<br \/>\n\t\t$start_of_week = get_option( &#8216;start_of_week&#8217; );<\/p>\n<p>\tif ( $weekday &lt; $start_of_week )<br \/>\n\t\t$weekday += 7;<\/p>\n<p>\t$start = $day &#8211; DAY_IN_SECONDS * ( $weekday &#8211; $start_of_week ); \/\/ The most recent week start day on or before $day<br \/>\n\t$end = $start + 7 * DAY_IN_SECONDS &#8211; 1; \/\/ $start + 7 days &#8211; 1 second<br \/>\n\treturn compact( &#8216;start&#8217;, &#8216;end&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Unserialize value only if it was serialized.<br \/>\n *<br \/>\n * @since 2.0.0<br \/>\n *<br \/>\n * @param string $original Maybe unserialized original, if is needed.<br \/>\n * @return mixed Unserialized data can be any type.<br \/>\n *\/<br \/>\nfunction maybe_unserialize( $original ) {<br \/>\n\tif ( is_serialized( $original ) ) \/\/ don&#8217;t attempt to unserialize data that wasn&#8217;t serialized going in<br \/>\n\t\treturn @unserialize( $original );<br \/>\n\treturn $original;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Check value to find if it was serialized.<br \/>\n *<br \/>\n * If $data is not an string, then returned value will always be false.<br \/>\n * Serialized data is always a string.<br \/>\n *<br \/>\n * @since 2.0.5<br \/>\n *<br \/>\n * @param mixed $data Value to check to see if was serialized.<br \/>\n * @return bool False if not serialized and true if it was.<br \/>\n *\/<br \/>\nfunction is_serialized( $data ) {<br \/>\n\t\/\/ if it isn&#8217;t a string, it isn&#8217;t serialized<br \/>\n\tif ( ! is_string( $data ) )<br \/>\n\t\treturn false;<br \/>\n\t$data = trim( $data );<br \/>\n \tif ( &#8216;N;&#8217; == $data )<br \/>\n\t\treturn true;<br \/>\n\t$length = strlen( $data );<br \/>\n\tif ( $length &lt; 4 )<br \/>\n\t\treturn false;<br \/>\n\tif ( &#8216;:&#8217; !== $data[1] )<br \/>\n\t\treturn false;<br \/>\n\t$lastc = $data[$length-1];<br \/>\n\tif ( &#8216;;&#8217; !== $lastc &amp;&amp; &#8216;}&#8217; !== $lastc )<br \/>\n\t\treturn false;<br \/>\n\t$token = $data[0];<br \/>\n\tswitch ( $token ) {<br \/>\n\t\tcase &#8216;s&#8217; :<br \/>\n\t\t\tif ( &#8216;&#8221;&#8216; !== $data[$length-2] )<br \/>\n\t\t\t\treturn false;<br \/>\n\t\tcase &#8216;a&#8217; :<br \/>\n\t\tcase &#8216;O&#8217; :<br \/>\n\t\t\treturn (bool) preg_match( &#8220;\/^{$token}:[0-9]+:\/s&#8221;, $data );<br \/>\n\t\tcase &#8216;b&#8217; :<br \/>\n\t\tcase &#8216;i&#8217; :<br \/>\n\t\tcase &#8216;d&#8217; :<br \/>\n\t\t\treturn (bool) preg_match( &#8220;\/^{$token}:[0-9.E-]+;\\$\/&#8221;, $data );<br \/>\n\t}<br \/>\n\treturn false;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Check whether serialized data is of string type.<br \/>\n *<br \/>\n * @since 2.0.5<br \/>\n *<br \/>\n * @param mixed $data Serialized data<br \/>\n * @return bool False if not a serialized string, true if it is.<br \/>\n *\/<br \/>\nfunction is_serialized_string( $data ) {<br \/>\n\t\/\/ if it isn&#8217;t a string, it isn&#8217;t a serialized string<br \/>\n\tif ( !is_string( $data ) )<br \/>\n\t\treturn false;<br \/>\n\t$data = trim( $data );<br \/>\n\t$length = strlen( $data );<br \/>\n\tif ( $length &lt; 4 )<br \/>\n\t\treturn false;<br \/>\n\telseif ( &#8216;:&#8217; !== $data[1] )<br \/>\n\t\treturn false;<br \/>\n\telseif ( &#8216;;&#8217; !== $data[$length-1] )<br \/>\n\t\treturn false;<br \/>\n\telseif ( $data[0] !== &#8216;s&#8217; )<br \/>\n\t\treturn false;<br \/>\n\telseif ( &#8216;&#8221;&#8216; !== $data[$length-2] )<br \/>\n\t\treturn false;<br \/>\n\telse<br \/>\n\t\treturn true;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Serialize data, if needed.<br \/>\n *<br \/>\n * @since 2.0.5<br \/>\n *<br \/>\n * @param mixed $data Data that might be serialized.<br \/>\n * @return mixed A scalar data<br \/>\n *\/<br \/>\nfunction maybe_serialize( $data ) {<br \/>\n\tif ( is_array( $data ) || is_object( $data ) )<br \/>\n\t\treturn serialize( $data );<\/p>\n<p>\t\/\/ Double serialization is required for backward compatibility.<br \/>\n\t\/\/ See https:\/\/core.trac.wordpress.org\/ticket\/12930<br \/>\n\tif ( is_serialized( $data ) )<br \/>\n\t\treturn serialize( $data );<\/p>\n<p>\treturn $data;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve post title from XMLRPC XML.<br \/>\n *<br \/>\n * If the title element is not part of the XML, then the default post title from<br \/>\n * the $post_default_title will be used instead.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage XMLRPC<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @global string $post_default_title Default XMLRPC post title.<br \/>\n *<br \/>\n * @param string $content XMLRPC XML Request content<br \/>\n * @return string Post title<br \/>\n *\/<br \/>\nfunction xmlrpc_getposttitle( $content ) {<br \/>\n\tglobal $post_default_title;<br \/>\n\tif ( preg_match( &#8216;\/&lt;title&gt;(.+?)&lt;\\\/title&gt;\/is&#8217;, $content, $matchtitle ) ) {<br \/>\n\t\t$post_title = $matchtitle[1];<br \/>\n\t} else {<br \/>\n\t\t$post_title = $post_default_title;<br \/>\n\t}<br \/>\n\treturn $post_title;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve the post category or categories from XMLRPC XML.<br \/>\n *<br \/>\n * If the category element is not found, then the default post category will be<br \/>\n * used. The return type then would be what $post_default_category. If the<br \/>\n * category is found, then it will always be an array.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage XMLRPC<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @global string $post_default_category Default XMLRPC post category.<br \/>\n *<br \/>\n * @param string $content XMLRPC XML Request content<br \/>\n * @return string|array List of categories or category name.<br \/>\n *\/<br \/>\nfunction xmlrpc_getpostcategory( $content ) {<br \/>\n\tglobal $post_default_category;<br \/>\n\tif ( preg_match( &#8216;\/&lt;category&gt;(.+?)&lt;\\\/category&gt;\/is&#8217;, $content, $matchcat ) ) {<br \/>\n\t\t$post_category = trim( $matchcat[1], &#8216;,&#8217; );<br \/>\n\t\t$post_category = explode( &#8216;,&#8217;, $post_category );<br \/>\n\t} else {<br \/>\n\t\t$post_category = $post_default_category;<br \/>\n\t}<br \/>\n\treturn $post_category;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * XMLRPC XML content without title and category elements.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage XMLRPC<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @param string $content XMLRPC XML Request content<br \/>\n * @return string XMLRPC XML Request content without title and category elements.<br \/>\n *\/<br \/>\nfunction xmlrpc_removepostdata( $content ) {<br \/>\n\t$content = preg_replace( &#8216;\/&lt;title&gt;(.+?)&lt;\\\/title&gt;\/si&#8217;, &#8221;, $content );<br \/>\n\t$content = preg_replace( &#8216;\/&lt;category&gt;(.+?)&lt;\\\/category&gt;\/si&#8217;, &#8221;, $content );<br \/>\n\t$content = trim( $content );<br \/>\n\treturn $content;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Check content for video and audio links to add as enclosures.<br \/>\n *<br \/>\n * Will not add enclosures that have already been added and will<br \/>\n * remove enclosures that are no longer in the post. This is called as<br \/>\n * pingbacks and trackbacks.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @since 1.5.0<br \/>\n *<br \/>\n * @uses $wpdb<br \/>\n *<br \/>\n * @param string $content Post Content<br \/>\n * @param int $post_ID Post ID<br \/>\n *\/<br \/>\nfunction do_enclose( $content, $post_ID ) {<br \/>\n\tglobal $wpdb;<\/p>\n<p>\t\/\/TODO: Tidy this ghetto code up and make the debug code optional<br \/>\n\tinclude_once( ABSPATH . WPINC . &#8216;\/class-IXR.php&#8217; );<\/p>\n<p>\t$post_links = array();<\/p>\n<p>\t$pung = get_enclosed( $post_ID );<\/p>\n<p>\t$ltrs = &#8216;\\w&#8217;;<br \/>\n\t$gunk = &#8216;\/#~:.?+=&amp;%@!\\-&#8216;;<br \/>\n\t$punc = &#8216;.:?\\-&#8216;;<br \/>\n\t$any = $ltrs . $gunk . $punc;<\/p>\n<p>\tpreg_match_all( &#8220;{\\b http : [$any] +? (?= [$punc] * [^$any] | $)}x&#8221;, $content, $post_links_temp );<\/p>\n<p>\tforeach ( $pung as $link_test ) {<br \/>\n\t\tif ( !in_array( $link_test, $post_links_temp[0] ) ) { \/\/ link no longer in post<br \/>\n\t\t\t$mids = $wpdb-&gt;get_col( $wpdb-&gt;prepare(&#8220;SELECT meta_id FROM $wpdb-&gt;postmeta WHERE post_id = %d AND meta_key = &#8216;enclosure&#8217; AND meta_value LIKE (%s)&#8221;, $post_ID, like_escape( $link_test ) . &#8216;%&#8217;) );<br \/>\n\t\t\tforeach ( $mids as $mid )<br \/>\n\t\t\t\tdelete_metadata_by_mid( &#8216;post&#8217;, $mid );<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\tforeach ( (array) $post_links_temp[0] as $link_test ) {<br \/>\n\t\tif ( !in_array( $link_test, $pung ) ) { \/\/ If we haven&#8217;t pung it already<br \/>\n\t\t\t$test = @parse_url( $link_test );<br \/>\n\t\t\tif ( false === $test )<br \/>\n\t\t\t\tcontinue;<br \/>\n\t\t\tif ( isset( $test[&#8216;query&#8217;] ) )<br \/>\n\t\t\t\t$post_links[] = $link_test;<br \/>\n\t\t\telseif ( isset($test[&#8216;path&#8217;]) &amp;&amp; ( $test[&#8216;path&#8217;] != &#8216;\/&#8217; ) &amp;&amp;  ($test[&#8216;path&#8217;] != &#8221; ) )<br \/>\n\t\t\t\t$post_links[] = $link_test;<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\tforeach ( (array) $post_links as $url ) {<br \/>\n\t\tif ( $url != &#8221; &amp;&amp; !$wpdb-&gt;get_var( $wpdb-&gt;prepare( &#8220;SELECT post_id FROM $wpdb-&gt;postmeta WHERE post_id = %d AND meta_key = &#8216;enclosure&#8217; AND meta_value LIKE (%s)&#8221;, $post_ID, like_escape( $url ) . &#8216;%&#8217; ) ) ) {<\/p>\n<p>\t\t\tif ( $headers = wp_get_http_headers( $url) ) {<br \/>\n\t\t\t\t$len = isset( $headers[&#8216;content-length&#8217;] ) ? (int) $headers[&#8216;content-length&#8217;] : 0;<br \/>\n\t\t\t\t$type = isset( $headers[&#8216;content-type&#8217;] ) ? $headers[&#8216;content-type&#8217;] : &#8221;;<br \/>\n\t\t\t\t$allowed_types = array( &#8216;video&#8217;, &#8216;audio&#8217; );<\/p>\n<p>\t\t\t\t\/\/ Check to see if we can figure out the mime type from<br \/>\n\t\t\t\t\/\/ the extension<br \/>\n\t\t\t\t$url_parts = @parse_url( $url );<br \/>\n\t\t\t\tif ( false !== $url_parts ) {<br \/>\n\t\t\t\t\t$extension = pathinfo( $url_parts[&#8216;path&#8217;], PATHINFO_EXTENSION );<br \/>\n\t\t\t\t\tif ( !empty( $extension ) ) {<br \/>\n\t\t\t\t\t\tforeach ( wp_get_mime_types() as $exts =&gt; $mime ) {<br \/>\n\t\t\t\t\t\t\tif ( preg_match( &#8216;!^(&#8216; . $exts . &#8216;)$!i&#8217;, $extension ) ) {<br \/>\n\t\t\t\t\t\t\t\t$type = $mime;<br \/>\n\t\t\t\t\t\t\t\tbreak;<br \/>\n\t\t\t\t\t\t\t}<br \/>\n\t\t\t\t\t\t}<br \/>\n\t\t\t\t\t}<br \/>\n\t\t\t\t}<\/p>\n<p>\t\t\t\tif ( in_array( substr( $type, 0, strpos( $type, &#8220;\/&#8221; ) ), $allowed_types ) ) {<br \/>\n\t\t\t\t\tadd_post_meta( $post_ID, &#8216;enclosure&#8217;, &#8220;$url\\n$len\\n$mime\\n&#8221; );<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t}<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Perform a HTTP HEAD or GET request.<br \/>\n *<br \/>\n * If $file_path is a writable filename, this will do a GET request and write<br \/>\n * the file to that path.<br \/>\n *<br \/>\n * @since 2.5.0<br \/>\n *<br \/>\n * @param string $url URL to fetch.<br \/>\n * @param string|bool $file_path Optional. File path to write request to.<br \/>\n * @param int $red (private) The number of Redirects followed, Upon 5 being hit, returns false.<br \/>\n * @return bool|string False on failure and string of headers if HEAD request.<br \/>\n *\/<br \/>\nfunction wp_get_http( $url, $file_path = false, $red = 1 ) {<br \/>\n\t@set_time_limit( 60 );<\/p>\n<p>\tif ( $red &gt; 5 )<br \/>\n\t\treturn false;<\/p>\n<p>\t$options = array();<br \/>\n\t$options[&#8216;redirection&#8217;] = 5;<\/p>\n<p>\tif ( false == $file_path )<br \/>\n\t\t$options[&#8216;method&#8217;] = &#8216;HEAD&#8217;;<br \/>\n\telse<br \/>\n\t\t$options[&#8216;method&#8217;] = &#8216;GET&#8217;;<\/p>\n<p>\t$response = wp_remote_request($url, $options);<\/p>\n<p>\tif ( is_wp_error( $response ) )<br \/>\n\t\treturn false;<\/p>\n<p>\t$headers = wp_remote_retrieve_headers( $response );<br \/>\n\t$headers[&#8216;response&#8217;] = wp_remote_retrieve_response_code( $response );<\/p>\n<p>\t\/\/ WP_HTTP no longer follows redirects for HEAD requests.<br \/>\n\tif ( &#8216;HEAD&#8217; == $options[&#8216;method&#8217;] &amp;&amp; in_array($headers[&#8216;response&#8217;], array(301, 302)) &amp;&amp; isset( $headers[&#8216;location&#8217;] ) ) {<br \/>\n\t\treturn wp_get_http( $headers[&#8216;location&#8217;], $file_path, ++$red );<br \/>\n\t}<\/p>\n<p>\tif ( false == $file_path )<br \/>\n\t\treturn $headers;<\/p>\n<p>\t\/\/ GET request &#8211; write it to the supplied filename<br \/>\n\t$out_fp = fopen($file_path, &#8216;w&#8217;);<br \/>\n\tif ( !$out_fp )<br \/>\n\t\treturn $headers;<\/p>\n<p>\tfwrite( $out_fp,  wp_remote_retrieve_body( $response ) );<br \/>\n\tfclose($out_fp);<br \/>\n\tclearstatcache();<\/p>\n<p>\treturn $headers;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve HTTP Headers from URL.<br \/>\n *<br \/>\n * @since 1.5.1<br \/>\n *<br \/>\n * @param string $url<br \/>\n * @param bool $deprecated Not Used.<br \/>\n * @return bool|string False on failure, headers on success.<br \/>\n *\/<br \/>\nfunction wp_get_http_headers( $url, $deprecated = false ) {<br \/>\n\tif ( !empty( $deprecated ) )<br \/>\n\t\t_deprecated_argument( __FUNCTION__, &#8216;2.7&#8217; );<\/p>\n<p>\t$response = wp_remote_head( $url );<\/p>\n<p>\tif ( is_wp_error( $response ) )<br \/>\n\t\treturn false;<\/p>\n<p>\treturn wp_remote_retrieve_headers( $response );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Whether today is a new day.<br \/>\n *<br \/>\n * @since 0.71<br \/>\n * @uses $day Today<br \/>\n * @uses $previousday Previous day<br \/>\n *<br \/>\n * @return int 1 when new day, 0 if not a new day.<br \/>\n *\/<br \/>\nfunction is_new_day() {<br \/>\n\tglobal $currentday, $previousday;<br \/>\n\tif ( $currentday != $previousday )<br \/>\n\t\treturn 1;<br \/>\n\telse<br \/>\n\t\treturn 0;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Build URL query based on an associative and, or indexed array.<br \/>\n *<br \/>\n * This is a convenient function for easily building url queries. It sets the<br \/>\n * separator to &#8216;&amp;&#8217; and uses _http_build_query() function.<br \/>\n *<br \/>\n * @see _http_build_query() Used to build the query<br \/>\n * @link http:\/\/us2.php.net\/manual\/en\/function.http-build-query.php more on what<br \/>\n *\t\thttp_build_query() does.<br \/>\n *<br \/>\n * @since 2.3.0<br \/>\n *<br \/>\n * @param array $data URL-encode key\/value pairs.<br \/>\n * @return string URL encoded string<br \/>\n *\/<br \/>\nfunction build_query( $data ) {<br \/>\n\treturn _http_build_query( $data, null, &#8216;&amp;&#8217;, &#8221;, false );<br \/>\n}<\/p>\n<p>\/\/ from php.net (modified by Mark Jaquith to behave like the native PHP5 function)<br \/>\nfunction _http_build_query($data, $prefix=null, $sep=null, $key=&#8221;, $urlencode=true) {<br \/>\n\t$ret = array();<\/p>\n<p>\tforeach ( (array) $data as $k =&gt; $v ) {<br \/>\n\t\tif ( $urlencode)<br \/>\n\t\t\t$k = urlencode($k);<br \/>\n\t\tif ( is_int($k) &amp;&amp; $prefix != null )<br \/>\n\t\t\t$k = $prefix.$k;<br \/>\n\t\tif ( !empty($key) )<br \/>\n\t\t\t$k = $key . &#8216;%5B&#8217; . $k . &#8216;%5D&#8217;;<br \/>\n\t\tif ( $v === null )<br \/>\n\t\t\tcontinue;<br \/>\n\t\telseif ( $v === FALSE )<br \/>\n\t\t\t$v = &#8216;0&#8217;;<\/p>\n<p>\t\tif ( is_array($v) || is_object($v) )<br \/>\n\t\t\tarray_push($ret,_http_build_query($v, &#8221;, $sep, $k, $urlencode));<br \/>\n\t\telseif ( $urlencode )<br \/>\n\t\t\tarray_push($ret, $k.&#8217;=&#8217;.urlencode($v));<br \/>\n\t\telse<br \/>\n\t\t\tarray_push($ret, $k.&#8217;=&#8217;.$v);<br \/>\n\t}<\/p>\n<p>\tif ( null === $sep )<br \/>\n\t\t$sep = ini_get(&#8216;arg_separator.output&#8217;);<\/p>\n<p>\treturn implode($sep, $ret);<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve a modified URL query string.<br \/>\n *<br \/>\n * You can rebuild the URL and append a new query variable to the URL query by<br \/>\n * using this function. You can also retrieve the full URL with query data.<br \/>\n *<br \/>\n * Adding a single key &amp; value or an associative array. Setting a key value to<br \/>\n * an empty string removes the key. Omitting oldquery_or_uri uses the $_SERVER<br \/>\n * value. Additional values provided are expected to be encoded appropriately<br \/>\n * with urlencode() or rawurlencode().<br \/>\n *<br \/>\n * @since 1.5.0<br \/>\n *<br \/>\n * @param mixed $param1 Either newkey or an associative_array<br \/>\n * @param mixed $param2 Either newvalue or oldquery or uri<br \/>\n * @param mixed $param3 Optional. Old query or uri<br \/>\n * @return string New URL query string.<br \/>\n *\/<br \/>\nfunction add_query_arg() {<br \/>\n\t$ret = &#8221;;<br \/>\n\t$args = func_get_args();<br \/>\n\tif ( is_array( $args[0] ) ) {<br \/>\n\t\tif ( count( $args ) &lt; 2 || false === $args[1] )<br \/>\n\t\t\t$uri = $_SERVER[&#8216;REQUEST_URI&#8217;];<br \/>\n\t\telse<br \/>\n\t\t\t$uri = $args[1];<br \/>\n\t} else {<br \/>\n\t\tif ( count( $args ) &lt; 3 || false === $args[2] )<br \/>\n\t\t\t$uri = $_SERVER[&#8216;REQUEST_URI&#8217;];<br \/>\n\t\telse<br \/>\n\t\t\t$uri = $args[2];<br \/>\n\t}<\/p>\n<p>\tif ( $frag = strstr( $uri, &#8216;#&#8217; ) )<br \/>\n\t\t$uri = substr( $uri, 0, -strlen( $frag ) );<br \/>\n\telse<br \/>\n\t\t$frag = &#8221;;<\/p>\n<p>\tif ( 0 === stripos( &#8216;http:\/\/&#8217;, $uri ) ) {<br \/>\n\t\t$protocol = &#8216;http:\/\/&#8217;;<br \/>\n\t\t$uri = substr( $uri, 7 );<br \/>\n\t} elseif ( 0 === stripos( &#8216;https:\/\/&#8217;, $uri ) ) {<br \/>\n\t\t$protocol = &#8216;https:\/\/&#8217;;<br \/>\n\t\t$uri = substr( $uri, 8 );<br \/>\n\t} else {<br \/>\n\t\t$protocol = &#8221;;<br \/>\n\t}<\/p>\n<p>\tif ( strpos( $uri, &#8216;?&#8217; ) !== false ) {<br \/>\n\t\t$parts = explode( &#8216;?&#8217;, $uri, 2 );<br \/>\n\t\tif ( 1 == count( $parts ) ) {<br \/>\n\t\t\t$base = &#8216;?&#8217;;<br \/>\n\t\t\t$query = $parts[0];<br \/>\n\t\t} else {<br \/>\n\t\t\t$base = $parts[0] . &#8216;?&#8217;;<br \/>\n\t\t\t$query = $parts[1];<br \/>\n\t\t}<br \/>\n\t} elseif ( $protocol || strpos( $uri, &#8216;=&#8217; ) === false ) {<br \/>\n\t\t$base = $uri . &#8216;?&#8217;;<br \/>\n\t\t$query = &#8221;;<br \/>\n\t} else {<br \/>\n\t\t$base = &#8221;;<br \/>\n\t\t$query = $uri;<br \/>\n\t}<\/p>\n<p>\twp_parse_str( $query, $qs );<br \/>\n\t$qs = urlencode_deep( $qs ); \/\/ this re-URL-encodes things that were already in the query string<br \/>\n\tif ( is_array( $args[0] ) ) {<br \/>\n\t\t$kayvees = $args[0];<br \/>\n\t\t$qs = array_merge( $qs, $kayvees );<br \/>\n\t} else {<br \/>\n\t\t$qs[ $args[0] ] = $args[1];<br \/>\n\t}<\/p>\n<p>\tforeach ( $qs as $k =&gt; $v ) {<br \/>\n\t\tif ( $v === false )<br \/>\n\t\t\tunset( $qs[$k] );<br \/>\n\t}<\/p>\n<p>\t$ret = build_query( $qs );<br \/>\n\t$ret = trim( $ret, &#8216;?&#8217; );<br \/>\n\t$ret = preg_replace( &#8216;#=(&amp;|$)#&#8217;, &#8216;$1&#8217;, $ret );<br \/>\n\t$ret = $protocol . $base . $ret . $frag;<br \/>\n\t$ret = rtrim( $ret, &#8216;?&#8217; );<br \/>\n\treturn $ret;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Removes an item or list from the query string.<br \/>\n *<br \/>\n * @since 1.5.0<br \/>\n *<br \/>\n * @param string|array $key Query key or keys to remove.<br \/>\n * @param bool $query When false uses the $_SERVER value.<br \/>\n * @return string New URL query string.<br \/>\n *\/<br \/>\nfunction remove_query_arg( $key, $query=false ) {<br \/>\n\tif ( is_array( $key ) ) { \/\/ removing multiple keys<br \/>\n\t\tforeach ( $key as $k )<br \/>\n\t\t\t$query = add_query_arg( $k, false, $query );<br \/>\n\t\treturn $query;<br \/>\n\t}<br \/>\n\treturn add_query_arg( $key, false, $query );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Walks the array while sanitizing the contents.<br \/>\n *<br \/>\n * @since 0.71<br \/>\n *<br \/>\n * @param array $array Array to used to walk while sanitizing contents.<br \/>\n * @return array Sanitized $array.<br \/>\n *\/<br \/>\nfunction add_magic_quotes( $array ) {<br \/>\n\tforeach ( (array) $array as $k =&gt; $v ) {<br \/>\n\t\tif ( is_array( $v ) ) {<br \/>\n\t\t\t$array[$k] = add_magic_quotes( $v );<br \/>\n\t\t} else {<br \/>\n\t\t\t$array[$k] = addslashes( $v );<br \/>\n\t\t}<br \/>\n\t}<br \/>\n\treturn $array;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * HTTP request for URI to retrieve content.<br \/>\n *<br \/>\n * @since 1.5.1<br \/>\n * @uses wp_remote_get()<br \/>\n *<br \/>\n * @param string $uri URI\/URL of web page to retrieve.<br \/>\n * @return bool|string HTTP content. False on failure.<br \/>\n *\/<br \/>\nfunction wp_remote_fopen( $uri ) {<br \/>\n\t$parsed_url = @parse_url( $uri );<\/p>\n<p>\tif ( !$parsed_url || !is_array( $parsed_url ) )<br \/>\n\t\treturn false;<\/p>\n<p>\t$options = array();<br \/>\n\t$options[&#8216;timeout&#8217;] = 10;<\/p>\n<p>\t$response = wp_remote_get( $uri, $options );<\/p>\n<p>\tif ( is_wp_error( $response ) )<br \/>\n\t\treturn false;<\/p>\n<p>\treturn wp_remote_retrieve_body( $response );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Set up the WordPress query.<br \/>\n *<br \/>\n * @since 2.0.0<br \/>\n *<br \/>\n * @param string $query_vars Default WP_Query arguments.<br \/>\n *\/<br \/>\nfunction wp( $query_vars = &#8221; ) {<br \/>\n\tglobal $wp, $wp_query, $wp_the_query;<br \/>\n\t$wp-&gt;main( $query_vars );<\/p>\n<p>\tif ( !isset($wp_the_query) )<br \/>\n\t\t$wp_the_query = $wp_query;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve the description for the HTTP status.<br \/>\n *<br \/>\n * @since 2.3.0<br \/>\n *<br \/>\n * @param int $code HTTP status code.<br \/>\n * @return string Empty string if not found, or description if found.<br \/>\n *\/<br \/>\nfunction get_status_header_desc( $code ) {<br \/>\n\tglobal $wp_header_to_desc;<\/p>\n<p>\t$code = absint( $code );<\/p>\n<p>\tif ( !isset( $wp_header_to_desc ) ) {<br \/>\n\t\t$wp_header_to_desc = array(<br \/>\n\t\t\t100 =&gt; &#8216;Continue&#8217;,<br \/>\n\t\t\t101 =&gt; &#8216;Switching Protocols&#8217;,<br \/>\n\t\t\t102 =&gt; &#8216;Processing&#8217;,<\/p>\n<p>\t\t\t200 =&gt; &#8216;OK&#8217;,<br \/>\n\t\t\t201 =&gt; &#8216;Created&#8217;,<br \/>\n\t\t\t202 =&gt; &#8216;Accepted&#8217;,<br \/>\n\t\t\t203 =&gt; &#8216;Non-Authoritative Information&#8217;,<br \/>\n\t\t\t204 =&gt; &#8216;No Content&#8217;,<br \/>\n\t\t\t205 =&gt; &#8216;Reset Content&#8217;,<br \/>\n\t\t\t206 =&gt; &#8216;Partial Content&#8217;,<br \/>\n\t\t\t207 =&gt; &#8216;Multi-Status&#8217;,<br \/>\n\t\t\t226 =&gt; &#8216;IM Used&#8217;,<\/p>\n<p>\t\t\t300 =&gt; &#8216;Multiple Choices&#8217;,<br \/>\n\t\t\t301 =&gt; &#8216;Moved Permanently&#8217;,<br \/>\n\t\t\t302 =&gt; &#8216;Found&#8217;,<br \/>\n\t\t\t303 =&gt; &#8216;See Other&#8217;,<br \/>\n\t\t\t304 =&gt; &#8216;Not Modified&#8217;,<br \/>\n\t\t\t305 =&gt; &#8216;Use Proxy&#8217;,<br \/>\n\t\t\t306 =&gt; &#8216;Reserved&#8217;,<br \/>\n\t\t\t307 =&gt; &#8216;Temporary Redirect&#8217;,<\/p>\n<p>\t\t\t400 =&gt; &#8216;Bad Request&#8217;,<br \/>\n\t\t\t401 =&gt; &#8216;Unauthorized&#8217;,<br \/>\n\t\t\t402 =&gt; &#8216;Payment Required&#8217;,<br \/>\n\t\t\t403 =&gt; &#8216;Forbidden&#8217;,<br \/>\n\t\t\t404 =&gt; &#8216;Not Found&#8217;,<br \/>\n\t\t\t405 =&gt; &#8216;Method Not Allowed&#8217;,<br \/>\n\t\t\t406 =&gt; &#8216;Not Acceptable&#8217;,<br \/>\n\t\t\t407 =&gt; &#8216;Proxy Authentication Required&#8217;,<br \/>\n\t\t\t408 =&gt; &#8216;Request Timeout&#8217;,<br \/>\n\t\t\t409 =&gt; &#8216;Conflict&#8217;,<br \/>\n\t\t\t410 =&gt; &#8216;Gone&#8217;,<br \/>\n\t\t\t411 =&gt; &#8216;Length Required&#8217;,<br \/>\n\t\t\t412 =&gt; &#8216;Precondition Failed&#8217;,<br \/>\n\t\t\t413 =&gt; &#8216;Request Entity Too Large&#8217;,<br \/>\n\t\t\t414 =&gt; &#8216;Request-URI Too Long&#8217;,<br \/>\n\t\t\t415 =&gt; &#8216;Unsupported Media Type&#8217;,<br \/>\n\t\t\t416 =&gt; &#8216;Requested Range Not Satisfiable&#8217;,<br \/>\n\t\t\t417 =&gt; &#8216;Expectation Failed&#8217;,<br \/>\n\t\t\t422 =&gt; &#8216;Unprocessable Entity&#8217;,<br \/>\n\t\t\t423 =&gt; &#8216;Locked&#8217;,<br \/>\n\t\t\t424 =&gt; &#8216;Failed Dependency&#8217;,<br \/>\n\t\t\t426 =&gt; &#8216;Upgrade Required&#8217;,<\/p>\n<p>\t\t\t500 =&gt; &#8216;Internal Server Error&#8217;,<br \/>\n\t\t\t501 =&gt; &#8216;Not Implemented&#8217;,<br \/>\n\t\t\t502 =&gt; &#8216;Bad Gateway&#8217;,<br \/>\n\t\t\t503 =&gt; &#8216;Service Unavailable&#8217;,<br \/>\n\t\t\t504 =&gt; &#8216;Gateway Timeout&#8217;,<br \/>\n\t\t\t505 =&gt; &#8216;HTTP Version Not Supported&#8217;,<br \/>\n\t\t\t506 =&gt; &#8216;Variant Also Negotiates&#8217;,<br \/>\n\t\t\t507 =&gt; &#8216;Insufficient Storage&#8217;,<br \/>\n\t\t\t510 =&gt; &#8216;Not Extended&#8217;<br \/>\n\t\t);<br \/>\n\t}<\/p>\n<p>\tif ( isset( $wp_header_to_desc[$code] ) )<br \/>\n\t\treturn $wp_header_to_desc[$code];<br \/>\n\telse<br \/>\n\t\treturn &#8221;;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Set HTTP status header.<br \/>\n *<br \/>\n * @since 2.0.0<br \/>\n * @uses apply_filters() Calls &#8216;status_header&#8217; on status header string, HTTP<br \/>\n *\t\tHTTP code, HTTP code description, and protocol string as separate<br \/>\n *\t\tparameters.<br \/>\n *<br \/>\n * @param int $header HTTP status code<br \/>\n * @return unknown<br \/>\n *\/<br \/>\nfunction status_header( $header ) {<br \/>\n\t$text = get_status_header_desc( $header );<\/p>\n<p>\tif ( empty( $text ) )<br \/>\n\t\treturn false;<\/p>\n<p>\t$protocol = $_SERVER[&#8220;SERVER_PROTOCOL&#8221;];<br \/>\n\tif ( &#8216;HTTP\/1.1&#8217; != $protocol &amp;&amp; &#8216;HTTP\/1.0&#8217; != $protocol )<br \/>\n\t\t$protocol = &#8216;HTTP\/1.0&#8217;;<br \/>\n\t$status_header = &#8220;$protocol $header $text&#8221;;<br \/>\n\tif ( function_exists( &#8216;apply_filters&#8217; ) )<br \/>\n\t\t$status_header = apply_filters( &#8216;status_header&#8217;, $status_header, $header, $text, $protocol );<\/p>\n<p>\treturn @header( $status_header, true, $header );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Gets the header information to prevent caching.<br \/>\n *<br \/>\n * The several different headers cover the different ways cache prevention is handled<br \/>\n * by different browsers<br \/>\n *<br \/>\n * @since 2.8.0<br \/>\n *<br \/>\n * @uses apply_filters()<br \/>\n * @return array The associative array of header names and field values.<br \/>\n *\/<br \/>\nfunction wp_get_nocache_headers() {<br \/>\n\t$headers = array(<br \/>\n\t\t&#8216;Expires&#8217; =&gt; &#8216;Wed, 11 Jan 1984 05:00:00 GMT&#8217;,<br \/>\n\t\t&#8216;Last-Modified&#8217; =&gt; &#8221;,<br \/>\n\t\t&#8216;Cache-Control&#8217; =&gt; &#8216;no-cache, must-revalidate, max-age=0&#8217;,<br \/>\n\t\t&#8216;Pragma&#8217; =&gt; &#8216;no-cache&#8217;,<br \/>\n\t);<\/p>\n<p>\tif ( function_exists(&#8216;apply_filters&#8217;) ) {<br \/>\n\t\t$headers = (array) apply_filters(&#8216;nocache_headers&#8217;, $headers);<br \/>\n\t}<br \/>\n\treturn $headers;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Sets the headers to prevent caching for the different browsers.<br \/>\n *<br \/>\n * Different browsers support different nocache headers, so several headers must<br \/>\n * be sent so that all of them get the point that no caching should occur.<br \/>\n *<br \/>\n * @since 2.0.0<br \/>\n * @uses wp_get_nocache_headers()<br \/>\n *\/<br \/>\nfunction nocache_headers() {<br \/>\n\t$headers = wp_get_nocache_headers();<br \/>\n\tforeach( $headers as $name =&gt; $field_value )<br \/>\n\t\t@header(&#8220;{$name}: {$field_value}&#8221;);<br \/>\n\tif ( empty( $headers[&#8216;Last-Modified&#8217;] ) &amp;&amp; function_exists( &#8216;header_remove&#8217; ) )<br \/>\n\t\t@header_remove( &#8216;Last-Modified&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Set the headers for caching for 10 days with JavaScript content type.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n *\/<br \/>\nfunction cache_javascript_headers() {<br \/>\n\t$expiresOffset = 10 * DAY_IN_SECONDS;<br \/>\n\theader( &#8220;Content-Type: text\/javascript; charset=&#8221; . get_bloginfo( &#8216;charset&#8217; ) );<br \/>\n\theader( &#8220;Vary: Accept-Encoding&#8221; ); \/\/ Handle proxies<br \/>\n\theader( &#8220;Expires: &#8221; . gmdate( &#8220;D, d M Y H:i:s&#8221;, time() + $expiresOffset ) . &#8221; GMT&#8221; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve the number of database queries during the WordPress execution.<br \/>\n *<br \/>\n * @since 2.0.0<br \/>\n *<br \/>\n * @return int Number of database queries<br \/>\n *\/<br \/>\nfunction get_num_queries() {<br \/>\n\tglobal $wpdb;<br \/>\n\treturn $wpdb-&gt;num_queries;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Whether input is yes or no. Must be &#8216;y&#8217; to be true.<br \/>\n *<br \/>\n * @since 1.0.0<br \/>\n *<br \/>\n * @param string $yn Character string containing either &#8216;y&#8217; or &#8216;n&#8217;<br \/>\n * @return bool True if yes, false on anything else<br \/>\n *\/<br \/>\nfunction bool_from_yn( $yn ) {<br \/>\n\treturn ( strtolower( $yn ) == &#8216;y&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Loads the feed template from the use of an action hook.<br \/>\n *<br \/>\n * If the feed action does not have a hook, then the function will die with a<br \/>\n * message telling the visitor that the feed is not valid.<br \/>\n *<br \/>\n * It is better to only have one hook for each feed.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n * @uses $wp_query Used to tell if the use a comment feed.<br \/>\n * @uses do_action() Calls &#8216;do_feed_$feed&#8217; hook, if a hook exists for the feed.<br \/>\n *\/<br \/>\nfunction do_feed() {<br \/>\n\tglobal $wp_query;<\/p>\n<p>\t$feed = get_query_var( &#8216;feed&#8217; );<\/p>\n<p>\t\/\/ Remove the pad, if present.<br \/>\n\t$feed = preg_replace( &#8216;\/^_+\/&#8217;, &#8221;, $feed );<\/p>\n<p>\tif ( $feed == &#8221; || $feed == &#8216;feed&#8217; )<br \/>\n\t\t$feed = get_default_feed();<\/p>\n<p>\t$hook = &#8216;do_feed_&#8217; . $feed;<br \/>\n\tif ( !has_action($hook) ) {<br \/>\n\t\t$message = sprintf( __( &#8216;ERROR: %s is not a valid feed template.&#8217; ), esc_html($feed));<br \/>\n\t\twp_die( $message, &#8221;, array( &#8216;response&#8217; =&gt; 404 ) );<br \/>\n\t}<\/p>\n<p>\tdo_action( $hook, $wp_query-&gt;is_comment_feed );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Load the RDF RSS 0.91 Feed template.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n *\/<br \/>\nfunction do_feed_rdf() {<br \/>\n\tload_template( ABSPATH . WPINC . &#8216;\/feed-rdf.php&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Load the RSS 1.0 Feed Template.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n *\/<br \/>\nfunction do_feed_rss() {<br \/>\n\tload_template( ABSPATH . WPINC . &#8216;\/feed-rss.php&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Load either the RSS2 comment feed or the RSS2 posts feed.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n *<br \/>\n * @param bool $for_comments True for the comment feed, false for normal feed.<br \/>\n *\/<br \/>\nfunction do_feed_rss2( $for_comments ) {<br \/>\n\tif ( $for_comments )<br \/>\n\t\tload_template( ABSPATH . WPINC . &#8216;\/feed-rss2-comments.php&#8217; );<br \/>\n\telse<br \/>\n\t\tload_template( ABSPATH . WPINC . &#8216;\/feed-rss2.php&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Load either Atom comment feed or Atom posts feed.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n *<br \/>\n * @param bool $for_comments True for the comment feed, false for normal feed.<br \/>\n *\/<br \/>\nfunction do_feed_atom( $for_comments ) {<br \/>\n\tif ($for_comments)<br \/>\n\t\tload_template( ABSPATH . WPINC . &#8216;\/feed-atom-comments.php&#8217;);<br \/>\n\telse<br \/>\n\t\tload_template( ABSPATH . WPINC . &#8216;\/feed-atom.php&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Display the robots.txt file content.<br \/>\n *<br \/>\n * The echo content should be with usage of the permalinks or for creating the<br \/>\n * robots.txt file.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n * @uses do_action() Calls &#8216;do_robotstxt&#8217; hook for displaying robots.txt rules.<br \/>\n *\/<br \/>\nfunction do_robots() {<br \/>\n\theader( &#8216;Content-Type: text\/plain; charset=utf-8&#8217; );<\/p>\n<p>\tdo_action( &#8216;do_robotstxt&#8217; );<\/p>\n<p>\t$output = &#8220;User-agent: *\\n&#8221;;<br \/>\n\t$public = get_option( &#8216;blog_public&#8217; );<br \/>\n\tif ( &#8216;0&#8217; == $public ) {<br \/>\n\t\t$output .= &#8220;Disallow: \/\\n&#8221;;<br \/>\n\t} else {<br \/>\n\t\t$site_url = parse_url( site_url() );<br \/>\n\t\t$path = ( !empty( $site_url[&#8216;path&#8217;] ) ) ? $site_url[&#8216;path&#8217;] : &#8221;;<br \/>\n\t\t$output .= &#8220;Disallow: $path\/wp-admin\/\\n&#8221;;<br \/>\n\t\t$output .= &#8220;Disallow: $path\/wp-includes\/\\n&#8221;;<br \/>\n\t}<\/p>\n<p>\techo apply_filters(&#8216;robots_txt&#8217;, $output, $public);<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Test whether blog is already installed.<br \/>\n *<br \/>\n * The cache will be checked first. If you have a cache plugin, which saves the<br \/>\n * cache values, then this will work. If you use the default WordPress cache,<br \/>\n * and the database goes away, then you might have problems.<br \/>\n *<br \/>\n * Checks for the option siteurl for whether WordPress is installed.<br \/>\n *<br \/>\n * @since 2.1.0<br \/>\n * @uses $wpdb<br \/>\n *<br \/>\n * @return bool Whether blog is already installed.<br \/>\n *\/<br \/>\nfunction is_blog_installed() {<br \/>\n\tglobal $wpdb;<\/p>\n<p>\t\/\/ Check cache first. If options table goes away and we have true cached, oh well.<br \/>\n\tif ( wp_cache_get( &#8216;is_blog_installed&#8217; ) )<br \/>\n\t\treturn true;<\/p>\n<p>\t$suppress = $wpdb-&gt;suppress_errors();<br \/>\n\tif ( ! defined( &#8216;WP_INSTALLING&#8217; ) ) {<br \/>\n\t\t$alloptions = wp_load_alloptions();<br \/>\n\t}<br \/>\n\t\/\/ If siteurl is not set to autoload, check it specifically<br \/>\n\tif ( !isset( $alloptions[&#8216;siteurl&#8217;] ) )<br \/>\n\t\t$installed = $wpdb-&gt;get_var( &#8220;SELECT option_value FROM $wpdb-&gt;options WHERE option_name = &#8216;siteurl'&#8221; );<br \/>\n\telse<br \/>\n\t\t$installed = $alloptions[&#8216;siteurl&#8217;];<br \/>\n\t$wpdb-&gt;suppress_errors( $suppress );<\/p>\n<p>\t$installed = !empty( $installed );<br \/>\n\twp_cache_set( &#8216;is_blog_installed&#8217;, $installed );<\/p>\n<p>\tif ( $installed )<br \/>\n\t\treturn true;<\/p>\n<p>\t\/\/ If visiting repair.php, return true and let it take over.<br \/>\n\tif ( defined( &#8216;WP_REPAIRING&#8217; ) )<br \/>\n\t\treturn true;<\/p>\n<p>\t$suppress = $wpdb-&gt;suppress_errors();<\/p>\n<p>\t\/\/ Loop over the WP tables. If none exist, then scratch install is allowed.<br \/>\n\t\/\/ If one or more exist, suggest table repair since we got here because the options<br \/>\n\t\/\/ table could not be accessed.<br \/>\n\t$wp_tables = $wpdb-&gt;tables();<br \/>\n\tforeach ( $wp_tables as $table ) {<br \/>\n\t\t\/\/ The existence of custom user tables shouldn&#8217;t suggest an insane state or prevent a clean install.<br \/>\n\t\tif ( defined( &#8216;CUSTOM_USER_TABLE&#8217; ) &amp;&amp; CUSTOM_USER_TABLE == $table )<br \/>\n\t\t\tcontinue;<br \/>\n\t\tif ( defined( &#8216;CUSTOM_USER_META_TABLE&#8217; ) &amp;&amp; CUSTOM_USER_META_TABLE == $table )<br \/>\n\t\t\tcontinue;<\/p>\n<p>\t\tif ( ! $wpdb-&gt;get_results( &#8220;DESCRIBE $table;&#8221; ) )<br \/>\n\t\t\tcontinue;<\/p>\n<p>\t\t\/\/ One or more tables exist. We are insane.<\/p>\n<p>\t\twp_load_translations_early();<\/p>\n<p>\t\t\/\/ Die with a DB error.<br \/>\n\t\t$wpdb-&gt;error = sprintf( __( &#8216;One or more database tables are unavailable. The database may need to be <a href=\"%s\">repaired<\/a>.&#8217; ), &#8216;maint\/repair.php?referrer=is_blog_installed&#8217; );<br \/>\n\t\tdead_db();<br \/>\n\t}<\/p>\n<p>\t$wpdb-&gt;suppress_errors( $suppress );<\/p>\n<p>\twp_cache_set( &#8216;is_blog_installed&#8217;, false );<\/p>\n<p>\treturn false;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve URL with nonce added to URL query.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage Security<br \/>\n * @since 2.0.4<br \/>\n *<br \/>\n * @param string $actionurl URL to add nonce action<br \/>\n * @param string $action Optional. Nonce action name<br \/>\n * @return string URL with nonce action added.<br \/>\n *\/<br \/>\nfunction wp_nonce_url( $actionurl, $action = -1 ) {<br \/>\n\t$actionurl = str_replace( &#8216;&amp;&#8217;, &#8216;&amp;&#8217;, $actionurl );<br \/>\n\treturn esc_html( add_query_arg( &#8216;_wpnonce&#8217;, wp_create_nonce( $action ), $actionurl ) );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve or display nonce hidden field for forms.<br \/>\n *<br \/>\n * The nonce field is used to validate that the contents of the form came from<br \/>\n * the location on the current site and not somewhere else. The nonce does not<br \/>\n * offer absolute protection, but should protect against most cases. It is very<br \/>\n * important to use nonce field in forms.<br \/>\n *<br \/>\n * The $action and $name are optional, but if you want to have better security,<br \/>\n * it is strongly suggested to set those two parameters. It is easier to just<br \/>\n * call the function without any parameters, because validation of the nonce<br \/>\n * doesn&#8217;t require any parameters, but since crackers know what the default is<br \/>\n * it won&#8217;t be difficult for them to find a way around your nonce and cause<br \/>\n * damage.<br \/>\n *<br \/>\n * The input name will be whatever $name value you gave. The input value will be<br \/>\n * the nonce creation value.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage Security<br \/>\n * @since 2.0.4<br \/>\n *<br \/>\n * @param string $action Optional. Action name.<br \/>\n * @param string $name Optional. Nonce name.<br \/>\n * @param bool $referer Optional, default true. Whether to set the referer field for validation.<br \/>\n * @param bool $echo Optional, default true. Whether to display or return hidden form field.<br \/>\n * @return string Nonce field.<br \/>\n *\/<br \/>\nfunction wp_nonce_field( $action = -1, $name = &#8220;_wpnonce&#8221;, $referer = true , $echo = true ) {<br \/>\n\t$name = esc_attr( $name );<br \/>\n\t$nonce_field = &#8216;&lt;input type=&#8221;hidden&#8221; id=&#8221;&#8216; . $name . &#8216;&#8221; name=&#8221;&#8216; . $name . &#8216;&#8221; value=&#8221;&#8216; . wp_create_nonce( $action ) . &#8216;&#8221; \/&gt;&#8217;;<\/p>\n<p>\tif ( $referer )<br \/>\n\t\t$nonce_field .= wp_referer_field( false );<\/p>\n<p>\tif ( $echo )<br \/>\n\t\techo $nonce_field;<\/p>\n<p>\treturn $nonce_field;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve or display referer hidden field for forms.<br \/>\n *<br \/>\n * The referer link is the current Request URI from the server super global. The<br \/>\n * input name is &#8216;_wp_http_referer&#8217;, in case you wanted to check manually.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage Security<br \/>\n * @since 2.0.4<br \/>\n *<br \/>\n * @param bool $echo Whether to echo or return the referer field.<br \/>\n * @return string Referer field.<br \/>\n *\/<br \/>\nfunction wp_referer_field( $echo = true ) {<br \/>\n\t$ref = esc_attr( $_SERVER[&#8216;REQUEST_URI&#8217;] );<br \/>\n\t$referer_field = &#8216;&lt;input type=&#8221;hidden&#8221; name=&#8221;_wp_http_referer&#8221; value=&#8221;&#8216;. $ref . &#8216;&#8221; \/&gt;&#8217;;<\/p>\n<p>\tif ( $echo )<br \/>\n\t\techo $referer_field;<br \/>\n\treturn $referer_field;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve or display original referer hidden field for forms.<br \/>\n *<br \/>\n * The input name is &#8216;_wp_original_http_referer&#8217; and will be either the same<br \/>\n * value of {@link wp_referer_field()}, if that was posted already or it will<br \/>\n * be the current page, if it doesn&#8217;t exist.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage Security<br \/>\n * @since 2.0.4<br \/>\n *<br \/>\n * @param bool $echo Whether to echo the original http referer<br \/>\n * @param string $jump_back_to Optional, default is &#8216;current&#8217;. Can be &#8216;previous&#8217; or page you want to jump back to.<br \/>\n * @return string Original referer field.<br \/>\n *\/<br \/>\nfunction wp_original_referer_field( $echo = true, $jump_back_to = &#8216;current&#8217; ) {<br \/>\n\t$jump_back_to = ( &#8216;previous&#8217; == $jump_back_to ) ? wp_get_referer() : $_SERVER[&#8216;REQUEST_URI&#8217;];<br \/>\n\t$ref = ( wp_get_original_referer() ) ? wp_get_original_referer() : $jump_back_to;<br \/>\n\t$orig_referer_field = &#8216;&lt;input type=&#8221;hidden&#8221; name=&#8221;_wp_original_http_referer&#8221; value=&#8221;&#8216; . esc_attr( stripslashes( $ref ) ) . &#8216;&#8221; \/&gt;&#8217;;<br \/>\n\tif ( $echo )<br \/>\n\t\techo $orig_referer_field;<br \/>\n\treturn $orig_referer_field;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve referer from &#8216;_wp_http_referer&#8217; or HTTP referer. If it&#8217;s the same<br \/>\n * as the current request URL, will return false.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage Security<br \/>\n * @since 2.0.4<br \/>\n *<br \/>\n * @return string|bool False on failure. Referer URL on success.<br \/>\n *\/<br \/>\nfunction wp_get_referer() {<br \/>\n\t$ref = false;<br \/>\n\tif ( ! empty( $_REQUEST[&#8216;_wp_http_referer&#8217;] ) )<br \/>\n\t\t$ref = $_REQUEST[&#8216;_wp_http_referer&#8217;];<br \/>\n\telse if ( ! empty( $_SERVER[&#8216;HTTP_REFERER&#8217;] ) )<br \/>\n\t\t$ref = $_SERVER[&#8216;HTTP_REFERER&#8217;];<\/p>\n<p>\tif ( $ref &amp;&amp; $ref !== $_SERVER[&#8216;REQUEST_URI&#8217;] )<br \/>\n\t\treturn $ref;<br \/>\n\treturn false;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Retrieve original referer that was posted, if it exists.<br \/>\n *<br \/>\n * @package WordPress<br \/>\n * @subpackage Security<br \/>\n * @since 2.0.4<br \/>\n *<br \/>\n * @return string|bool False if no original referer or original referer if set.<br \/>\n *\/<br \/>\nfunction wp_get_original_referer() {<br \/>\n\tif ( !empty( $_REQUEST[&#8216;_wp_original_http_referer&#8217;] ) )<br \/>\n\t\treturn $_REQUEST[&#8216;_wp_original_http_referer&#8217;];<br \/>\n\treturn false;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Recursive directory creation based on full path.<br \/>\n *<br \/>\n * Will attempt to set permissions on folders.<br \/>\n *<br \/>\n * @since 2.0.1<br \/>\n *<br \/>\n * @param string $target Full path to attempt to create.<br \/>\n * @return bool Whether the path was created. True if path already exists.<br \/>\n *\/<br \/>\nfunction wp_mkdir_p( $target ) {<br \/>\n\t$wrapper = null;<\/p>\n<p>\t\/\/ strip the protocol<br \/>\n\tif( wp_is_stream( $target ) ) {<br \/>\n\t\tlist( $wrapper, $target ) = explode( &#8216;:\/\/&#8217;, $target, 2 );<br \/>\n\t}<\/p>\n<p>\t\/\/ from php.net\/mkdir user contributed notes<br \/>\n\t$target = str_replace( &#8216;\/\/&#8217;, &#8216;\/&#8217;, $target );<\/p>\n<p>\t\/\/ put the wrapper back on the target<br \/>\n\tif( $wrapper !== null ) {<br \/>\n\t\t$target = $wrapper . &#8216;:\/\/&#8217; . $target;<br \/>\n\t}<\/p>\n<p>\t\/\/ safe mode fails with a trailing slash under certain PHP versions.<br \/>\n\t$target = rtrim($target, &#8216;\/&#8217;); \/\/ Use rtrim() instead of untrailingslashit to avoid formatting.php dependency.<br \/>\n\tif ( empty($target) )<br \/>\n\t\t$target = &#8216;\/&#8217;;<\/p>\n<p>\tif ( file_exists( $target ) )<br \/>\n\t\treturn @is_dir( $target );<\/p>\n<p>\t\/\/ Attempting to create the directory may clutter up our display.<br \/>\n\tif ( @mkdir( $target ) ) {<br \/>\n\t\t$stat = @stat( dirname( $target ) );<br \/>\n\t\t$dir_perms = $stat[&#8216;mode&#8217;] &amp; 0007777;  \/\/ Get the permission bits.<br \/>\n\t\t@chmod( $target, $dir_perms );<br \/>\n\t\treturn true;<br \/>\n\t} elseif ( is_dir( dirname( $target ) ) ) {<br \/>\n\t\t\treturn false;<br \/>\n\t}<\/p>\n<p>\t\/\/ If the above failed, attempt to create the parent node, then try again.<br \/>\n\tif ( ( $target != &#8216;\/&#8217; ) &amp;&amp; ( wp_mkdir_p( dirname( $target ) ) ) )<br \/>\n\t\treturn wp_mkdir_p( $target );<\/p>\n<p>\treturn false;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Test if a give filesystem path is absolute (&#8216;\/foo\/bar&#8217;, &#8216;c:\\windows&#8217;).<br \/>\n *<br \/>\n * @since 2.5.0<br \/>\n *<br \/>\n * @param string $path File path<br \/>\n * @return bool True if path is absolute, false is not absolute.<br \/>\n *\/<br \/>\nfunction path_is_absolute( $path ) {<br \/>\n\t\/\/ this is definitive if true but fails if $path does not exist or contains a symbolic link<br \/>\n\tif ( realpath($path) == $path )<br \/>\n\t\treturn true;<\/p>\n<p>\tif ( strlen($path) == 0 || $path[0] == &#8216;.&#8217; )<br \/>\n\t\treturn false;<\/p>\n<p>\t\/\/ windows allows absolute paths like this<br \/>\n\tif ( preg_match(&#8216;#^[a-zA-Z]:\\\\\\\\#&#8217;, $path) )<br \/>\n\t\treturn true;<\/p>\n<p>\t\/\/ a path starting with \/ or \\ is absolute; anything else is relative<br \/>\n\treturn ( $path[0] == &#8216;\/&#8217; || $path[0] == &#8216;\\\\&#8217; );<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Join two filesystem paths together (e.g. &#8216;give me $path relative to $base&#8217;).<br \/>\n *<br \/>\n * If the $path is absolute, then it the full path is returned.<br \/>\n *<br \/>\n * @since 2.5.0<br \/>\n *<br \/>\n * @param string $base<br \/>\n * @param string $path<br \/>\n * @return string The path with the base or absolute path.<br \/>\n *\/<br \/>\nfunction path_join( $base, $path ) {<br \/>\n\tif ( path_is_absolute($path) )<br \/>\n\t\treturn $path;<\/p>\n<p>\treturn rtrim($base, &#8216;\/&#8217;) . &#8216;\/&#8217; . ltrim($path, &#8216;\/&#8217;);<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Determines a writable directory for temporary files.<br \/>\n * Function&#8217;s preference is the return value of <code>sys_get_temp_dir()<\/code>,<br \/>\n * followed by your PHP temporary upload directory, followed by WP_CONTENT_DIR,<br \/>\n * before finally defaulting to \/tmp\/<br \/>\n *<br \/>\n * In the event that this function does not find a writable location,<br \/>\n * It may be overridden by the <code>WP_TEMP_DIR<\/code> constant in<br \/>\n * your <code>wp-config.php<\/code> file.<br \/>\n *<br \/>\n * @since 2.5.0<br \/>\n *<br \/>\n * @return string Writable temporary directory<br \/>\n *\/<br \/>\nfunction get_temp_dir() {<br \/>\n\tstatic $temp;<br \/>\n\tif ( defined(&#8216;WP_TEMP_DIR&#8217;) )<br \/>\n\t\treturn trailingslashit(WP_TEMP_DIR);<\/p>\n<p>\tif ( $temp )<br \/>\n\t\treturn trailingslashit( rtrim( $temp, &#8216;\\\\&#8217; ) );<\/p>\n<p>\t$is_win = ( &#8216;WIN&#8217; === strtoupper( substr( PHP_OS, 0, 3 ) ) );<\/p>\n<p>\tif ( function_exists(&#8216;sys_get_temp_dir&#8217;) ) {<br \/>\n\t\t$temp = sys_get_temp_dir();<br \/>\n\t\tif ( @is_dir( $temp ) &amp;&amp; ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) ) {<br \/>\n\t\t\treturn trailingslashit( rtrim( $temp, &#8216;\\\\&#8217; ) );<br \/>\n\t\t}<br \/>\n\t}<\/p>\n<p>\t$temp = ini_get(&#8216;upload_tmp_dir&#8217;);<br \/>\n\tif ( is_dir( $temp ) &amp;&amp; ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) )<br \/>\n\t\treturn trailingslashit( rtrim( $temp, &#8216;\\\\&#8217; ) );<\/p>\n<p>\t$temp = WP_CONTENT_DIR . &#8216;\/&#8217;;<br \/>\n\tif ( is_dir( $temp ) &amp;&amp; ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) )<br \/>\n\t\treturn $temp;<\/p>\n<p>\t$temp = &#8216;\/tmp\/&#8217;;<br \/>\n\treturn $temp;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Workaround for Windows bug in is_writable() function<br \/>\n *<br \/>\n * @since 2.8.0<br \/>\n *<br \/>\n * @param string $path<br \/>\n * @return bool<br \/>\n *\/<br \/>\nfunction win_is_writable( $path ) {<br \/>\n\t\/* will work in despite of Windows ACLs bug<br \/>\n\t * NOTE: use a trailing slash for folders!!!<br \/>\n\t * see http:\/\/bugs.php.net\/bug.php?id=27609<br \/>\n\t * see http:\/\/bugs.php.net\/bug.php?id=30931<br \/>\n\t *\/<\/p>\n<p>\tif ( $path[strlen( $path ) &#8211; 1] == &#8216;\/&#8217; ) \/\/ recursively return a temporary file path<br \/>\n\t\treturn win_is_writable( $path . uniqid( mt_rand() ) . &#8216;.tmp&#8217;);<br \/>\n\telse if ( is_dir( $path ) )<br \/>\n\t\treturn win_is_writable( $path . &#8216;\/&#8217; . uniqid( mt_rand() ) . &#8216;.tmp&#8217; );<br \/>\n\t\/\/ check tmp file for read\/write capabilities<br \/>\n\t$should_delete_tmp_file = !file_exists( $path );<br \/>\n\t$f = @fopen( $path, &#8216;a&#8217; );<br \/>\n\tif ( $f === false )<br \/>\n\t\treturn false;<br \/>\n\tfclose( $f );<br \/>\n\tif ( $should_delete_tmp_file )<br \/>\n\t\tunlink( $path );<br \/>\n\treturn true;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * Get an array containing the current upload directory&#8217;s path and url.<br \/>\n *<br \/>\n * Checks the &#8216;upload_path&#8217; option, which should be from the web root folder,<br \/>\n * and if it isn&#8217;t empty it will be used. If it is empty, then the path will be<br \/>\n * &#8216;WP_CONTENT_DIR\/uploads&#8217;. If the &#8216;UPLOADS&#8217; constant is defined, then it will<br \/>\n * override the &#8216;upload_path&#8217; option and &#8216;WP_CONTENT_DIR\/uploads&#8217; path.<br \/>\n *<br \/>\n * The upload URL path is set either by the &#8216;upload_url_path&#8217; option or by using<br \/>\n * the &#8216;WP_CONTENT_URL&#8217; constant and appending &#8216;\/uploads&#8217; to the path.<br \/>\n *<br \/>\n * If the &#8216;uploads_use_yearmonth_folders&#8217; is set to true (checkbox if checked in<br \/>\n * the administration settings panel), then the time will be used. The format<br \/>\n * will be year first and then month.<br \/>\n *<br \/>\n * If the path couldn&#8217;t be created, then an error will be returned with the key<br \/>\n * &#8216;error&#8217; containing the error message. The error suggests that the parent<br \/>\n * directory is not writable by the server.<br \/>\n *<br \/>\n * On success, the returned array will have many indices:<br \/>\n * &#8216;path&#8217; &#8211; base directory and sub directory or full path to upload directory.<br \/>\n * &#8216;url&#8217; &#8211; base url and sub dire<\/p>\n","protected":false},"template":"","class_list":["post-156243","topic","type-topic","status-closed","hentry","topic-tag-19759","topic-tag-19760","topic-tag-15033"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/156243","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/156243\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=156243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}