wpmem_array_insert()

Description

Utility function to insert array items at a specific point in an array.

Parameters

$array
(array) (required) The array in which you want to insert a new element.

$new
(array) (required) The new array items.

$key
(string) (required) The array key at which point you want to insert the new element before or after.

$loc
(string) (optional) Where to position the new element relative to the $key (i.e. “before” or “after”) (Default: after).

Usage

[gist id=”71999f4cb8ec461f56fc2263e2b131bb” file=”wpmem_array_insert.php”]

Examples

[gist id=”71999f4cb8ec461f56fc2263e2b131bb” file=”wpmem_array_insert_example.php”]

Changelog

  • Introduced in version 3.1.6

Source

wpmem_redirect_to_login() is located in /inc/api.php.