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



wp_throttle_comment_flood ›

Od2.1.0
Przestarzałyn/a
wp_throttle_comment_flood ( $block, $time_lastcomment, $time_newcomment )
Parametry: (3)
  • (bool) $block Whether plugin has already blocked comment.
    Wymagane: Tak
  • (int) $time_lastcomment Timestamp for last comment.
    Wymagane: Tak
  • (int) $time_newcomment Timestamp for new comment.
    Wymagane: Tak
Powrót:
  • (bool) Whether comment should be blocked.
Zdefiniowane na:
Codex:

Whether a comment should be blocked because of comment flood.



Źródło

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