Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_throttle_comment_flood ›

Desde2.1.0
Obsoleton/a
wp_throttle_comment_flood ( $block, $time_lastcomment, $time_newcomment )
Parâmetros: (3)
  • (bool) $block Whether plugin has already blocked comment.
    Required: Yes
  • (int) $time_lastcomment Timestamp for last comment.
    Required: Yes
  • (int) $time_newcomment Timestamp for new comment.
    Required: Yes
Retorna:
  • (bool) Whether comment should be blocked.
Definido em:
Codex:

Whether a comment should be blocked because of comment flood.



Fonte

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