WordPress.org

Make WordPress Core

Ticket #8779: standardized_function_names.3.diff

File standardized_function_names.3.diff, 10.7 KB (added by filosofo, 9 years ago)
  • wp-includes/deprecated.php

     
    13041304        return get_comment($comment_ID, ARRAY_A);
    13051305}
    13061306
     1307/**
     1308 * @deprecated Use add_css_class()
     1309 * @see add_css_class()
     1310 * @since 2.7
     1311 *
     1312 * @param string $add
     1313 * @param string $class
     1314 * @return string The class
     1315 */
     1316function add_cssclass( $add = '', $class = '') {
     1317        _deprecated_function( __FUNCTION__, '2.8', 'add_css_class()' );
     1318        return add_css_class($add, $class);
     1319}
     1320
     1321/**
     1322 * Remove user meta data.
     1323 *
     1324 * @deprecated Use delete_user_meta()
     1325 * @since 2.0.0
     1326 * @uses $wpdb WordPress database object for queries.
     1327 *
     1328 * @param int $user_id User ID.
     1329 * @param string $meta_key Metadata key.
     1330 * @param mixed $meta_value Metadata value.
     1331 * @return bool True deletion completed and false if user_id is not a number.
     1332 */
     1333function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) {
     1334        _deprecated_function( __FUNCTION__, '2.8', 'delete_user_meta()' );
     1335        return delete_user_meta($user_id, $meta_key, $meta_value);
     1336}
     1337
     1338/**
     1339 * Retrieve all options as it was for 1.2.
     1340 *
     1341 * @deprecated Use get_all_options_110()
     1342 * @since 1.2.0
     1343 *
     1344 * @return array List of options.
     1345 */
     1346function get_alloptions_110() {
     1347        _deprecated_function( __FUNCTION__, '2.8', 'get_all_options_110()' );
     1348        return get_all_options_110();
     1349}
     1350
     1351/**
     1352 * Get the week start and end from the datetime or date string from mysql.
     1353 *
     1354 * @deprecated Use get_week_start_end()
     1355 * @since 0.71
     1356 *
     1357 * @param string $mysqlstring Date or datetime field type from mysql.
     1358 * @param int $start_of_week Optional. Start of the week as an integer.
     1359 * @return array Keys are 'start' and 'end'.
     1360 */
     1361function get_weekstartend( $mysqlstring, $start_of_week = '' ) {
     1362        _deprecated_function( __FUNCTION__, '2.8', 'get_week_start_end()' );
     1363        return get_week_start_end($mysqlstring, $start_of_week);
     1364}
     1365
     1366/**
     1367 * Retrieve all autoload options or all options, if no autoloaded ones exist.
     1368 *
     1369 * This is different from wp_load_alloptions() in that this function does not
     1370 * cache its results and will retrieve all options from the database every time
     1371 *
     1372 * it is called.
     1373 *
     1374 * @deprecated Use get_all_options()
     1375 * @since 1.0.0
     1376 * @package WordPress
     1377 * @subpackage Option
     1378 * @uses apply_filters() Calls 'pre_option_$optionname' hook with option value as parameter.
     1379 * @uses apply_filters() Calls 'all_options' on options list.
     1380 *
     1381 * @return array List of all options.
     1382 */
     1383function get_alloptions() {
     1384        _deprecated_function( __FUNCTION__, '2.8', 'get_all_options()' );
     1385        return get_all_options();
     1386}
     1387
     1388/**
     1389 * Number of posts user has written.
     1390 *
     1391 * @deprecated Use get_user_num_posts()
     1392 * @since 0.71
     1393 * @uses $wpdb WordPress database object for queries.
     1394 *
     1395 * @param int $userid User ID.
     1396 * @return int Amount of posts user has written.
     1397 */
     1398function get_usernumposts($userid = 0) {
     1399        _deprecated_function( __FUNCTION__, '2.8', 'get_user_num_posts()' );
     1400        return get_user_num_posts($userid);
     1401}
     1402
     1403/**
     1404 * Retrieve user metadata.
     1405 *
     1406 * If $user_id is not a number, then the function will fail over with a 'false'
     1407 * boolean return value. Other returned values depend on whether there is only
     1408 * one item to be returned, which be that single item type. If there is more
     1409 * than one metadata value, then it will be list of metadata values.
     1410 *
     1411 * @deprecated Use get_user_meta()
     1412 * @since 2.0.0
     1413 * @uses $wpdb WordPress database object for queries.
     1414 *
     1415 * @param int $user_id User ID
     1416 * @param string $meta_key Optional. Metadata key.
     1417 * @return mixed
     1418 */
     1419function get_usermeta( $user_id = 0, $meta_key = '') {
     1420        _deprecated_function( __FUNCTION__, '2.8', 'get_user_meta()' );
     1421        return get_user_meta($user_id, $meta_key);
     1422}
     1423
     1424/**
     1425 * The date the last comment was modified.
     1426 *
     1427 * @deprecated Use get_last_comment_modified()
     1428 * @since 1.5.0
     1429 * @uses $wpdb
     1430 * @global array $cache_lastcommentmodified
     1431 *
     1432 * @param string $timezone Which timezone to use in reference to 'gmt', 'blog',
     1433 *              or 'server' locations.
     1434 * @return string Last comment modified date.
     1435 */
     1436function get_lastcommentmodified($timezone = 'server') {
     1437        _deprecated_function( __FUNCTION__, '2.8', 'get_last_comment_modified()' );
     1438        return get_last_comment_modified($timezone);
     1439}
     1440
     1441/**
     1442 * Retrieve text color for custom header.
     1443 *
     1444 * @deprecated Use get_header_text_color()
     1445 * @since 2.1.0
     1446 * @uses HEADER_TEXTCOLOR
     1447 *
     1448 * @return string
     1449 */
     1450function get_header_textcolor() {
     1451        _deprecated_function( __FUNCTION__, '2.8', 'get_header_text_color()' );
     1452        return get_header_text_color();
     1453}
     1454
     1455/**
     1456 * Retrieve information about the blog.
     1457 *
     1458 * Some show parameter values are deprecated and will be removed in future
     1459 * versions. Care should be taken to check the function contents and know what
     1460 * the deprecated blog info options are. Options without "// DEPRECATED" are
     1461 * the preferred and recommended ways to get the information.
     1462 *
     1463 * The possible values for the 'show' parameter are listed below.
     1464 * <ol>
     1465 * <li><strong>url<strong> - Blog URI to homepage.</li>
     1466 * <li><strong>wpurl</strong> - Blog URI path to WordPress.</li>
     1467 * <li><strong>description</strong> - Secondary title</li>
     1468 * </ol>
     1469 *
     1470 * The feed URL options can be retrieved from 'rdf_url' (RSS 0.91),
     1471 * 'rss_url' (RSS 1.0), 'rss2_url' (RSS 2.0), or 'atom_url' (Atom feed). The
     1472 * comment feeds can be retrieved from the 'comments_atom_url' (Atom comment
     1473 * feed) or 'comments_rss2_url' (RSS 2.0 comment feed).
     1474 *
     1475 * There are many other options and you should check the function contents:
     1476 * {@source 32 37}
     1477 *
     1478 * @deprecated use get_blog_info()
     1479 * @since 0.71
     1480 *
     1481 * @param string $show Blog info to retrieve.
     1482 * @param string $filter How to filter what is retrieved.
     1483 * @return string Mostly string values, might be empty.
     1484 */
     1485function get_bloginfo($show = '', $filter = 'raw') {
     1486        _deprecated_function( __FUNCTION__, '2.8', 'get_blog_info()' );
     1487        return get_blog_info($show, $filter);
     1488}
     1489
     1490/**
     1491 * RSS container for the bloginfo function.
     1492 *
     1493 * You can retrieve anything that you can using the get_bloginfo() function.
     1494 * Everything will be stripped of tags and characters converted, when the values
     1495 * are retrieved for use in the feeds.
     1496 *
     1497 * @package WordPress
     1498 * @subpackage Feed
     1499 *
     1500 * @deprecated use get_blog_info_rss()
     1501 * @since 1.5.1
     1502 * @uses apply_filters() Calls 'get_bloginfo_rss' hook with two parameters.
     1503 * @see get_bloginfo() For the list of possible values to display.
     1504 *
     1505 * @param string $show See get_bloginfo() for possible values.
     1506 * @return string
     1507 */
     1508function get_bloginfo_rss($show = '') {
     1509        _deprecated_function( __FUNCTION__, '2.8', 'get_blog_info_rss()' );
     1510        return get_blog_info_rss($show);
     1511}
     1512
     1513/**
     1514 * Retrieve page numbers links.
     1515 *
     1516 * @deprecated Use get_comments_page_num_link()
     1517 * @since 2.7.0
     1518 *
     1519 * @param int $pagenum Optional. Page number.
     1520 * @return string
     1521 */
     1522function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
     1523        _deprecated_function( __FUNCTION__, '2.8', 'get_comments_page_num_link()' );
     1524        return get_comments_page_num_link($pagenum, $max_page);
     1525}
     1526
     1527/**
     1528 * Retrieve the category name by the category ID.
     1529 *
     1530 * @since 0.71
     1531 * @deprecated Use get_cat_name()
     1532 * @see get_cat_name() get_catname() is deprecated in favor of get_cat_name().
     1533 *
     1534 * @param int $cat_ID Category ID
     1535 * @return string category name
     1536 */
     1537function get_catname( $cat_ID = 0 ) {
     1538        _deprecated_function( __FUNCTION__, '2.8', 'get_cat_name()' );
     1539        return get_cat_name( $cat_ID );
     1540}
     1541
     1542/**
     1543 * Retrieve the date the the last post was published.
     1544 *
     1545 * The server timezone is the default and is the difference between GMT and
     1546 * server time. The 'blog' value is the date when the last post was posted. The
     1547 * 'gmt' is when the last post was posted in GMT formatted date.
     1548 *
     1549 * @deprecated Use get_last_post_date()
     1550 * @since 0.71
     1551 *
     1552 * @uses $wpdb
     1553 * @uses $blog_id
     1554 * @uses apply_filters() Calls 'get_lastpostdate' filter
     1555 *
     1556 * @global mixed $cache_lastpostdate Stores the last post date
     1557 * @global mixed $pagenow The current page being viewed
     1558 *
     1559 * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
     1560 * @return string The date of the last post.
     1561 */
     1562function get_lastpostdate($timezone = 'server') {
     1563        _deprecated_function( __FUNCTION__, '2.8', 'get_last_post_date()' );
     1564        return get_lastpostdate($timezone);
     1565}
     1566
     1567/**
     1568 * Retrieve last post modified date depending on timezone.
     1569 *
     1570 * The server timezone is the default and is the difference between GMT and
     1571 * server time. The 'blog' value is just when the last post was modified. The
     1572 * 'gmt' is when the last post was modified in GMT time.
     1573 *
     1574 * @deprecated use get_last_post_modified()
     1575 * @since 1.2.0
     1576 * @uses $wpdb
     1577 * @uses $blog_id
     1578 * @uses apply_filters() Calls 'get_lastpostmodified' filter
     1579 *
     1580 * @global mixed $cache_lastpostmodified Stores the date the last post was modified
     1581 *
     1582 * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
     1583 * @return string The date the post was last modified.
     1584 */
     1585function get_lastpostmodified($timezone = 'server') {
     1586        _deprecated_function( __FUNCTION__, '2.8', 'get_last_post_modified()' );
     1587        return get_last_post_modified($timezone);
     1588}
     1589
     1590/**
     1591 * Update metadata of user.
     1592 *
     1593 * There is no need to serialize values, they will be serialized if it is
     1594 * needed. The metadata key can only be a string with underscores. All else will
     1595 * be removed.
     1596 *
     1597 * Will remove the metadata, if the meta value is empty.
     1598 *
     1599 * @deprecated use update_user_meta()
     1600 * @since 2.0.0
     1601 * @uses $wpdb WordPress database object for queries
     1602 *
     1603 * @param int $user_id User ID
     1604 * @param string $meta_key Metadata key.
     1605 * @param mixed $meta_value Metadata value.
     1606 * @return bool True on successful update, false on failure.
     1607 */
     1608function update_usermeta( $user_id, $meta_key, $meta_value ) {
     1609        _deprecated_function( __FUNCTION__, '2.8', 'update_user_meta()' );
     1610        return update_user_meta($user_id, $meta_key, $meta_value);
     1611}
     1612
     1613/**
     1614 * Updates metadata cache for list of post IDs.
     1615 *
     1616 * Performs SQL query to retrieve the metadata for the post IDs and updates the
     1617 * metadata cache for the posts. Therefore, the functions, which call this
     1618 * function, do not need to perform SQL queries on their own.
     1619 *
     1620 * @package WordPress
     1621 * @subpackage Cache
     1622 * @deprecated Use update_post_meta_cache()
     1623 * @since 2.1.0
     1624 *
     1625 * @uses $wpdb
     1626 *
     1627 * @param array $post_ids List of post IDs.
     1628 * @return bool|array Returns false if there is nothing to update or an array of metadata.
     1629 */
     1630function update_postmeta_cache($post_ids = array()) {
     1631        _deprecated_function( __FUNCTION__, '2.8', 'update_post_meta_cache()' );
     1632        return update_post_meta_cache($post_ids);
     1633}
     1634