# bbp-core/1.2.2/includes/admin/menu/Approve_Topic.php

Forumax – AI Powered Advanced Community Forum Plugin, version 1.2.2. 34 lines.

- Page: https://pluginprobe.com/plugins/bbp-core/1.2.2/code/includes/admin/menu/Approve_Topic.php
- Raw: https://pluginprobe.com/plugins/bbp-core/1.2.2/raw/includes/admin/menu/Approve_Topic.php
- Modified: 2024-03-24T17:05:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bbp-core/1.2.2/code/includes/admin/menu/Approve_Topic.php#L10-L20`.

```php
<?php
namespace admin\menu;

defined( 'ABSPATH' ) || exit();

class Approve_Topic {
	public function __construct() {
		add_action( 'admin_init', [ $this, 'approve_spam_topic' ] );
		add_action( 'admin_init', [ $this, 'approve_pending_reply' ] );
	}

	public function approve_spam_topic() {
		$approval_request = $_GET['bbpc_approve_topic_id'] ?? false;

		if ( $approval_request ) {
			bbp_approve_topic( (int) $approval_request );
			wp_safe_redirect( admin_url( 'admin.php?page=bbp-core' ) );
		}
	}

	public function approve_pending_reply() {
		$approval_request = $_GET['bbpc_approve_reply_id'] ?? false;

		if ( $approval_request ) {
			bbp_approve_reply( (int) $approval_request );
			wp_safe_redirect( admin_url( 'admin.php?page=bbp-core' ) );
		}
	}
}

new Approve_Topic();



```
