Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



delete_site_meta_by_key ›

Seit5.0.0
Veraltetn/v
delete_site_meta_by_key ( $meta_key )
Parameter:
  • (string) $meta_key Metadata key to search for when deleting.
    Erforderlich: Ja
Gibt zurück:
  • (bool) Whether the site meta key was deleted from the database.
Definiert in:
Codex:

Deletes everything from site meta matching meta key.



Quellcode

function delete_site_meta_by_key( $meta_key ) {
	// Bail if site meta table is not installed.
	if ( ! is_site_meta_supported() ) {
		/* translators: %s: database table name */
		_doing_it_wrong( __FUNCTION__, sprintf( __( 'The %s table is not installed. Please run the network database upgrade.' ), $GLOBALS['wpdb']->blogmeta ), '5.0.0' );
		return false;
	}

	$deleted = delete_metadata( 'blog', null, $meta_key, '', true );

	// Bust site query cache.
	if ( $deleted ) {
		wp_cache_set( 'last_changed', microtime(), 'sites' );
	}

	return $deleted;
}