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



wp_throttle_comment_flood ›

Seit2.1.0
Veraltetn/v
wp_throttle_comment_flood ( $block, $time_lastcomment, $time_newcomment )
Parameter: (3)
  • (bool) $block Whether plugin has already blocked comment.
    Erforderlich: Ja
  • (int) $time_lastcomment Timestamp for last comment.
    Erforderlich: Ja
  • (int) $time_newcomment Timestamp for new comment.
    Erforderlich: Ja
Gibt zurück:
  • (bool) Whether comment should be blocked.
Definiert in:
Codex:

Whether a comment should be blocked because of comment flood.



Quellcode

function wp_throttle_comment_flood( $block, $time_lastcomment, $time_newcomment ) {
	if ( $block ) { // a plugin has already blocked... we'll let that decision stand
		return $block;
	}
	if ( ( $time_newcomment - $time_lastcomment ) < 15 ) {
		return true;
	}
	return false;
}