PluginProbe
bbPress Voting / trunk
bbPress Voting vtrunk
2.1.10.2 2.1.10.3 2.1.10.4 2.1.10.5 2.1.10.6 2.1.11.0 2.1.11.1 2.1.11.10 2.1.11.11 2.1.11.12 2.1.11.2 2.1.11.3 2.1.11.4 2.1.11.5 2.1.11.6 2.1.11.7 2.1.11.8 2.1.11.9 2.1.12.0 2.1.12.1 2.1.12.2 2.1.12.3 2.1.12.7 2.1.13.0 2.1.13.1 All 93 releases
bbp-voting / bbp-voting.php

bbp-voting.php in bbPress Voting trunk, at bbp-voting.php

79 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: bbPress Voting
4 Plugin URI: https://wordpress.org/plugins/bbp-voting/
5 Author: WP For The Win
6 Author URI: https://wpforthewin.com
7 Description: Let users vote up or down on bbPress topics and replies just like Reddit or Stack Overflow.
8 Text Domain: bbp-voting
9 Version: 2.1.13.10
10 Requires at least: 4.0.0
11 Tested up to: 7.0.1
12 License: GPLv3
13 */
14
15 if(!defined('ABSPATH')) {
16 exit; // Exit if accessed directly.
17 }
18
19 // Let the pro plugin know we're active
20 define('BBPVOTING', true);
21 // define('BBPVOTINGDEBUG', true);
22
23 // The plugin basename, "folder/file.php"
24 $plugin = plugin_basename(__FILE__);
25
26 // Setup all the hooks for getting setting values
27 global $bbp_voting_hooks;
28 $bbp_voting_hooks = array(
29 'bbp_voting_show_labels' => 'bool',
30 'bbp_voting_helpful' => 'string',
31 'bbp_voting_not_helpful' => 'string',
32 'bbp_voting_display_vote_nums' => 'select',
33 'bbp_voting_only_topics' => 'bool',
34 'bbp_voting_only_replies' => 'bool',
35 'bbp_voting_disable_forum_index_buttons' => 'bool',
36 'bbp_voting_disable_voting_for_visitors' => 'bool',
37 'bbp_voting_disable_voting_on_closed_topic' => 'bool',
38 'bbp_voting_disable_down_votes' => 'bool',
39 'bbp_voting_disable_author_vote' => 'bool',
40 'bbp_voting_admin_bypass' => 'bool',
41 'sort_bbpress_topics_by_votes' => 'bool',
42 'sort_bbpress_replies_by_votes' => 'bool',
43 'bbp_voting_use_filter_hooks_for_buttons' => 'bool',
44 'bbp_voting_buddyboss_css' => 'bool',
45 'bbp_voting_lead_topic' => 'bool',
46 );
47 $bbp_voting_hooks = isset($bbp_voting_pro_hooks) ? array_merge($bbp_voting_hooks, $bbp_voting_pro_hooks) : $bbp_voting_hooks;
48
49 // Helpers are helpful
50 require_once plugin_dir_path( __FILE__ ) . 'helpers.php';
51
52 foreach($bbp_voting_hooks as $bbp_voting_hook => $bbp_voting_hook_type) {
53 add_filter( $bbp_voting_hook, 'bbp_voting_hook_setting');
54 }
55
56 // Require only the appropriate files
57 if(wp_doing_ajax()) {
58 // Ajax
59 require_once plugin_dir_path( __FILE__ ) . 'ajax.php';
60 } elseif(is_admin()) {
61 // Backend
62 require_once plugin_dir_path( __FILE__ ) . 'backend.php';
63 require_once plugin_dir_path( __FILE__ ) . 'metabox.php';
64 // In-admin upsell banner for bbPress Voting Pro.
65 // Suppressed internally if Pro is active, so safe to always require.
66 require_once plugin_dir_path( __FILE__ ) . 'upsell.php';
67 } else {
68 // Frontend
69 require_once plugin_dir_path( __FILE__ ) . 'frontend.php';
70 }
71
72 // Load GamiPress integration after all plugins are loaded
73 function bbp_voting_load_gamipress_integration() {
74 if( class_exists('GamiPress') ) {
75 require_once plugin_dir_path( __FILE__ ) . 'gamipress.php';
76 }
77 }
78 add_action('plugins_loaded', 'bbp_voting_load_gamipress_integration', 20);
79