Make WordPress Core


Ignore:
Timestamp:
10/15/2024 11:39:38 PM (3 weeks ago)
Author:
peterwilsoncc
Message:

Networks and Sites: Relocate defintion of absint().

Relocate the defintion of absint() to load.php to allow it to be available to get_current_blog_id() and get_current_network_id(). These functions may be called by caching drop-ins, prior to the loading of functions.php.

Props flixos90, geekofshire, johnjamesjacoby, sergeybiryukov, wonderboymusic.
Fixes #40682.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r59189 r59242  
    14301430
    14311431/**
     1432 * Converts a value to non-negative integer.
     1433 *
     1434 * @since 2.5.0
     1435 *
     1436 * @param mixed $maybeint Data you wish to have converted to a non-negative integer.
     1437 * @return int A non-negative integer.
     1438 */
     1439function absint( $maybeint ) {
     1440    return abs( (int) $maybeint );
     1441}
     1442
     1443/**
    14321444 * Retrieves the current site ID.
    14331445 *
Note: See TracChangeset for help on using the changeset viewer.