Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



delete_site_meta_by_key ›

Od5.0.0
Przestarzałyn/a
delete_site_meta_by_key ( $meta_key )
Parametry:
  • (string) $meta_key Metadata key to search for when deleting.
    Wymagane: Tak
Powrót:
  • (bool) Whether the site meta key was deleted from the database.
Zdefiniowane na:
Codex:

Deletes everything from site meta matching meta key.



Źródło

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;
}