wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
delete_option [ WordPress Function ]
| Parameter: |
|
| Nutzt: | |
| Gibt zurück: |
|
| Definiert in: |
|
Removes option by name. Prevents removal of protected WordPress options.
Source
<?php
function delete_option( $option ) {
global $wpdb;
wp_protect_special_option( $option );
// Get the ID, if no ID then return
$row = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $option ) );
if ( is_null( $row ) )
return false;
do_action( 'delete_option', $option );
$result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) );
if ( ! defined( 'WP_INSTALLING' ) ) {
if ( 'yes' == $row->autoload ) {
$alloptions = wp_load_alloptions();
if ( is_array( $alloptions ) && isset( $alloptions[$option] ) ) {
unset( $alloptions[$option] );
wp_cache_set( 'alloptions', $alloptions, 'options' );
}
} else {
wp_cache_delete( $option, 'options' );
}
}
if ( $result ) {
do_action( "delete_option_$option", $option );
do_action( 'deleted_option', $option );
return true;
}
return false;
}
?>
Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- Function Reference/delete option « WordPress Codex
Description. A safe way of removing a named option/value pair from the options database table. Usage. <?php delete_option( $option ); ?> Parameters. $option ...
codex.wordpress.org - delete_option - 2Checkout Documentation
The delete_option call is used to delete a product option. URL: https://www. 2checkout.com/api/products/delete_option. HTTP Method: POST ...
www.2checkout.com - php - WordPress delete_option(); Wildcard capability? - Stack ...
You need to make a "whitelist" of all the variables your plugin sets (I assume you are looking at a plugin uninstall script), then just loop through it at ...
stackoverflow.com - PHPXRef 0.7 : WordPress : Function Reference: delete_option()
Function and Method Cross Reference. delete_option(). Defined at: /wp-includes/ option.php -> line 347. Referenced 31 times: /wp-includes/class-wp-theme.php ...
phpxref.ftwr.co.uk