Source: public/themes/blog/functions-comments.php · 73 lines, ~286 statements · namespace: (global) · `declare(strict_types=1)`: no
Blog Theme Comment Helpers
Comment counting, CSRF token and comment-section rendering helpers for the Bootstrap Blog theme. Extracted from the monolithic functions.php (Phase 5 remediation). The raw comment-count SQL is routed through CommentDao. All functions use function_exists() guards to avoid redeclaration errors.
| Function | Line | Params | Returns | Summary |
|---|---|---|---|---|
total_comment | 22 | 1 | total_comment() - Get total approved comments for post | |
block_csrf | 42 | 0 | block_csrf() - Generate CSRF token for comment form | |
render_comments_section | 55 | 2 | string | render_comments_section() - Render comments section HTML |
Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.
public function total_comment($id)
total_comment() - Get total approved comments for post
| Parameter | Type | Default | Description |
|---|---|---|---|
$id | (untyped) | required |
Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.
public function block_csrf()
block_csrf() - Generate CSRF token for comment form
Declared inside a guard (the project uses `if (!function_exists(…))` around global functions), so the declaration is conditional at load time.
public function render_comments_section(int $postId, int $offset = 0): string
render_comments_section() - Render comments section HTML
| Parameter | Type | Default | Description |
|---|---|---|---|
$postId | int | required | |
$offset | int | 0 |
Generated by 'tools/gendoc'.