Make WordPress Core

Ticket #5639: functions.phpdoc.r6597.diff

File functions.phpdoc.r6597.diff, 30.4 KB (added by darkdragon, 16 years ago)

Incomplete documentation for functions.php based off of r6597

  • functions.php

     
    11<?php
     2/**
     3 *
     4 *
     5 * @package WordPress
     6 */
    27
     8/**
     9 * mysql2date() - {@internal Missing Short Description}}
     10 *
     11 * {@internal Missing Long Description}}
     12 *
     13 * @since 0.71
     14 *
     15 * @param unknown_type $dateformatstring
     16 * @param unknown_type $mysqlstring
     17 * @param unknown_type $translate
     18 * @return unknown
     19 */
    320function mysql2date( $dateformatstring, $mysqlstring, $translate = true ) {
    421        global $wp_locale;
    522        $m = $mysqlstring;
     
    4360        return $j;
    4461}
    4562
    46 
     63/**
     64 * current_time() - {@internal Missing Short Description}}
     65 *
     66 * {@internal Missing Long Description}}
     67 *
     68 * @since 1.0.0
     69 *
     70 * @param unknown_type $type
     71 * @param unknown_type $gmt
     72 * @return unknown
     73 */
    4774function current_time( $type, $gmt = 0 ) {
    4875        switch ( $type ) {
    4976                case 'mysql':
     
    5582        }
    5683}
    5784
    58 
     85/**
     86 * date_i18n() - {@internal Missing Short Description}}
     87 *
     88 * {@internal Missing Long Description}}
     89 *
     90 * @since 0.71
     91 *
     92 * @param unknown_type $dateformatstring
     93 * @param unknown_type $unixtimestamp
     94 * @return unknown
     95 */
    5996function date_i18n( $dateformatstring, $unixtimestamp ) {
    6097        global $wp_locale;
    6198        $i = $unixtimestamp;
     
    80117        return $j;
    81118}
    82119
    83 
     120/**
     121 * number_format_i18n() - {@internal Missing Short Description}}
     122 *
     123 * {@internal Missing Long Description}}
     124 *
     125 * @since 2.3.0
     126 *
     127 * @param unknown_type $number
     128 * @param unknown_type $decimals
     129 * @return unknown
     130 */
    84131function number_format_i18n( $number, $decimals = null ) {
    85132        global $wp_locale;
    86133        // let the user override the precision only
     
    89136        return number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
    90137}
    91138
    92 
     139/**
     140 * size_format() - {@internal Missing Short Description}}
     141 *
     142 * {@internal Missing Long Description}}
     143 *
     144 * @since 2.3.0
     145 *
     146 * @param unknown_type $bytes
     147 * @param unknown_type $decimals
     148 * @return unknown
     149 */
    93150function size_format( $bytes, $decimals = null ) {
    94151        // technically the correct unit names for powers of 1024 are KiB, MiB etc
    95152        // see http://en.wikipedia.org/wiki/Byte
     
    107164                        return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit;
    108165}
    109166
    110 
     167/**
     168 * get_weekstartend() - {@internal Missing Short Description}}
     169 *
     170 * {@internal Missing Long Description}}
     171 *
     172 * @since 0.71
     173 *
     174 * @param unknown_type $mysqlstring
     175 * @param unknown_type $start_of_week
     176 * @return unknown
     177 */
    111178function get_weekstartend( $mysqlstring, $start_of_week = '' ) {
    112179        $my = substr( $mysqlstring, 0, 4 );
    113180        $mm = substr( $mysqlstring, 8, 2 );
     
    134201        return $week;
    135202}
    136203
    137 
     204/**
     205 * maybe_unserialize() - {@internal Missing Short Description}}
     206 *
     207 * {@internal Missing Long Description}}
     208 *
     209 * @since 2.0.0
     210 *
     211 * @param unknown_type $original
     212 * @return unknown
     213 */
    138214function maybe_unserialize( $original ) {
    139215        if ( is_serialized( $original ) ) // don't attempt to unserialize data that wasn't serialized going in
    140216                if ( false !== $gm = @unserialize( $original ) )
     
    142218        return $original;
    143219}
    144220
    145 
     221/**
     222 * is_serialized() - {@internal Missing Short Description}}
     223 *
     224 * {@internal Missing Long Description}}
     225 *
     226 * @since 2.0.5
     227 *
     228 * @param unknown_type $data
     229 * @return unknown
     230 */
    146231function is_serialized( $data ) {
    147232        // if it isn't a string, it isn't serialized
    148233        if ( !is_string( $data ) )
     
    169254        return false;
    170255}
    171256
    172 
     257/**
     258 * is_serialized_string() - {@internal Missing Short Description}}
     259 *
     260 * {@internal Missing Long Description}}
     261 *
     262 * @since 2.0.5
     263 *
     264 * @param unknown_type $data
     265 * @return unknown
     266 */
    173267function is_serialized_string( $data ) {
    174268        // if it isn't a string, it isn't a serialized string
    175269        if ( !is_string( $data ) )
     
    183277
    184278/* Options functions */
    185279
    186 // expects $setting to already be SQL-escaped
     280/**
     281 * get_option() - {@internal Missing Short Description}}
     282 *
     283 * {@internal Missing Long Description}}
     284 * Expects $setting to already be SQL-escaped
     285 *
     286 * @since 1.5.0
     287 * @package WordPress
     288 * @subpackage Option
     289 *
     290 * @param string $setting
     291 * @return string
     292 */
    187293function get_option( $setting ) {
    188294        global $wpdb;
    189295
     
    233339        return apply_filters( 'option_' . $setting, maybe_unserialize( $value ) );
    234340}
    235341
    236 
     342/**
     343 *
     344 */
     345/**
     346 * wp_protected_special_option() - {@internal Missing Short Description}}
     347 *
     348 * {@internal Missing Long Description}}
     349 *
     350 * @since 2.2.0
     351 * @package WordPress
     352 * @subpackage Option
     353 *
     354 * @param unknown_type $option
     355 */
    237356function wp_protect_special_option( $option ) {
    238357        $protected = array( 'alloptions', 'notoptions' );
    239358        if ( in_array( $option, $protected ) )
    240359                die( sprintf( __( '%s is a protected WP option and may not be modified' ), wp_specialchars( $option ) ) );
    241360}
    242361
     362/**
     363 * form_option() - {@internal Missing Short Description}}
     364 *
     365 * {@internal Missing Long Description}}
     366 *
     367 * @since 1.5.0
     368 * @package WordPress
     369 * @subpackage Option
     370 *
     371 * @param string $option
     372 * @return string
     373 */
    243374function form_option( $option ) {
    244         echo attribute_escape (get_option( $option ) );
     375        echo attribute_escape ( get_option( $option ) );
    245376}
    246377
     378/**
     379 * get_alloptions() - {@internal Missing Short Description}}
     380 *
     381 * {@internal Missing Long Description}}
     382 *
     383 * @since 1.0.0
     384 * @package WordPress
     385 * @subpackage Option
     386 *
     387 * @return string
     388 */
    247389function get_alloptions() {
    248         global $wpdb, $wp_queries;
     390        global $wpdb;
    249391        $show = $wpdb->hide_errors();
    250392        if ( !$options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ) )
    251393                $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
     
    262404        return apply_filters( 'all_options', $all_options );
    263405}
    264406
    265 
     407/**
     408 * wp_load_alloptions() - {@internal Missing Short Description}}
     409 *
     410 * {@internal Missing Long Description}}
     411 *
     412 * @since 2.2.0
     413 * @package WordPress
     414 * @subpackage Option
     415 *
     416 * @param string $setting
     417 * @return string
     418 */
    266419function wp_load_alloptions() {
    267420        global $wpdb;
    268421
     
    281434        return $alloptions;
    282435}
    283436
    284 
    285 // expects $option_name to NOT be SQL-escaped
     437/**
     438 * update_option() - {@internal Missing Short Description}}
     439 *
     440 * {@internal Missing Long Description}}
     441 * Expects $option_name to NOT be SQL-escaped
     442 *
     443 * @since 1.0.0
     444 * @package WordPress
     445 * @subpackage Option
     446 *
     447 * @param string $option_name
     448 * @param string $newvalue
     449 * @return string
     450 */
    286451function update_option( $option_name, $newvalue ) {
    287452        global $wpdb;
    288453
     
    326491        return false;
    327492}
    328493
    329 
    330 // thx Alex Stapleton, http://alex.vort-x.net/blog/
    331 // expects $name to NOT be SQL-escaped
     494/**
     495 * add_option() - {@internal Missing Short Description}}
     496 *
     497 * {@internal Missing Long Description}}
     498 *
     499 * @since 1.0.0
     500 * @link http://alex.vort-x.net/blog/ Thanks Alex Stapleton
     501 */
    332502function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) {
    333503        global $wpdb;
    334504
     
    485655                fclose( $fp );
    486656}
    487657
     658
    488659function do_enclose( $content, $post_ID ) {
    489660        global $wpdb;
    490661        include_once( ABSPATH . WPINC . '/class-IXR.php' );
     
    534705// perform a HTTP HEAD or GET request
    535706// if $file_path is a writable filename, this will do a GET request and write the file to that path
    536707// returns a list of HTTP headers
     708
    537709function wp_get_http( $url, $file_path = false, $red = 1 ) {
    538710        global $wp_version;
    539711        @set_time_limit( 60 );
     
    551723                $request_type = 'GET';
    552724        else
    553725                $request_type = 'HEAD';
    554                
     726
    555727        $head = "$request_type $file HTTP/1.1\r\nHOST: $host\r\nUser-Agent: WordPress/" . $wp_version . "\r\n\r\n";
    556728
    557729        $fp = @fsockopen( $host, $parts['port'], $err_num, $err_msg, 3 );
     
    577749                                fclose($fp);
    578750                                return wp_get_http( $headers['location'], $file_path, ++$red );
    579751                }
    580        
     752
    581753        // make a note of the final location, so the caller can tell if we were redirected or not
    582754        $headers['x-final-location'] = $url;
    583755
     
    586758                fclose($fp);
    587759                return $headers;
    588760        }
    589        
     761
    590762        // GET request - fetch and write it to the supplied filename
    591763        $content_length = $headers['content-length'];
    592764        $got_bytes = 0;
     
    599771                if ($content_length and $got_bytes >= $content_length)
    600772                        break;
    601773        }
    602        
     774
    603775        fclose($out_fp);
    604776        fclose($fp);
    605777        return $headers;
    606778}
    607779
     780/**
     781 * wp_get_http_headers() - {@internal Missing Short Description}}
     782 *
     783 * {@internal Missing Long Description}}
     784 *
     785 * @since 1.5.1
     786 *
     787 * @param unknown_type $url
     788 * @param unknown_type $red
     789 * @return unknown
     790 */
    608791function wp_get_http_headers( $url, $red = 1 ) {
    609792        return wp_get_http( $url, false, $red );
    610793}
    611794
    612 
     795/**
     796 * is_new_day() - {@internal Missing Short Description}}
     797 *
     798 * {@internal Missing Long Description}}
     799 *
     800 * @since 0.71
     801 *
     802 * @return unknown
     803 */
    613804function is_new_day() {
    614805        global $day, $previousday;
    615806        if ( $day != $previousday )
     
    618809                return 0;
    619810}
    620811
    621 
     812/**
     813 * build_query() - {@internal Missing Short Description}}
     814 *
     815 * {@internal Missing Long Description}}
     816 *
     817 * @since 2.3.0
     818 *
     819 * @param unknown_type $data
     820 * @return unknown
     821 */
    622822function build_query( $data ) {
    623823        return _http_build_query( $data, NULL, '&', '', false );
    624824}
    625825
    626 
    627 /*
    628 add_query_arg: Returns a modified querystring by adding
    629 a single key & value or an associative array.
    630 Setting a key value to emptystring removes the key.
    631 Omitting oldquery_or_uri uses the $_SERVER value.
    632 
    633 Parameters:
    634 add_query_arg(newkey, newvalue, oldquery_or_uri) or
    635 add_query_arg(associative_array, oldquery_or_uri)
    636 */
     826/**
     827 * add_query_arg() - Returns a modified query string
     828 *
     829 * {@internal Missing Long Description}}
     830 *
     831 * Adding a single key & value or an associative array.
     832 * Setting a key value to emptystring removes the key.
     833 * Omitting oldquery_or_uri uses the $_SERVER value.
     834 *
     835 * @since 1.5.0
     836 *
     837 * @param mixed $param1 Either newkey or an associative_array
     838 * @param mixed $param2 Either newvalue or oldquery or uri
     839 * @param mixed $param3 Optional. Old query or uri
     840 * @return unknown
     841 */
    637842function add_query_arg() {
    638843        $ret = '';
    639844        if ( is_array( func_get_arg(0) ) ) {
     
    699904        return $ret;
    700905}
    701906
    702 
    703 /*
    704 remove_query_arg: Returns a modified querystring by removing
    705 a single key or an array of keys.
    706 Omitting oldquery_or_uri uses the $_SERVER value.
    707 
    708 Parameters:
    709 remove_query_arg(removekey, [oldquery_or_uri]) or
    710 remove_query_arg(removekeyarray, [oldquery_or_uri])
    711 */
    712 
    713 function remove_query_arg( $key, $query=FALSE ) {
     907/**
     908 * remove_query_arg() - Removes an item or list from the query string
     909 *
     910 * Omitting oldquery_or_uri uses the $_SERVER value.
     911 * {@internal Missing Long Description}}
     912 *
     913 * @since 1.5.0
     914 *
     915 * @param string|array $key The key or list of keys to remove
     916 * @param unknown_type $query
     917 * @return unknown
     918 */
     919function remove_query_arg( $key, $query=false ) {
    714920        if ( is_array( $key ) ) { // removing multiple keys
    715921                foreach ( (array) $key as $k )
    716                         $query = add_query_arg( $k, FALSE, $query );
     922                        $query = add_query_arg( $k, false, $query );
    717923                return $query;
    718924        }
    719         return add_query_arg( $key, FALSE, $query );
     925        return add_query_arg( $key, false, $query );
    720926}
    721927
    722 
     928/**
     929 * add_magic_quotes() - Walks the array while sanitizing the contents
     930 *
     931 * {@internal Missing Long Description}}
     932 *
     933 * @since 0.71
     934 *
     935 * @param array $array
     936 * @return array Sanitized array
     937 */
    723938function add_magic_quotes( $array ) {
    724939        global $wpdb;
    725940
     
    733948        return $array;
    734949}
    735950
     951/**
     952 * wp_remote_fopen() - {@internal Missing Short Description}}
     953 *
     954 * {@internal Missing Long Description}}
     955 *
     956 * @since 1.5.1
     957 *
     958 * @param unknown_type $uri
     959 * @return unknown
     960 */
    736961function wp_remote_fopen( $uri ) {
    737962        $timeout = 10;
    738963        $parsed_url = @parse_url( $uri );
     
    768993        }
    769994}
    770995
    771 
     996/**
     997 * wp() - {@internal Missing Short Description}}
     998 *
     999 * {@internal Missing Long Description}}
     1000 *
     1001 * @since 2.0.0
     1002 *
     1003 * @param unknown_type $query_vars
     1004 */
    7721005function wp( $query_vars = '' ) {
    7731006        global $wp, $wp_query, $wp_the_query;
    7741007        $wp->main( $query_vars );
     
    7771010                $wp_the_query = $wp_query;
    7781011}
    7791012
    780 
     1013/**
     1014 * get_status_header_desc() - {@internal Missing Short Description}}
     1015 *
     1016 * {@internal Missing Long Description}}
     1017 *
     1018 * @since 2.3.0
     1019 *
     1020 * @param unknown_type $code
     1021 * @return unknown
     1022 */
    7811023function get_status_header_desc( $code ) {
    7821024        global $wp_header_to_desc;
    7831025
     
    8371079                return '';
    8381080}
    8391081
    840 
     1082/**
     1083 * status_header() - {@internal Missing Short Description}}
     1084 *
     1085 * {@internal Missing Long Description}}
     1086 *
     1087 * @since 2.0.0
     1088 *
     1089 * @param unknown_type $header
     1090 * @return unknown
     1091 */
    8411092function status_header( $header ) {
    8421093        $text = get_status_header_desc( $header );
    8431094
     
    8571108                return @header( $status_header );
    8581109}
    8591110
    860 
     1111/**
     1112 * nocache_headers() - {@internal Missing Short Description}}
     1113 *
     1114 * {@internal Missing Long Description}}
     1115 *
     1116 * @since 2.0.0
     1117 */
    8611118function nocache_headers() {
    8621119        // why are these @-silenced when other header calls aren't?
    8631120        @header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
     
    8661123        @header( 'Pragma: no-cache' );
    8671124}
    8681125
    869 
     1126/**
     1127 * cache_javascript_headers() - {@internal Missing Short Description}}
     1128 *
     1129 * {@internal Missing Long Description}}
     1130 *
     1131 * @since 2.1.0
     1132 */
    8701133function cache_javascript_headers() {
    8711134        $expiresOffset = 864000; // 10 days
    8721135        header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) );
     
    8741137        header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" );
    8751138}
    8761139
    877 
     1140/**
     1141 * get_num_queries() - {@internal Missing Short Description}}
     1142 *
     1143 * {@internal Missing Long Description}}
     1144 *
     1145 * @since 2.0.0
     1146 *
     1147 * @return unknown
     1148 */
    8781149function get_num_queries() {
    8791150        global $wpdb;
    8801151        return $wpdb->num_queries;
    8811152}
    8821153
    883 
     1154/**
     1155 * bool_from_yn() - Whether input is yes or no
     1156 *
     1157 * @since 1.0.0
     1158 *
     1159 * @param string $yn Character string containing either 'y' or 'n'
     1160 * @return bool True if yes, false on anything else
     1161 */
    8841162function bool_from_yn( $yn ) {
    8851163        return ( strtolower( $yn ) == 'y' );
    8861164}
    8871165
    888 
     1166/**
     1167 * do_feed() - {@internal Missing Short Description}}
     1168 *
     1169 * {@internal Missing Long Description}}
     1170 *
     1171 * @since 2.1.0
     1172 * @uses $wp_query
     1173 * @uses do_action()
     1174 */
    8891175function do_feed() {
    8901176        global $wp_query;
    8911177
     
    9011187        do_action( $hook, $wp_query->is_comment_feed );
    9021188}
    9031189
    904 
     1190/**
     1191 * do_feed_rdf() - {@internal Missing Short Description}}
     1192 *
     1193 * {@internal Missing Long Description}}
     1194 *
     1195 * @since 2.1.0
     1196 */
    9051197function do_feed_rdf() {
    9061198        load_template( ABSPATH . WPINC . '/feed-rdf.php' );
    9071199}
    9081200
    909 
     1201/**
     1202 * do_feed_rss() - {@internal Missing Short Description}}
     1203 *
     1204 * {@internal Missing Long Description}}
     1205 *
     1206 * @since 2.1.0
     1207 */
    9101208function do_feed_rss() {
    9111209        load_template( ABSPATH . WPINC . '/feed-rss.php' );
    9121210}
    9131211
    914 
     1212/**
     1213 * do_feed_rss2() - {@internal Missing Short Description}}
     1214 *
     1215 * {@internal Missing Long Description}}
     1216 *
     1217 * @since 2.1.0
     1218 *
     1219 * @param bool $for_comments Whether to use the comment template or the plain rss2 template
     1220 */
    9151221function do_feed_rss2( $for_comments ) {
    9161222        if ( $for_comments )
    9171223                load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' );
     
    9191225                load_template( ABSPATH . WPINC . '/feed-rss2.php' );
    9201226}
    9211227
    922 
     1228/**
     1229 * do_feed_atom() - {@internal Missing Short Description}}
     1230 *
     1231 * {@internal Missing Long Description}}
     1232 *
     1233 * @since 2.1.0
     1234 *
     1235 * @param bool $for_comments Whether to use the comment template or the plain atom template
     1236 */
    9231237function do_feed_atom( $for_comments ) {
    9241238        if ($for_comments)
    9251239                load_template( ABSPATH . WPINC . '/feed-atom-comments.php');
     
    9271241                load_template( ABSPATH . WPINC . '/feed-atom.php' );
    9281242}
    9291243
     1244/**
     1245 * do_robots() - {@internal Missing Short Description}}
     1246 *
     1247 * {@internal Missing Long Description}}
     1248 *
     1249 * @since 2.1.0
     1250 * @uses do_action()
     1251 */
    9301252function do_robots() {
    9311253        header( 'Content-Type: text/plain; charset=utf-8' );
    9321254
     
    9411263        }
    9421264}
    9431265
    944 
     1266/**
     1267 * is_blog_installed() - Test whether blog is already installed
     1268 *
     1269 * {@internal Missing Long Description}}
     1270 *
     1271 * @since 2.1.0
     1272 * @uses $wpdb
     1273 *
     1274 * @return bool Whether blog is already installed
     1275 */
    9451276function is_blog_installed() {
    9461277        global $wpdb;
    9471278
    948         // Check cache first.  If options table goes away and we have true cached, oh well. 
     1279        // Check cache first. If options table goes away and we have true cached, oh well.
    9491280        if ( wp_cache_get('is_blog_installed') )
    9501281                return true;
    9511282
     
    9591290        return $installed;
    9601291}
    9611292
    962 
     1293/**
     1294 * wp_nonce_url() - {@internal Missing Short Description}}
     1295 *
     1296 * {@internal Missing Long Description}}
     1297 *
     1298 * @since 2.0.4
     1299 *
     1300 * @param unknown_type $actionurl
     1301 * @param unknown_type $action
     1302 * @return unknown
     1303 */
    9631304function wp_nonce_url( $actionurl, $action = -1 ) {
    9641305        $actionurl = str_replace( '&amp;', '&', $actionurl );
    9651306        return wp_specialchars( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $actionurl ) );
    9661307}
    9671308
    968 
     1309/**
     1310 * wp_nonce_field() - {@internal Missing Short Description}}
     1311 *
     1312 * {@internal Missing Long Description}}
     1313 *
     1314 * @since 2.0.4
     1315 *
     1316 * @param unknown_type $action
     1317 * @param unknown_type $name
     1318 * @param unknown_type $referer
     1319 */
    9691320function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true ) {
    9701321        $name = attribute_escape( $name );
    9711322        echo '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />';
     
    9731324                wp_referer_field();
    9741325}
    9751326
    976 
     1327/**
     1328 * wp_referer_field() - {@internal Missing Short Description}}
     1329 *
     1330 * {@internal Missing Long Description}}
     1331 *
     1332 * @since 2.0.4
     1333 */
    9771334function wp_referer_field() {
    9781335        $ref = attribute_escape( $_SERVER['REQUEST_URI'] );
    9791336        echo '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />';
     
    9831340        }
    9841341}
    9851342
    986 
     1343/**
     1344 * wp_original_referer_field() - {@internal Missing Short Description}}
     1345 *
     1346 * {@internal Missing Long Description}}
     1347 *
     1348 * @since 2.0.4
     1349 */
    9871350function wp_original_referer_field() {
    9881351        echo '<input type="hidden" name="_wp_original_http_referer" value="' . attribute_escape( stripslashes( $_SERVER['REQUEST_URI'] ) ) . '" />';
    9891352}
    9901353
    991 
     1354/**
     1355 * wp_get_referer() - {@internal Missing Short Description}}
     1356 *
     1357 * {@internal Missing Long Description}}
     1358 *
     1359 * @since 2.0.4
     1360 *
     1361 * @return unknown
     1362 */
    9921363function wp_get_referer() {
    9931364        if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
    9941365                return $_REQUEST['_wp_http_referer'];
     
    9971368        return false;
    9981369}
    9991370
    1000 
     1371/**
     1372 * wp_get_original_referer() - {@internal Missing Short Description}}
     1373 *
     1374 * {@internal Missing Long Description}}
     1375 *
     1376 * @since 2.0.4
     1377 *
     1378 * @return unknown
     1379 */
    10011380function wp_get_original_referer() {
    10021381        if ( !empty( $_REQUEST['_wp_original_http_referer'] ) )
    10031382                return $_REQUEST['_wp_original_http_referer'];
    10041383        return false;
    10051384}
    10061385
    1007 
     1386/**
     1387 * wp_mkdir_p() - {@internal Missing Short Description}}
     1388 *
     1389 * {@internal Missing Long Description}}
     1390 *
     1391 * @since 2.0.1
     1392 *
     1393 * @param unknown_type $target
     1394 * @return unknown
     1395 */
    10081396function wp_mkdir_p( $target ) {
    10091397        // from php.net/mkdir user contributed notes
    10101398        if ( file_exists( $target ) )
     
    10271415        return false;
    10281416}
    10291417
    1030 
    1031 // Returns an array containing the current upload directory's path and url, or an error message.
     1418/**
     1419 * wp_upload_dir() - Get an array containing the current upload directory's path and url, or an error message
     1420 *
     1421 * {@internal Missing Long Description}}
     1422 *
     1423 * @since 2.0.0
     1424 *
     1425 * @param unknown_type $time
     1426 * @return unknown
     1427 */
    10321428function wp_upload_dir( $time = NULL ) {
    10331429        $siteurl = get_option( 'siteurl' );
    10341430        //prepend ABSPATH to $dir and $siteurl to $url if they're not already there
     
    10641460        return apply_filters( 'upload_dir', $uploads );
    10651461}
    10661462
    1067 // return a filename that is sanitized and unique for the given directory
     1463/**
     1464 * wp_unique_filename() - Get a filename that is sanitized and unique for the given directory
     1465 *
     1466 * {@internal Missing Long Description}}
     1467 *
     1468 * @since 2.5
     1469 *
     1470 * @param unknown_type $dir
     1471 * @param unknown_type $filename
     1472 * @param unknown_type $unique_filename_callback
     1473 * @return unknown
     1474 */
    10681475function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) {
    1069        
     1476
    10701477        // separate the filename into a name and extension
    10711478        $info = pathinfo($filename);
    10721479        $ext = $info['extension'];
    10731480        $name = basename($filename, ".{$ext}");
    1074        
     1481
    10751482        // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
    10761483        if ( $unique_filename_callback && function_exists( $unique_filename_callback ) ) {
    10771484                $filename = $unique_filename_callback( $dir, $name );
     
    10931500                $filename = str_replace( $ext, '', $filename );
    10941501                $filename = sanitize_title_with_dashes( $filename ) . $ext;
    10951502        }
    1096        
     1503
    10971504        return $filename;
    10981505}
    10991506
     1507/**
     1508 * wp_upload_bits() - {@internal Missing Short Description}}
     1509 *
     1510 * {@internal Missing Long Description}}
     1511 *
     1512 * @since 2.0.0
     1513 *
     1514 * @param unknown_type $name
     1515 * @param unknown_type $deprecated
     1516 * @param unknown_type $bits
     1517 * @param unknown_type $time
     1518 * @return unknown
     1519 */
    11001520function wp_upload_bits( $name, $deprecated, $bits, $time = NULL ) {
    11011521        if ( empty( $name ) )
    11021522                return array( 'error' => __( "Empty filename" ) );
     
    11361556        return array( 'file' => $new_file, 'url' => $url, 'error' => false );
    11371557}
    11381558
    1139 
     1559/**
     1560 * wp_check_filetype() - {@internal Missing Short Description}}
     1561 *
     1562 * {@internal Missing Long Description}}
     1563 *
     1564 * @since 2.0.4
     1565 *
     1566 * @param unknown_type $filename
     1567 * @param unknown_type $mimes
     1568 * @return unknown
     1569 */
    11401570function wp_check_filetype( $filename, $mimes = null ) {
    11411571        // Accepted MIME types are set here as PCRE unless provided.
    11421572        $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array(
     
    12011631        return compact( 'ext', 'type' );
    12021632}
    12031633
     1634/**
     1635 * wp_explain_nonce() - {@internal Missing Short Description}}
     1636 *
     1637 * {@internal Missing Long Description}}
     1638 *
     1639 * @since 2.0.4
     1640 *
     1641 * @param unknown_type $action
     1642 * @return unknown
     1643 */
    12041644function wp_explain_nonce( $action ) {
    12051645        if ( $action !== -1 && preg_match( '/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches ) ) {
    12061646                $verb = $matches[1];
     
    12651705        return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __( 'Are you sure you want to do this?' ), $matches[4] );
    12661706}
    12671707
    1268 
     1708/**
     1709 * wp_nonce_ays() - {@internal Missing Short Description}}
     1710 *
     1711 * {@internal Missing Long Description}}
     1712 *
     1713 * @since 2.0.4
     1714 *
     1715 * @param unknown_type $action
     1716 */
    12691717function wp_nonce_ays( $action ) {
    12701718        global $pagenow;
    12711719
     
    12941742        wp_die( $html, $title );
    12951743}
    12961744
    1297 
     1745/**
     1746 * wp_die() - {@internal Missing Short Description}}
     1747 *
     1748 * {@internal Missing Long Description}}
     1749 *
     1750 * @since 2.0.4
     1751 *
     1752 * @param unknown_type $message
     1753 * @param unknown_type $title
     1754 */
    12981755function wp_die( $message, $title = '' ) {
    12991756        global $wp_locale;
    13001757
     
    13661823        die();
    13671824}
    13681825
    1369 
     1826/**
     1827 * _config_wp_home() - {@internal Missing Short Description}}
     1828 *
     1829 * {@internal Missing Long Description}}
     1830 *
     1831 * @since 2.2.0
     1832 *
     1833 * @param unknown_type $url
     1834 * @return unknown
     1835 */
    13701836function _config_wp_home( $url = '' ) {
    13711837        if ( defined( 'WP_HOME' ) )
    13721838                return WP_HOME;
    13731839        return $url;
    13741840}
    13751841
    1376 
     1842/**
     1843 * _config_wp_siteurl() - {@internal Missing Short Description}}
     1844 *
     1845 * {@internal Missing Long Description}}
     1846 *
     1847 * @since 2.2.0
     1848 *
     1849 * @param unknown_type $url
     1850 * @return unknown
     1851 */
    13771852function _config_wp_siteurl( $url = '' ) {
    13781853        if ( defined( 'WP_SITEURL' ) )
    13791854                return WP_SITEURL;
    13801855        return $url;
    13811856}
    13821857
    1383 
     1858/**
     1859 * _mce_set_direction() - {@internal Missing Short Description}}
     1860 *
     1861 * {@internal Missing Long Description}}
     1862 *
     1863 * @since 2.1.0
     1864 */
    13841865function _mce_set_direction() {
    13851866        global $wp_locale;
    13861867
     
    13901871        }
    13911872}
    13921873
    1393 
     1874/**
     1875 * _mce_load_rtl_plugin() - {@internal Missing Short Description}}
     1876 *
     1877 * {@internal Missing Long Description}}
     1878 *
     1879 * @since 2.1.0
     1880 *
     1881 * @param unknown_type $input
     1882 * @return unknown
     1883 */
    13941884function _mce_load_rtl_plugin( $input ) {
    13951885        global $wp_locale;
    13961886
     
    14001890        return $input;
    14011891}
    14021892
    1403 
     1893/**
     1894 * _mce_add_direction_buttons() - {@internal Missing Short Description}}
     1895 *
     1896 * {@internal Missing Long Description}}
     1897 *
     1898 * @since 2.1.0
     1899 *
     1900 * @param unknown_type $input
     1901 * @return unknown
     1902 */
    14041903function _mce_add_direction_buttons( $input ) {
    14051904        global $wp_locale;
    14061905
     
    14121911        return $input;
    14131912}
    14141913
    1415 
     1914/**
     1915 * smilies_init() - {@internal Missing Short Description}}
     1916 *
     1917 * {@internal Missing Long Description}}
     1918 *
     1919 * @since 2.2.0
     1920 *
     1921 */
    14161922function smilies_init() {
    14171923        global $wpsmiliestrans, $wp_smiliessearch, $wp_smiliesreplace;
    14181924
     
    14771983        }
    14781984}
    14791985
    1480 
     1986/**
     1987 * wp_parse_args() - {@internal Missing Short Description}}
     1988 *
     1989 * {@internal Missing Long Description}}
     1990 *
     1991 * @since 2.2.0
     1992 *
     1993 * @param unknown_type $args
     1994 * @param unknown_type $defaults
     1995 * @return unknown
     1996 */
    14811997function wp_parse_args( $args, $defaults = '' ) {
    14821998        if ( is_object( $args ) )
    14831999                $r = get_object_vars( $args );
     
    14912007        return $r;
    14922008}
    14932009
    1494 
     2010/**
     2011 * wp_maybe_load_widgets() - {@internal Missing Short Description}}
     2012 *
     2013 * {@internal Missing Long Description}}
     2014 *
     2015 * @since 2.2.0
     2016 * @uses add_action()
     2017 */
    14952018function wp_maybe_load_widgets() {
    14962019        if ( !function_exists( 'dynamic_sidebar' ) ) {
    14972020                require_once( ABSPATH . WPINC . '/widgets.php' );
     
    14992022        }
    15002023}
    15012024
    1502 
     2025/**
     2026 * wp_widgets_add_menu() - {@internal Missing Short Description}}
     2027 *
     2028 * {@internal Missing Long Description}}
     2029 *
     2030 * @since 2.2.0
     2031 * @uses $submenu
     2032 */
    15032033function wp_widgets_add_menu() {
    15042034        global $submenu;
    15052035        $submenu['themes.php'][7] = array( __( 'Widgets' ), 'switch_themes', 'widgets.php' );
    15062036        ksort( $submenu['themes.php'], SORT_NUMERIC );
    15072037}
    15082038
    1509 
    1510 // For PHP 5.2, make sure all output buffers are flushed
    1511 // before our singletons our destroyed.
     2039/**
     2040 * wp_ob_end_flush_all() - Flushes all of the output buffers
     2041 *
     2042 * For PHP 5.2.
     2043 *
     2044 * Make sure all output buffers are flushed before our singletons our destroyed.
     2045 *
     2046 * @since 2.2.0
     2047 */
    15122048function wp_ob_end_flush_all() {
    15132049        while ( @ob_end_flush() );
    15142050}
    15152051
    1516 
    1517 /*
    1518  * require_wp_db() - require_once the correct database class file.
     2052/**
     2053 * require_wp_db() - require_once the correct database class file
    15192054 *
    1520  * This function is used to load the database class file either at runtime or by wp-admin/setup-config.php
    1521  * We must globalise $wpdb to ensure that it is defined globally by the inline code in wp-db.php
     2055 * This function is used to load the database class file either at runtime
     2056 * or by wp-admin/setup-config.php We must globalise $wpdb to ensure that it
     2057 * is defined globally by the inline code in wp-db.php
    15222058 *
    1523  * @global $wpdb
     2059 * @since 2.5
     2060 * @uses $wpdb Does not actually use $wpdb
    15242061 */
    15252062function require_wp_db() {
    15262063        global $wpdb;
     
    15302067                require_once( ABSPATH . WPINC . '/wp-db.php' );
    15312068}
    15322069
     2070/**
     2071 * dead_db() - {@internal Missing Short Description}}
     2072 *
     2073 * {@internal Missing Long Description}}
     2074 *
     2075 * @since 2.5
     2076 * @uses $wpdb
     2077 */
    15332078function dead_db() {
    15342079        global $wpdb;
    15352080
     
    15642109}
    15652110
    15662111/**
    1567  * Converts input to an absolute integer
    1568  * @param mixed $maybeint data you wish to have convered to an absolute integer
    1569  * @return int an absolute integer
     2112 * absint() - Converts input to an absolute integer
     2113 *
     2114 * @since 2.5
     2115 *
     2116 * @param mixed $maybeint Data you wish to have convered to an absolute integer
     2117 * @return int An absolute integer
    15702118 */
    15712119function absint( $maybeint ) {
    15722120        return abs( intval( $maybeint ) );
    15732121}
    15742122
    15752123/**
    1576  * Determines if the blog can be accessed over SSL
     2124 * url_is_accessable_via_ssl() - Determines if the blog can be accessed over SSL
     2125 *
     2126 * {@internal Missing Long Description}}
     2127 *
     2128 * @since 2.5
     2129 *
    15772130 * @return bool whether of not SSL access is available
    15782131 */
    15792132function url_is_accessable_via_ssl($url)
    15802133{
    15812134        if (in_array('curl', get_loaded_extensions())) {
    1582                  $ssl = preg_replace( '/^http:\/\//', 'https://',  $url );
     2135                $ssl = preg_replace( '/^http:\/\//', 'https://',  $url );
    15832136
    1584                  $ch = curl_init();
    1585                  curl_setopt($ch, CURLOPT_URL, $ssl);
    1586                  curl_setopt($ch, CURLOPT_FAILONERROR, true);
    1587                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    1588                  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     2137                $ch = curl_init();
     2138                curl_setopt($ch, CURLOPT_URL, $ssl);
     2139                curl_setopt($ch, CURLOPT_FAILONERROR, true);
     2140                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     2141                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    15892142
    1590                  curl_exec($ch);
     2143                curl_exec($ch);
    15912144
    1592                  $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    1593                  curl_close ($ch);
     2145                $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     2146                curl_close ($ch);
    15942147
    1595                  if ($status == 200 || $status == 401) {
    1596                          return true;
    1597                  }
     2148                if ($status == 200 || $status == 401) {
     2149                        return true;
     2150                }
    15982151        }
    15992152        return false;
    16002153}
    16012154
     2155/**
     2156 * atom_service_url_filter() - {@internal Missing Short Description}}
     2157 *
     2158 * {@internal Missing Long Description}}
     2159 *
     2160 * @since 2.5
     2161 *
     2162 * @param string $url
     2163 * @return string
     2164 */
    16022165function atom_service_url_filter($url)
    16032166{
    16042167        if ( url_is_accessable_via_ssl($url) )
     
    16192182 *
    16202183 * @package WordPress
    16212184 * @package Debug
    1622  * @since 2.4
     2185 * @since 2.5
    16232186 * @access private
    16242187 *
    16252188 * @uses do_action() Calls 'deprecated_function_run' and passes the function name and what to use instead.
    16262189 * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
    16272190 *
    16282191 * @param string $function The function that was called
    1629  * @param string $version The version of WordPress that depreceated the function
     2192 * @param string $version The version of WordPress that deprecated the function
    16302193 * @param string $replacement Optional. The function that should have been called
    16312194 */
    16322195function _deprecated_function($function, $version, $replacement=null) {
     
    16542217 *
    16552218 * @package WordPress
    16562219 * @package Debug
    1657  * @since 2.4
     2220 * @since 2.5
    16582221 * @access private
    16592222 *
    16602223 * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead.
    16612224 * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
    16622225 *
    16632226 * @param string $file The file that was included
    1664  * @param string $version The version of WordPress that depreceated the function
     2227 * @param string $version The version of WordPress that deprecated the function
    16652228 * @param string $replacement Optional. The function that should have been called
    16662229 */
    16672230function _deprecated_file($file, $version, $replacement=null) {
     
    16762239                        trigger_error( printf( __("%s is <strong>deprecated</strong> since version %s with no alternative available."), $file, $version ) );
    16772240        }
    16782241}
    1679 ?>
     2242?>
     2243 No newline at end of file