remove_option_whitelist

The timeline below displays how wordpress function remove_option_whitelist has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Removes a list of options from the allowed options list.
 *
 * @since 2.7.0
 * @deprecated 5.5.0 Use remove_allowed_options() instead.
 *                   Please consider writing more inclusive code.
 *
 * @param array        $del_options
 * @param string|array $options
 * @return array
 */
function remove_option_whitelist($del_options, $options = '')
{
    _deprecated_function(__FUNCTION__, '5.5.0', 'remove_allowed_options()');
    return remove_allowed_options($del_options, $options);
}

WordPress Version: 5.5

/**
 * Removes a list of options from the allowed options list.
 *
 * @since 2.7.0
 * @deprecated 5.5.0 Use remove_allowed_options() instead.
 *                   Please consider writing more inclusive code.
 *
 * @global array $allowed_options
 *
 * @param array        $del_options
 * @param string|array $options
 * @return array
 */
function remove_option_whitelist($del_options, $options = '')
{
    _deprecated_function(__FUNCTION__, '5.5.0', 'remove_allowed_options()');
    return remove_allowed_options($del_options, $options);
}

WordPress Version: 5.4

/**
 * Removes a list of options from the options whitelist.
 *
 * @since 2.7.0
 *
 * @global array $whitelist_options
 *
 * @param array        $del_options
 * @param string|array $options
 * @return array
 */
function remove_option_whitelist($del_options, $options = '')
{
    if ('' == $options) {
        global $whitelist_options;
    } else {
        $whitelist_options = $options;
    }
    foreach ($del_options as $page => $keys) {
        foreach ($keys as $key) {
            if (isset($whitelist_options[$page]) && is_array($whitelist_options[$page])) {
                $pos = array_search($key, $whitelist_options[$page]);
                if (false !== $pos) {
                    unset($whitelist_options[$page][$pos]);
                }
            }
        }
    }
    return $whitelist_options;
}

WordPress Version: 4.4

/**
 * Removes a list of options from the options whitelist.
 *
 * @since 2.7.0
 *
 * @global array $whitelist_options
 *
 * @param array        $del_options
 * @param string|array $options
 * @return array
 */
function remove_option_whitelist($del_options, $options = '')
{
    if ($options == '') {
        global $whitelist_options;
    } else {
        $whitelist_options = $options;
    }
    foreach ($del_options as $page => $keys) {
        foreach ($keys as $key) {
            if (isset($whitelist_options[$page]) && is_array($whitelist_options[$page])) {
                $pos = array_search($key, $whitelist_options[$page]);
                if ($pos !== false) {
                    unset($whitelist_options[$page][$pos]);
                }
            }
        }
    }
    return $whitelist_options;
}

WordPress Version: 4.3

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.7.0
 *
 * @global array $whitelist_options
 *
 * @param array        $del_options
 * @param string|array $options
 * @return array
 */
function remove_option_whitelist($del_options, $options = '')
{
    if ($options == '') {
        global $whitelist_options;
    } else {
        $whitelist_options = $options;
    }
    foreach ($del_options as $page => $keys) {
        foreach ($keys as $key) {
            if (isset($whitelist_options[$page]) && is_array($whitelist_options[$page])) {
                $pos = array_search($key, $whitelist_options[$page]);
                if ($pos !== false) {
                    unset($whitelist_options[$page][$pos]);
                }
            }
        }
    }
    return $whitelist_options;
}

WordPress Version: 4.1

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.7.0
 *
 * @param array        $del_options
 * @param string|array $options
 * @return array
 */
function remove_option_whitelist($del_options, $options = '')
{
    if ($options == '') {
        global $whitelist_options;
    } else {
        $whitelist_options = $options;
    }
    foreach ($del_options as $page => $keys) {
        foreach ($keys as $key) {
            if (isset($whitelist_options[$page]) && is_array($whitelist_options[$page])) {
                $pos = array_search($key, $whitelist_options[$page]);
                if ($pos !== false) {
                    unset($whitelist_options[$page][$pos]);
                }
            }
        }
    }
    return $whitelist_options;
}

WordPress Version: 3.7

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.7.0
 *
 * @param unknown_type $del_options
 * @param unknown_type $options
 * @return unknown
 */
function remove_option_whitelist($del_options, $options = '')
{
    if ($options == '') {
        global $whitelist_options;
    } else {
        $whitelist_options = $options;
    }
    foreach ($del_options as $page => $keys) {
        foreach ($keys as $key) {
            if (isset($whitelist_options[$page]) && is_array($whitelist_options[$page])) {
                $pos = array_search($key, $whitelist_options[$page]);
                if ($pos !== false) {
                    unset($whitelist_options[$page][$pos]);
                }
            }
        }
    }
    return $whitelist_options;
}