WP_Paused_Extensions_Storage::delete()
Forgets a previously recorded extension error.
Метод класса: WP_Paused_Extensions_Storage{}
Хуков нет.
Возвращает
true|false
. True on success, false on failure.
Использование
$WP_Paused_Extensions_Storage = new WP_Paused_Extensions_Storage(); $WP_Paused_Extensions_Storage->delete( $extension );
- $extension(строка) (обязательный)
- Plugin or theme directory name.
Список изменений
С версии 5.2.0 | Введена. |
Код WP_Paused_Extensions_Storage::delete() WP Paused Extensions Storage::delete WP 6.6.2
public function delete( $extension ) { if ( ! $this->is_api_loaded() ) { return false; } $option_name = $this->get_option_name(); if ( ! $option_name ) { return false; } $paused_extensions = (array) get_option( $option_name, array() ); // Do not delete if no error is stored. if ( ! isset( $paused_extensions[ $this->type ][ $extension ] ) ) { return true; } unset( $paused_extensions[ $this->type ][ $extension ] ); if ( empty( $paused_extensions[ $this->type ] ) ) { unset( $paused_extensions[ $this->type ] ); } // Clean up the entire option if we're removing the only error. if ( ! $paused_extensions ) { return delete_option( $option_name ); } return update_option( $option_name, $paused_extensions ); }