Skip to content

Commit

Permalink
Networks and Sites: Relocate defintion of absint().
Browse files Browse the repository at this point in the history
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@59242 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
peterwilsoncc committed Oct 15, 2024
1 parent 4edc604 commit 11b435c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5476,18 +5476,6 @@ function dead_db() {
wp_die( '<h1>' . __( 'Error establishing a database connection' ) . '</h1>', __( 'Database Error' ) );
}

/**
* Converts a value to non-negative integer.
*
* @since 2.5.0
*
* @param mixed $maybeint Data you wish to have converted to a non-negative integer.
* @return int A non-negative integer.
*/
function absint( $maybeint ) {
return abs( (int) $maybeint );
}

/**
* Marks a function as deprecated and inform when it has been used.
*
Expand Down
12 changes: 12 additions & 0 deletions src/wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,18 @@ function is_multisite() {
return false;
}

/**
* Converts a value to non-negative integer.
*
* @since 2.5.0
*
* @param mixed $maybeint Data you wish to have converted to a non-negative integer.
* @return int A non-negative integer.
*/
function absint( $maybeint ) {
return abs( (int) $maybeint );
}

/**
* Retrieves the current site ID.
*
Expand Down

0 comments on commit 11b435c

Please sign in to comment.