Ticket #5639: 5639.r8605.2.6.diff

File 5639.r8605.2.6.diff, 26.3 KB (added by jacobsantos, 4 years ago)

Completes Functions.php inline documentation for 2.6 branch (r8605)

  • functions.php

     
    176176 * 
    177177 * @param int|string $bytes Number of bytes. Note max integer size for integers. 
    178178 * @param int $decimals Precision of number of decimal places. 
    179  * @return unknown 
     179 * @return bool|string False on failure. Number string on success. 
    180180 */ 
    181181function size_format( $bytes, $decimals = null ) { 
    182182        $quant = array( 
     
    195195        return false; 
    196196} 
    197197 
    198  
     198/** 
     199 * Get the week start and end from the datetime or date string from mysql. 
     200 * 
     201 * @since 0.71 
     202 * 
     203 * @param string $mysqlstring Date or datetime field type from mysql. 
     204 * @param int $start_of_week Optional. Start of the week as an integer. 
     205 * @return array Keys are 'start' and 'end'. 
     206 */ 
    199207function get_weekstartend( $mysqlstring, $start_of_week = '' ) { 
    200208        $my = substr( $mysqlstring, 0, 4 ); 
    201209        $mm = substr( $mysqlstring, 8, 2 ); 
     
    309317 * There is a second filter called 'option_$option' with the $option being 
    310318 * replaced with the option name. This gives the value as the only parameter. 
    311319 * 
     320 * If the option was serialized, when the option was added and, or updated, then 
     321 * it will be unserialized, when it is returned. 
     322 * 
    312323 * @since 1.5.0 
    313324 * @package WordPress 
    314325 * @subpackage Option 
     
    639650        return $data; 
    640651} 
    641652 
    642  
     653/** 
     654 * Strip HTML and put links at the bottom of stripped content. 
     655 * 
     656 * Searches for all of the links, strips them out of the content, and places 
     657 * them at the bottom of the content with numbers. 
     658 * 
     659 * @since 0.71 
     660 * 
     661 * @param string $content Content to get links 
     662 * @return string HTML stripped out of content with links at the bottom. 
     663 */ 
    643664function make_url_footnote( $content ) { 
    644665        preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches ); 
    645666        $j = 0; 
     
    659680        return $content; 
    660681} 
    661682 
    662  
     683/** 
     684 * Retrieve post title from XMLRPC XML. 
     685 * 
     686 * If the title element is not part of the XML, then the default post title from 
     687 * the $post_default_title will be used instead. 
     688 * 
     689 * @package WordPress 
     690 * @subpackage XMLRPC 
     691 * @since 0.71 
     692 * 
     693 * @global string $post_default_title Default XMLRPC post title. 
     694 * 
     695 * @param string $content XMLRPC XML Request content 
     696 * @return string Post title 
     697 */ 
    663698function xmlrpc_getposttitle( $content ) { 
    664699        global $post_default_title; 
    665700        if ( preg_match( '/<title>(.+?)<\/title>/is', $content, $matchtitle ) ) { 
     
    672707        return $post_title; 
    673708} 
    674709 
    675  
     710/** 
     711 * Retrieve the post category or categories from XMLRPC XML. 
     712 * 
     713 * If the category element is not found, then the default post category will be 
     714 * used. The return type then would be what $post_default_category. If the 
     715 * category is found, then it will always be an array. 
     716 * 
     717 * @package WordPress 
     718 * @subpackage XMLRPC 
     719 * @since 0.71 
     720 * 
     721 * @global string $post_default_category Default XMLRPC post category. 
     722 * 
     723 * @param string $content XMLRPC XML Request content 
     724 * @return string|array List of categories or category name. 
     725 */ 
    676726function xmlrpc_getpostcategory( $content ) { 
    677727        global $post_default_category; 
    678728        if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) { 
     
    684734        return $post_category; 
    685735} 
    686736 
    687  
     737/** 
     738 * XMLRPC XML content without title and category elements. 
     739 * 
     740 * @package WordPress 
     741 * @subpackage XMLRPC 
     742 * @since 0.71 
     743 * 
     744 * @param string $content XMLRPC XML Request content 
     745 * @return string XMLRPC XML Request content without title and category elements. 
     746 */ 
    688747function xmlrpc_removepostdata( $content ) { 
    689748        $content = preg_replace( '/<title>(.+?)<\/title>/si', '', $content ); 
    690749        $content = preg_replace( '/<category>(.+?)<\/category>/si', '', $content ); 
     
    701760 * @see fopen() for mode options. 
    702761 * @package WordPress 
    703762 * @subpackage Debug 
    704  * @since unknown 
     763 * @since 0.71 
    705764 * @uses $debug Used for whether debugging is enabled. 
    706765 * 
    707766 * @param string $filename File path to debug file. 
     
    726785 * 
    727786 * @package WordPress 
    728787 * @subpackage Debug 
    729  * @since unknown 
     788 * @since 0.71 
    730789 * @uses $debug Used for whether debugging is enabled. 
    731790 * 
    732791 * @param resource $fp File handle for debugging file. 
     
    746805 * 
    747806 * @package WordPress 
    748807 * @subpackage Debug 
    749  * @since unknown 
     808 * @since 0.71 
    750809 * @uses $debug Used for whether debugging is enabled. 
    751810 * 
    752811 * @param resource $fp Debug File handle. 
     
    903962/** 
    904963 * Whether today is a new day. 
    905964 * 
    906  * {@internal Need to find out how this function is used.}} 
    907  * 
    908965 * @since 0.71 
    909966 * @uses $day Today 
    910967 * @uses $previousday Previous day 
     
    929986 * @link http://us2.php.net/manual/en/function.http-build-query.php more on what 
    930987 *              http_build_query() does. 
    931988 * 
    932  * @since unknown 
     989 * @since 2.3.0 
    933990 * 
    934991 * @param array $data URL-encode key/value pairs. 
    935992 * @return string URL encoded string 
     
    9531010 * @param mixed $param1 Either newkey or an associative_array 
    9541011 * @param mixed $param2 Either newvalue or oldquery or uri 
    9551012 * @param mixed $param3 Optional. Old query or uri 
    956  * @return unknown 
     1013 * @return string New URL query string. 
    9571014 */ 
    9581015function add_query_arg() { 
    9591016        $ret = ''; 
     
    10271084 * 
    10281085 * @param string|array $key Query key or keys to remove. 
    10291086 * @param bool $query When false uses the $_SERVER value. 
    1030  * @return unknown 
     1087 * @return string New URL query string. 
    10311088 */ 
    10321089function remove_query_arg( $key, $query=false ) { 
    10331090        if ( is_array( $key ) ) { // removing multiple keys 
     
    10651122 * Tries to retrieve the HTTP content with fopen first and then using cURL, if 
    10661123 * fopen can't be used. 
    10671124 * 
    1068  * @since unknown 
     1125 * @since 1.5.1 
    10691126 * 
    10701127 * @param string $uri URI/URL of web page to retrieve. 
    10711128 * @return string HTTP content. 
     
    11841241/** 
    11851242 * Set HTTP status header. 
    11861243 * 
    1187  * @since unknown 
     1244 * @since 2.0.0 
    11881245 * @uses apply_filters() Calls 'status_header' on status header string, HTTP 
    11891246 *              HTTP code, HTTP code description, and protocol string as separate 
    11901247 *              parameters. 
     
    12631320        return ( strtolower( $yn ) == 'y' ); 
    12641321} 
    12651322 
    1266  
     1323/** 
     1324 * Loads the feed template from the use of an action hook. 
     1325 * 
     1326 * If the feed action does not have a hook, then the function will die with a 
     1327 * message telling the visitor that the feed is not valid. 
     1328 * 
     1329 * It is better to only have one hook for each feed. 
     1330 * 
     1331 * @since 2.1.0 
     1332 * @uses $wp_query Used to tell if the use a comment feed. 
     1333 * @uses do_action() Calls 'do_feed_$feed' hook, if a hook exists for the feed. 
     1334 */ 
    12671335function do_feed() { 
    12681336        global $wp_query; 
    12691337 
     
    13531421        } 
    13541422} 
    13551423 
    1356  
     1424/** 
     1425 * Test whether blog is already installed. 
     1426 * 
     1427 * The cache will be checked first. If you have a cache plugin, which saves the 
     1428 * cache values, then this will work. If you use the default WordPress cache, 
     1429 * and the database goes away, then you might have problems. 
     1430 * 
     1431 * Checks for the option siteurl for whether WordPress is installed. 
     1432 * 
     1433 * @since 2.1.0 
     1434 * @uses $wpdb 
     1435 * 
     1436 * @return bool Whether blog is already installed. 
     1437 */ 
    13571438function is_blog_installed() { 
    13581439        global $wpdb; 
    13591440 
     
    13711452        return $installed; 
    13721453} 
    13731454 
    1374  
     1455/** 
     1456 * Retrieve URL with nonce added to URL query. 
     1457 * 
     1458 * @package WordPress 
     1459 * @subpackage Security 
     1460 * @since 2.0.4 
     1461 * 
     1462 * @param string $actionurl URL to add nonce action 
     1463 * @param string $action Optional. Nonce action name 
     1464 * @return string URL with nonce action added. 
     1465 */ 
    13751466function wp_nonce_url( $actionurl, $action = -1 ) { 
    13761467        $actionurl = str_replace( '&amp;', '&', $actionurl ); 
    13771468        return wp_specialchars( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $actionurl ) ); 
    13781469} 
    13791470 
    1380  
     1471/** 
     1472 * Retrieve or display nonce hidden field for forms. 
     1473 * 
     1474 * The nonce field is used to validate that the contents of the form came from 
     1475 * the location on the current site and not somewhere else. The nonce does not 
     1476 * offer absolute protection, but should protect against most cases. It is very 
     1477 * important to use nonce field in forms. 
     1478 * 
     1479 * If you set $echo to true and set $referer to true, then you will need to 
     1480 * retrieve the {@link wp_referer_field() wp referer field}. If you have the 
     1481 * $referer set to true and are echoing the nonce field, it will also echo the 
     1482 * referer field. 
     1483 * 
     1484 * The $action and $name are optional, but if you want to have better security, 
     1485 * it is strongly suggested to set those two parameters. It is easier to just 
     1486 * call the function without any parameters, because validation of the nonce 
     1487 * doesn't require any parameters, but since crackers know what the default is 
     1488 * it won't be difficult for them to find a way around your nonce and cause 
     1489 * damage. 
     1490 * 
     1491 * The input name will be whatever $name value you gave. The input value will be 
     1492 * the nonce creation value. 
     1493 * 
     1494 * @package WordPress 
     1495 * @subpackage Security 
     1496 * @since 2.0.4 
     1497 * 
     1498 * @param string $action Optional. Action name. 
     1499 * @param string $name Optional. Nonce name. 
     1500 * @param bool $referer Optional, default true. Whether to set the referer field for validation. 
     1501 * @param bool $echo Optional, default true. Whether to display or return hidden form field. 
     1502 * @return string Nonce field. 
     1503 */ 
    13811504function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) { 
    13821505        $name = attribute_escape( $name ); 
    13831506        $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />'; 
     
    13901513        return $nonce_field; 
    13911514} 
    13921515 
    1393  
     1516/** 
     1517 * Retrieve or display referer hidden field for forms. 
     1518 * 
     1519 * The referer link is the current Request URI from the server super global. The 
     1520 * input name is '_wp_http_referer', in case you wanted to check manually. 
     1521 * 
     1522 * @package WordPress 
     1523 * @subpackage Security 
     1524 * @since 2.0.4 
     1525 * 
     1526 * @param bool $echo Whether to echo or return the referer field. 
     1527 * @return string Referer field. 
     1528 */ 
    13941529function wp_referer_field( $echo = true) { 
    13951530        $ref = attribute_escape( $_SERVER['REQUEST_URI'] ); 
    13961531        $referer_field = '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />'; 
     
    14001535        return $referer_field; 
    14011536} 
    14021537 
     1538/** 
     1539 * Retrieve or display original referer hidden field for forms. 
     1540 * 
     1541 * The input name is '_wp_original_http_referer' and will be either the same 
     1542 * value of {@link wp_referer_field()}, if that was posted already or it will 
     1543 * be the current page, if it doesn't exist. 
     1544 * 
     1545 * @package WordPress 
     1546 * @subpackage Security 
     1547 * @since 2.0.4 
     1548 * 
     1549 * @param bool $echo Whether to echo the original http referer 
     1550 * @param string $jump_back_to Optional, default is 'current'. Can be 'previous' or page you want to jump back to. 
     1551 * @return string Original referer field. 
     1552 */ 
    14031553function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) { 
    14041554        $jump_back_to = ( 'previous' == $jump_back_to ) ? wp_get_referer() : $_SERVER['REQUEST_URI']; 
    14051555        $ref = ( wp_get_original_referer() ) ? wp_get_original_referer() : $jump_back_to; 
     
    14091559        return $orig_referer_field; 
    14101560} 
    14111561 
    1412  
     1562/** 
     1563 * Retrieve referer from '_wp_http_referer', HTTP referer, or current page respectively. 
     1564 * 
     1565 * @package WordPress 
     1566 * @subpackage Security 
     1567 * @since 2.0.4 
     1568 * 
     1569 * @return string|bool False on failure. Referer URL on success. 
     1570 */ 
    14131571function wp_get_referer() { 
    14141572        if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) 
    14151573                $ref = $_REQUEST['_wp_http_referer']; 
     
    14211579        return false; 
    14221580} 
    14231581 
    1424  
     1582/** 
     1583 * Retrieve original referer that was posted, if it exists. 
     1584 * 
     1585 * @package WordPress 
     1586 * @subpackage Security 
     1587 * @since 2.0.4 
     1588 * 
     1589 * @return string|bool False if no original referer or original referer if set. 
     1590 */ 
    14251591function wp_get_original_referer() { 
    14261592        if ( !empty( $_REQUEST['_wp_original_http_referer'] ) ) 
    14271593                return $_REQUEST['_wp_original_http_referer']; 
    14281594        return false; 
    14291595} 
    14301596 
    1431  
     1597/** 
     1598 * Recursive directory creation based on full path. 
     1599 * 
     1600 * Will attempt to set permissions on folders. 
     1601 * 
     1602 * @since 2.0.1 
     1603 * 
     1604 * @param string $target Full path to attempt to create. 
     1605 * @return bool Whether the path was created or not. True if path already exists. 
     1606 */ 
    14321607function wp_mkdir_p( $target ) { 
    14331608        // from php.net/mkdir user contributed notes 
    14341609        $target = str_replace( '//', '/', $target ); 
     
    14521627        return false; 
    14531628} 
    14541629 
    1455 // Test if a give filesystem path is absolute ('/foo/bar', 'c:\windows') 
     1630/** 
     1631 * Test if a give filesystem path is absolute ('/foo/bar', 'c:\windows'). 
     1632 * 
     1633 * @since 2.5.0 
     1634 * 
     1635 * @param string $path File path 
     1636 * @return bool True if path is absolute, false is not absolute. 
     1637 */ 
    14561638function path_is_absolute( $path ) { 
    14571639        // this is definitive if true but fails if $path does not exist or contains a symbolic link 
    14581640        if ( realpath($path) == $path ) 
     
    14691651        return (bool) preg_match('#^[/\\\\]#', $path); 
    14701652} 
    14711653 
    1472 // Join two filesystem paths together (e.g. 'give me $path relative to $base') 
     1654/** 
     1655 * Join two filesystem paths together (e.g. 'give me $path relative to $base'). 
     1656 * 
     1657 * If the $path is absolute, then it the full path is returned. 
     1658 * 
     1659 * @since 2.5.0 
     1660 * 
     1661 * @param string $base 
     1662 * @param string $path 
     1663 * @return string The path with the base or absolute path. 
     1664 */ 
    14731665function path_join( $base, $path ) { 
    14741666        if ( path_is_absolute($path) ) 
    14751667                return $path; 
     
    14771669        return rtrim($base, '/') . '/' . ltrim($path, '/'); 
    14781670} 
    14791671 
    1480 // Returns an array containing the current upload directory's path and url, or an error message. 
     1672/** 
     1673 * Get an array containing the current upload directory's path and url. 
     1674 * 
     1675 * Checks the 'upload_path' option, which should be from the web root folder, 
     1676 * and if it isn't empty it will be used. If it is empty, then the path will be 
     1677 * 'WP_CONTENT_DIR/uploads'. If the 'UPLOADS' constant is defined, then it will 
     1678 * override the 'upload_path' option and 'WP_CONTENT_DIR/uploads' path. 
     1679 * 
     1680 * The upload URL path is set either by the 'upload_url_path' option or by using 
     1681 * the 'WP_CONTENT_URL' constant and appending '/uploads' to the path. 
     1682 * 
     1683 * If the 'uploads_use_yearmonth_folders' is set to true (checkbox if checked in 
     1684 * the administration settings panel), then the time will be used. The format 
     1685 * will be year first and then month. 
     1686 * 
     1687 * If the path couldn't be created, then an error will be returned with the key 
     1688 * 'error' containing the error message. The error suggests that the parent 
     1689 * directory is not writable by the server. 
     1690 * 
     1691 * On success, the returned array will have many indices: 
     1692 * 'path' - base directory and sub directory or full path to upload directory. 
     1693 * 'url' - base url and sub directory or absolute URL to upload directory. 
     1694 * 'subdir' - sub directory if uploads use year/month folders option is on. 
     1695 * 'basedir' - path without subdir. 
     1696 * 'baseurl' - URL path without subdir. 
     1697 * 'error' - set to false. 
     1698 * 
     1699 * @since 2.0.0 
     1700 * @uses apply_filters() Calls 'upload_dir' on returned array. 
     1701 * 
     1702 * @param string $time Optional. Time formatted in 'yyyy/mm'. 
     1703 * @return array See above for description. 
     1704 */ 
    14811705function wp_upload_dir( $time = NULL ) { 
    14821706        $siteurl = get_option( 'siteurl' ); 
    14831707        $upload_path = get_option( 'upload_path' ); 
     
    15291753        return apply_filters( 'upload_dir', $uploads ); 
    15301754} 
    15311755 
    1532 // return a filename that is sanitized and unique for the given directory 
     1756/** 
     1757 * Get a filename that is sanitized and unique for the given directory. 
     1758 * 
     1759 * If the filename is not unique, then a number will be added to the filename 
     1760 * before the extension, and will continue adding numbers until the filename is 
     1761 * unique. 
     1762 * 
     1763 * The callback must accept two parameters, the first one is the directory and 
     1764 * the second is the filename. The callback must be a function. 
     1765 * 
     1766 * @since 2.5 
     1767 * 
     1768 * @param string $dir 
     1769 * @param string $filename 
     1770 * @param string $unique_filename_callback Function name, must be a function. 
     1771 * @return string New filename, if given wasn't unique. 
     1772 */ 
    15331773function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) { 
    15341774        $filename = strtolower( $filename ); 
    15351775        // separate the filename into a name and extension 
     
    15671807        return $filename; 
    15681808} 
    15691809 
     1810/** 
     1811 * Create a file in the upload folder with given content. 
     1812 * 
     1813 * If there is an error, then the key 'error' will exist with the error message. 
     1814 * If success, then the key 'file' will have the unique file path, the 'url' key 
     1815 * will have the link to the new file. and the 'error' key will be set to false. 
     1816 * 
     1817 * This function will not move an uploaded file to the upload folder. It will 
     1818 * create a new file with the content in $bits parameter. If you move the upload 
     1819 * file, read the content of the uploaded file, and then you can give the 
     1820 * filename and content to this function, which will add it to the upload 
     1821 * folder. 
     1822 * 
     1823 * The permissions will be set on the new file automatically by this function. 
     1824 * 
     1825 * @since 2.0.0 
     1826 * 
     1827 * @param string $name 
     1828 * @param null $deprecated Not used. Set to null. 
     1829 * @param mixed $bits File content 
     1830 * @param string $time Optional. Time formatted in 'yyyy/mm'. 
     1831 * @return array 
     1832 */ 
    15701833function wp_upload_bits( $name, $deprecated, $bits, $time = NULL ) { 
    15711834        if ( empty( $name ) ) 
    15721835                return array( 'error' => __( "Empty filename" ) ); 
     
    16061869        return array( 'file' => $new_file, 'url' => $url, 'error' => false ); 
    16071870} 
    16081871 
     1872/** 
     1873 * Retrieve the file type based on the extension name. 
     1874 * 
     1875 * @package WordPress 
     1876 * @since 2.5.0 
     1877 * @uses apply_filters() Calls 'ext2type' hook on default supported types. 
     1878 * 
     1879 * @param string $ext The extension to search. 
     1880 * @return string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found. 
     1881 */ 
    16091882function wp_ext2type( $ext ) { 
    16101883        $ext2type = apply_filters('ext2type', array( 
    16111884                'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'), 
     
    16221895                        return $type; 
    16231896} 
    16241897 
     1898/** 
     1899 * Retrieve the file type from the file name. 
     1900 * 
     1901 * You can optionally define the mime array, if needed. 
     1902 * 
     1903 * @since 2.0.4 
     1904 * 
     1905 * @param string $filename File name or path. 
     1906 * @param array $mimes Optional. Key is the file extension with value as the mime type. 
     1907 * @return array Values with extension first and mime type. 
     1908 */ 
    16251909function wp_check_filetype( $filename, $mimes = null ) { 
    16261910        // Accepted MIME types are set here as PCRE unless provided. 
    16271911        $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array( 
     
    16861970        return compact( 'ext', 'type' ); 
    16871971} 
    16881972 
     1973/** 
     1974 * Retrieve nonce action "Are you sure" message. 
     1975 * 
     1976 * The action is split by verb and noun. The action format is as follows: 
     1977 * verb-action_extra. The verb is before the first dash and has the format of 
     1978 * letters and no spaces and numbers. The noun is after the dash and before the 
     1979 * underscore, if an underscore exists. The noun is also only letters. 
     1980 * 
     1981 * The filter will be called for any action, which is not defined by WordPress. 
     1982 * You may use the filter for your plugin to explain nonce actions to the user, 
     1983 * when they get the "Are you sure?" message. The filter is in the format of 
     1984 * 'explain_nonce_$verb-$noun' with the $verb replaced by the found verb and the 
     1985 * $noun replaced by the found noun. The two parameters that are given to the 
     1986 * hook are the localized "Are you sure you want to do this?" message with the 
     1987 * extra text (the text after the underscore). 
     1988 * 
     1989 * @package WordPress 
     1990 * @subpackage Security 
     1991 * @since 2.0.4 
     1992 * 
     1993 * @param string $action Nonce action. 
     1994 * @return string Are you sure message. 
     1995 */ 
    16891996function wp_explain_nonce( $action ) { 
    16901997        if ( $action !== -1 && preg_match( '/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches ) ) { 
    16911998                $verb = $matches[1]; 
     
    17512058        return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __( 'Are you sure you want to do this?' ), $matches[4] ); 
    17522059} 
    17532060 
    1754  
     2061/** 
     2062 * Display "Are You Sure" message to confirm the action being taken. 
     2063 * 
     2064 * If the action has the nonce explain message, then it will be displayed along 
     2065 * with the "Are you sure?" message. 
     2066 * 
     2067 * @package WordPress 
     2068 * @subpackage Security 
     2069 * @since 2.0.4 
     2070 * 
     2071 * @param string $action The nonce action. 
     2072 */ 
    17552073function wp_nonce_ays( $action ) { 
    17562074        $title = __( 'WordPress Failure Notice' ); 
    17572075        $html = wp_specialchars( wp_explain_nonce( $action ) ) . '</p>'; 
     
    17602078        wp_die( $html, $title); 
    17612079} 
    17622080 
    1763  
     2081/** 
     2082 * Kill WordPress execution and display HTML message with error message. 
     2083 * 
     2084 * Call this function complements the die() PHP function. The difference is that 
     2085 * HTML will be displayed to the user. It is recommended to use this function 
     2086 * only, when the execution should not continue any further. It is not 
     2087 * recommended to call this function very often and try to handle as many errors 
     2088 * as possible siliently. 
     2089 * 
     2090 * @since 2.0.4 
     2091 * 
     2092 * @param string $message Error message. 
     2093 * @param string $title Error title. 
     2094 */ 
    17642095function wp_die( $message, $title = '' ) { 
    17652096        global $wp_locale; 
    17662097 
     
    18302161        die(); 
    18312162} 
    18322163 
    1833  
     2164/** 
     2165 * Retrieve the WordPress home page URL. 
     2166 * 
     2167 * If the constant named 'WP_HOME' exists, then it willl be used and returned by 
     2168 * the function. This can be used to counter the redirection on your local 
     2169 * development environment. 
     2170 * 
     2171 * @access private 
     2172 * @package WordPress 
     2173 * @since 2.2.0 
     2174 * 
     2175 * @param string $url URL for the home location 
     2176 * @return string Homepage location. 
     2177 */ 
    18342178function _config_wp_home( $url = '' ) { 
    18352179        if ( defined( 'WP_HOME' ) ) 
    18362180                return WP_HOME; 
    18372181        return $url; 
    18382182} 
    18392183 
    1840  
     2184/** 
     2185 * Retrieve the WordPress site URL. 
     2186 * 
     2187 * If the constant named 'WP_SITEURL' is defined, then the value in that 
     2188 * constant will always be returned. This can be used for debugging a site on 
     2189 * your localhost while not having to change the database to your URL. 
     2190 * 
     2191 * @access private 
     2192 * @package WordPress 
     2193 * @since 2.2.0 
     2194 * 
     2195 * @param string $url URL to set the WordPress site location. 
     2196 * @return string The WordPress Site URL 
     2197 */ 
    18412198function _config_wp_siteurl( $url = '' ) { 
    18422199        if ( defined( 'WP_SITEURL' ) ) 
    18432200                return WP_SITEURL; 
    18442201        return $url; 
    18452202} 
    18462203 
    1847  
     2204/** 
     2205 * Set the localized direction for MCE plugin. 
     2206 * 
     2207 * Will only set the direction to 'rtl', if the WordPress locale has the text 
     2208 * direction set to 'rtl'. 
     2209 * 
     2210 * Fills in the 'directionality', 'plugins', and 'theme_advanced_button1' array 
     2211 * keys. These keys are then returned in the $input array. 
     2212 * 
     2213 * @access private 
     2214 * @package WordPress 
     2215 * @subpackage MCE 
     2216 * @since 2.1.0 
     2217 * 
     2218 * @param array $input MCE plugin array. 
     2219 * @return array Direction set for 'rtl', if needed by locale. 
     2220 */ 
    18482221function _mce_set_direction( $input ) { 
    18492222        global $wp_locale; 
    18502223 
     
    18572230        return $input; 
    18582231} 
    18592232 
    1860  
     2233/** 
     2234 * Convert smiley code to the icon graphic file equivalent. 
     2235 * 
     2236 * You can turn off smilies, by going to the write setting screen and unchecking 
     2237 * the box, or by setting 'use_smilies' option to false or removing the option. 
     2238 * 
     2239 * Plugins may override the default smiley list by setting the $wpsmiliestrans 
     2240 * to an array, with the key the code the blogger types in and the value the 
     2241 * image file. 
     2242 * 
     2243 * The $wp_smiliessearch global is for the regular expression array and is 
     2244 * set each time the function is called. The $wp_smiliesreplace is the full 
     2245 * replacement. Supposely, the $wp_smiliessearch array is looped over using 
     2246 * preg_replace() or just setting the array of $wp_smiliessearch along with the 
     2247 * array of $wp_smiliesreplace in the search and replace parameters of 
     2248 * preg_replace(), which would be faster and less overhead. Either way, both are 
     2249 * used with preg_replace() and can be defined after the function is called. 
     2250 * 
     2251 * The full list of smilies can be found in the function and won't be listed in 
     2252 * the description. Probably should create a Codex page for it, so that it is 
     2253 * available. 
     2254 * 
     2255 * @global array $wpsmiliestrans 
     2256 * @global array $wp_smiliesreplace 
     2257 * @global array $wp_smiliessearch 
     2258 * @since 2.2.0 
     2259 */ 
    18612260function smilies_init() { 
    18622261        global $wpsmiliestrans, $wp_smiliessearch, $wp_smiliesreplace; 
    18632262 
     
    21222521 * The current behavior is to trigger an user error if WP_DEBUG is defined and 
    21232522 * is true. 
    21242523 * 
    2125  * This function is to be used in every function in depreceated.php 
     2524 * This function is to be used in every function in deprecated.php 
    21262525 * 
    21272526 * @package WordPress 
    21282527 * @package Debug 
     
    21332532 * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error. 
    21342533 * 
    21352534 * @param string $function The function that was called 
    2136  * @param string $version The version of WordPress that depreceated the function 
     2535 * @param string $version The version of WordPress that deprecated the function 
    21372536 * @param string $replacement Optional. The function that should have been called 
    21382537 */ 
    21392538function _deprecated_function($function, $version, $replacement=null) { 
     
    21592558 * The current behavior is to trigger an user error if WP_DEBUG is defined and 
    21602559 * is true. 
    21612560 * 
    2162  * This function is to be used in every file that is depreceated 
     2561 * This function is to be used in every file that is deprecated 
    21632562 * 
    21642563 * @package WordPress 
    21652564 * @package Debug 
    2166  * @since 2.5 
     2565 * @since 2.5.0 
    21672566 * @access private 
    21682567 * 
    21692568 * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead. 
     
    21892588/** 
    21902589 * Is the server running earlier than 1.5.0 version of lighttpd 
    21912590 * 
    2192  * @since unknown 
     2591 * @since 2.5.0 
    21932592 * 
    21942593 * @return bool Whether the server is running lighttpd < 1.5.0 
    21952594 */ 
     
    22022601/** 
    22032602 * Does the specified module exist in the apache config? 
    22042603 * 
    2205  * @since unknown 
     2604 * @since 2.5.0 
    22062605 * 
    22072606 * @param string $mod e.g. mod_rewrite 
    22082607 * @param bool $default The default return value if the module is not found 
     
    22362635 * character. A return value of '3' means that the file is not in the allowed 
    22372636 * files list. 
    22382637 * 
    2239  * @since 2.6 
     2638 * @since 1.2.0 
    22402639 * 
    22412640 * @param string $file File path. 
    22422641 * @param array $allowed_files List of allowed files. 
     
    22612660/** 
    22622661 * Determine if SSL is used. 
    22632662 * 
    2264  * @since 2.6 
     2663 * @since 2.6.0 
    22652664 * 
    22662665 * @return bool True if SSL, false if not used. 
    22672666 */ 
     
    22722671/** 
    22732672 * Whether SSL login should be forced. 
    22742673 * 
    2275  * @since 2.6 
     2674 * @since 2.6.0 
    22762675 * 
    22772676 * @param string|bool $force Optional. 
    22782677 * @return bool True if forced, false if not forced. 
     
    22922691/** 
    22932692 * Whether to force SSL used for the Administration Panels. 
    22942693 * 
    2295  * @since 2.6 
     2694 * @since 2.6.0 
    22962695 * 
    22972696 * @param string|bool $force 
    22982697 * @return bool True if forced, false if not forced. 
     
    23152714 * Will remove wp-admin links to retrieve only return URLs not in the wp-admin 
    23162715 * directory. 
    23172716 * 
    2318  * @since 2.6 
     2717 * @since 2.6.0 
    23192718 * 
    23202719 * @return string 
    23212720 */