# bbp-core/1.2.7/includes/features/bbp_voting.php

Forumax – AI Powered Advanced Community Forum Plugin, version 1.2.7. 37 lines.

- Page: https://pluginprobe.com/plugins/bbp-core/1.2.7/code/includes/features/bbp_voting.php
- Raw: https://pluginprobe.com/plugins/bbp-core/1.2.7/raw/includes/features/bbp_voting.php
- Modified: 2024-12-24T09:25:42+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.7/code/includes/features/bbp_voting.php#L10-L20`.

```php
<?php
namespace features;

class bbp_voting {
	function __construct() {
		$this->include_files();
		$this->load_functions();
	}

	public function include_files() {
		define( 'BBPC_VOTE_PATH', plugin_dir_path( __FILE__ ) . 'bbp_voting/' );

		// The plugin basename, "folder/file.php"
		$plugin = plugin_basename( __FILE__ );

		// Helpers are helpful.
		require_once BBPC_VOTE_PATH . 'helpers.php';

	}

	public function load_functions() {
		// Require only the appropriate files.
		if ( wp_doing_ajax() ) {
			// Ajax.
			require_once BBPC_VOTE_PATH . 'ajax.php';
		} elseif ( is_admin() ) {
			require_once BBPC_VOTE_PATH . 'metabox.php';
		} else {
			// Frontend.
			require_once BBPC_VOTE_PATH . 'frontend.php';
		}

	}
}



```
