Skip to main content

current_user_can_change_entry_status()

public static function current_user_can_change_entry_status( $entry, $new_status )

Checks whether the current user can make an entry status change.

Changes to or from trash require gravityforms_delete_entries. The same rule applies to values other than active, spam, or empty, since the database may treat values such as "TRASH" as trash. Keeping the same status does not require delete permission.

The caller must still check permission to edit entries. Pass the value being written, or an empty value when a full-entry update omits status: GFAPI::update_entry() defaults it to active, which can restore an entry.

Since: next

Source: common.php:3025

Parameters​

NameTypeDefaultDescription
$entryint | arrayThe entry ID or the stored entry.
$new_statusmixedThe requested status.

Returns​

  • bool