Ticket #5639: 5639.r8605.2.6.diff
| File 5639.r8605.2.6.diff, 26.3 KB (added by jacobsantos, 4 years ago) |
|---|
-
functions.php
176 176 * 177 177 * @param int|string $bytes Number of bytes. Note max integer size for integers. 178 178 * @param int $decimals Precision of number of decimal places. 179 * @return unknown179 * @return bool|string False on failure. Number string on success. 180 180 */ 181 181 function size_format( $bytes, $decimals = null ) { 182 182 $quant = array( … … 195 195 return false; 196 196 } 197 197 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 */ 199 207 function get_weekstartend( $mysqlstring, $start_of_week = '' ) { 200 208 $my = substr( $mysqlstring, 0, 4 ); 201 209 $mm = substr( $mysqlstring, 8, 2 ); … … 309 317 * There is a second filter called 'option_$option' with the $option being 310 318 * replaced with the option name. This gives the value as the only parameter. 311 319 * 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 * 312 323 * @since 1.5.0 313 324 * @package WordPress 314 325 * @subpackage Option … … 639 650 return $data; 640 651 } 641 652 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 */ 643 664 function make_url_footnote( $content ) { 644 665 preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches ); 645 666 $j = 0; … … 659 680 return $content; 660 681 } 661 682 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 */ 663 698 function xmlrpc_getposttitle( $content ) { 664 699 global $post_default_title; 665 700 if ( preg_match( '/<title>(.+?)<\/title>/is', $content, $matchtitle ) ) { … … 672 707 return $post_title; 673 708 } 674 709 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 */ 676 726 function xmlrpc_getpostcategory( $content ) { 677 727 global $post_default_category; 678 728 if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) { … … 684 734 return $post_category; 685 735 } 686 736 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 */ 688 747 function xmlrpc_removepostdata( $content ) { 689 748 $content = preg_replace( '/<title>(.+?)<\/title>/si', '', $content ); 690 749 $content = preg_replace( '/<category>(.+?)<\/category>/si', '', $content ); … … 701 760 * @see fopen() for mode options. 702 761 * @package WordPress 703 762 * @subpackage Debug 704 * @since unknown763 * @since 0.71 705 764 * @uses $debug Used for whether debugging is enabled. 706 765 * 707 766 * @param string $filename File path to debug file. … … 726 785 * 727 786 * @package WordPress 728 787 * @subpackage Debug 729 * @since unknown788 * @since 0.71 730 789 * @uses $debug Used for whether debugging is enabled. 731 790 * 732 791 * @param resource $fp File handle for debugging file. … … 746 805 * 747 806 * @package WordPress 748 807 * @subpackage Debug 749 * @since unknown808 * @since 0.71 750 809 * @uses $debug Used for whether debugging is enabled. 751 810 * 752 811 * @param resource $fp Debug File handle. … … 903 962 /** 904 963 * Whether today is a new day. 905 964 * 906 * {@internal Need to find out how this function is used.}}907 *908 965 * @since 0.71 909 966 * @uses $day Today 910 967 * @uses $previousday Previous day … … 929 986 * @link http://us2.php.net/manual/en/function.http-build-query.php more on what 930 987 * http_build_query() does. 931 988 * 932 * @since unknown989 * @since 2.3.0 933 990 * 934 991 * @param array $data URL-encode key/value pairs. 935 992 * @return string URL encoded string … … 953 1010 * @param mixed $param1 Either newkey or an associative_array 954 1011 * @param mixed $param2 Either newvalue or oldquery or uri 955 1012 * @param mixed $param3 Optional. Old query or uri 956 * @return unknown1013 * @return string New URL query string. 957 1014 */ 958 1015 function add_query_arg() { 959 1016 $ret = ''; … … 1027 1084 * 1028 1085 * @param string|array $key Query key or keys to remove. 1029 1086 * @param bool $query When false uses the $_SERVER value. 1030 * @return unknown1087 * @return string New URL query string. 1031 1088 */ 1032 1089 function remove_query_arg( $key, $query=false ) { 1033 1090 if ( is_array( $key ) ) { // removing multiple keys … … 1065 1122 * Tries to retrieve the HTTP content with fopen first and then using cURL, if 1066 1123 * fopen can't be used. 1067 1124 * 1068 * @since unknown1125 * @since 1.5.1 1069 1126 * 1070 1127 * @param string $uri URI/URL of web page to retrieve. 1071 1128 * @return string HTTP content. … … 1184 1241 /** 1185 1242 * Set HTTP status header. 1186 1243 * 1187 * @since unknown1244 * @since 2.0.0 1188 1245 * @uses apply_filters() Calls 'status_header' on status header string, HTTP 1189 1246 * HTTP code, HTTP code description, and protocol string as separate 1190 1247 * parameters. … … 1263 1320 return ( strtolower( $yn ) == 'y' ); 1264 1321 } 1265 1322 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 */ 1267 1335 function do_feed() { 1268 1336 global $wp_query; 1269 1337 … … 1353 1421 } 1354 1422 } 1355 1423 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 */ 1357 1438 function is_blog_installed() { 1358 1439 global $wpdb; 1359 1440 … … 1371 1452 return $installed; 1372 1453 } 1373 1454 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 */ 1375 1466 function wp_nonce_url( $actionurl, $action = -1 ) { 1376 1467 $actionurl = str_replace( '&', '&', $actionurl ); 1377 1468 return wp_specialchars( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $actionurl ) ); 1378 1469 } 1379 1470 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 */ 1381 1504 function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true ) { 1382 1505 $name = attribute_escape( $name ); 1383 1506 $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />'; … … 1390 1513 return $nonce_field; 1391 1514 } 1392 1515 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 */ 1394 1529 function wp_referer_field( $echo = true) { 1395 1530 $ref = attribute_escape( $_SERVER['REQUEST_URI'] ); 1396 1531 $referer_field = '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />'; … … 1400 1535 return $referer_field; 1401 1536 } 1402 1537 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 */ 1403 1553 function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) { 1404 1554 $jump_back_to = ( 'previous' == $jump_back_to ) ? wp_get_referer() : $_SERVER['REQUEST_URI']; 1405 1555 $ref = ( wp_get_original_referer() ) ? wp_get_original_referer() : $jump_back_to; … … 1409 1559 return $orig_referer_field; 1410 1560 } 1411 1561 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 */ 1413 1571 function wp_get_referer() { 1414 1572 if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) 1415 1573 $ref = $_REQUEST['_wp_http_referer']; … … 1421 1579 return false; 1422 1580 } 1423 1581 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 */ 1425 1591 function wp_get_original_referer() { 1426 1592 if ( !empty( $_REQUEST['_wp_original_http_referer'] ) ) 1427 1593 return $_REQUEST['_wp_original_http_referer']; 1428 1594 return false; 1429 1595 } 1430 1596 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 */ 1432 1607 function wp_mkdir_p( $target ) { 1433 1608 // from php.net/mkdir user contributed notes 1434 1609 $target = str_replace( '//', '/', $target ); … … 1452 1627 return false; 1453 1628 } 1454 1629 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 */ 1456 1638 function path_is_absolute( $path ) { 1457 1639 // this is definitive if true but fails if $path does not exist or contains a symbolic link 1458 1640 if ( realpath($path) == $path ) … … 1469 1651 return (bool) preg_match('#^[/\\\\]#', $path); 1470 1652 } 1471 1653 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 */ 1473 1665 function path_join( $base, $path ) { 1474 1666 if ( path_is_absolute($path) ) 1475 1667 return $path; … … 1477 1669 return rtrim($base, '/') . '/' . ltrim($path, '/'); 1478 1670 } 1479 1671 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 */ 1481 1705 function wp_upload_dir( $time = NULL ) { 1482 1706 $siteurl = get_option( 'siteurl' ); 1483 1707 $upload_path = get_option( 'upload_path' ); … … 1529 1753 return apply_filters( 'upload_dir', $uploads ); 1530 1754 } 1531 1755 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 */ 1533 1773 function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) { 1534 1774 $filename = strtolower( $filename ); 1535 1775 // separate the filename into a name and extension … … 1567 1807 return $filename; 1568 1808 } 1569 1809 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 */ 1570 1833 function wp_upload_bits( $name, $deprecated, $bits, $time = NULL ) { 1571 1834 if ( empty( $name ) ) 1572 1835 return array( 'error' => __( "Empty filename" ) ); … … 1606 1869 return array( 'file' => $new_file, 'url' => $url, 'error' => false ); 1607 1870 } 1608 1871 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 */ 1609 1882 function wp_ext2type( $ext ) { 1610 1883 $ext2type = apply_filters('ext2type', array( 1611 1884 'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'), … … 1622 1895 return $type; 1623 1896 } 1624 1897 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 */ 1625 1909 function wp_check_filetype( $filename, $mimes = null ) { 1626 1910 // Accepted MIME types are set here as PCRE unless provided. 1627 1911 $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array( … … 1686 1970 return compact( 'ext', 'type' ); 1687 1971 } 1688 1972 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 */ 1689 1996 function wp_explain_nonce( $action ) { 1690 1997 if ( $action !== -1 && preg_match( '/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches ) ) { 1691 1998 $verb = $matches[1]; … … 1751 2058 return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __( 'Are you sure you want to do this?' ), $matches[4] ); 1752 2059 } 1753 2060 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 */ 1755 2073 function wp_nonce_ays( $action ) { 1756 2074 $title = __( 'WordPress Failure Notice' ); 1757 2075 $html = wp_specialchars( wp_explain_nonce( $action ) ) . '</p>'; … … 1760 2078 wp_die( $html, $title); 1761 2079 } 1762 2080 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 */ 1764 2095 function wp_die( $message, $title = '' ) { 1765 2096 global $wp_locale; 1766 2097 … … 1830 2161 die(); 1831 2162 } 1832 2163 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 */ 1834 2178 function _config_wp_home( $url = '' ) { 1835 2179 if ( defined( 'WP_HOME' ) ) 1836 2180 return WP_HOME; 1837 2181 return $url; 1838 2182 } 1839 2183 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 */ 1841 2198 function _config_wp_siteurl( $url = '' ) { 1842 2199 if ( defined( 'WP_SITEURL' ) ) 1843 2200 return WP_SITEURL; 1844 2201 return $url; 1845 2202 } 1846 2203 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 */ 1848 2221 function _mce_set_direction( $input ) { 1849 2222 global $wp_locale; 1850 2223 … … 1857 2230 return $input; 1858 2231 } 1859 2232 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 */ 1861 2260 function smilies_init() { 1862 2261 global $wpsmiliestrans, $wp_smiliessearch, $wp_smiliesreplace; 1863 2262 … … 2122 2521 * The current behavior is to trigger an user error if WP_DEBUG is defined and 2123 2522 * is true. 2124 2523 * 2125 * This function is to be used in every function in deprec eated.php2524 * This function is to be used in every function in deprecated.php 2126 2525 * 2127 2526 * @package WordPress 2128 2527 * @package Debug … … 2133 2532 * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error. 2134 2533 * 2135 2534 * @param string $function The function that was called 2136 * @param string $version The version of WordPress that deprec eated the function2535 * @param string $version The version of WordPress that deprecated the function 2137 2536 * @param string $replacement Optional. The function that should have been called 2138 2537 */ 2139 2538 function _deprecated_function($function, $version, $replacement=null) { … … 2159 2558 * The current behavior is to trigger an user error if WP_DEBUG is defined and 2160 2559 * is true. 2161 2560 * 2162 * This function is to be used in every file that is deprec eated2561 * This function is to be used in every file that is deprecated 2163 2562 * 2164 2563 * @package WordPress 2165 2564 * @package Debug 2166 * @since 2.5 2565 * @since 2.5.0 2167 2566 * @access private 2168 2567 * 2169 2568 * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead. … … 2189 2588 /** 2190 2589 * Is the server running earlier than 1.5.0 version of lighttpd 2191 2590 * 2192 * @since unknown2591 * @since 2.5.0 2193 2592 * 2194 2593 * @return bool Whether the server is running lighttpd < 1.5.0 2195 2594 */ … … 2202 2601 /** 2203 2602 * Does the specified module exist in the apache config? 2204 2603 * 2205 * @since unknown2604 * @since 2.5.0 2206 2605 * 2207 2606 * @param string $mod e.g. mod_rewrite 2208 2607 * @param bool $default The default return value if the module is not found … … 2236 2635 * character. A return value of '3' means that the file is not in the allowed 2237 2636 * files list. 2238 2637 * 2239 * @since 2.62638 * @since 1.2.0 2240 2639 * 2241 2640 * @param string $file File path. 2242 2641 * @param array $allowed_files List of allowed files. … … 2261 2660 /** 2262 2661 * Determine if SSL is used. 2263 2662 * 2264 * @since 2.6 2663 * @since 2.6.0 2265 2664 * 2266 2665 * @return bool True if SSL, false if not used. 2267 2666 */ … … 2272 2671 /** 2273 2672 * Whether SSL login should be forced. 2274 2673 * 2275 * @since 2.6 2674 * @since 2.6.0 2276 2675 * 2277 2676 * @param string|bool $force Optional. 2278 2677 * @return bool True if forced, false if not forced. … … 2292 2691 /** 2293 2692 * Whether to force SSL used for the Administration Panels. 2294 2693 * 2295 * @since 2.6 2694 * @since 2.6.0 2296 2695 * 2297 2696 * @param string|bool $force 2298 2697 * @return bool True if forced, false if not forced. … … 2315 2714 * Will remove wp-admin links to retrieve only return URLs not in the wp-admin 2316 2715 * directory. 2317 2716 * 2318 * @since 2.6 2717 * @since 2.6.0 2319 2718 * 2320 2719 * @return string 2321 2720 */
