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



wp_dashboard_on_this_day_postbox_classes › WordPress Function

Seit7.1.0
Veraltetn/v
wp_dashboard_on_this_day_postbox_classes ( $classes )
Parameter:
  • (string[]) $classes An array of postbox classes.
    Erforderlich: Ja
Gibt zurück:
  • (string[]) Filtered postbox classes.
Definiert in:
Codex:

Hides the On This Day postbox when there are no posts to show.

Adds the core hidden class so the widget stays registered — preserving its Screen Options entry and user-customized position — while being hidden when empty. A user can still reveal it via Screen Options, in which case the placeholder message is shown.


Quellcode

function wp_dashboard_on_this_day_postbox_classes( $classes ) {
	if ( empty( wp_dashboard_on_this_day_get_posts() ) ) {
		$classes[] = 'hidden';
	}

	return $classes;
}