| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: WP Comments Fields Manager |
| 4 |
Plugin URI: http://www.najeebmedia.com |
| 5 |
Description: This plugin allow users to add custom fields in post comments area. |
| 6 |
Version: 2.3 |
| 7 |
Author: nmedia82 |
| 8 |
Author URI: http://www.najeebmedia.com/ |
| 9 |
Text Domain: nm-wpcomments |
| 10 |
Domain Path: |
| 11 |
*/ |
| 12 |
|
| 13 |
// Exit if accessed directly. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Get the plugin url. |
| 20 |
* |
| 21 |
* @access public |
| 22 |
* @return string |
| 23 |
*/ |
| 24 |
function wpcf_get_url() { |
| 25 |
return untrailingslashit( plugins_url( '/', __FILE__ ) ); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Get the plugin path. |
| 30 |
* |
| 31 |
* @access public |
| 32 |
* @return string |
| 33 |
*/ |
| 34 |
function wpcf_get_path() { |
| 35 |
return untrailingslashit( plugin_dir_path( __FILE__ ) ); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Get the plugin classes path. |
| 40 |
* |
| 41 |
* @access public |
| 42 |
* @return string |
| 43 |
*/ |
| 44 |
function wpcf_get_class_path() { |
| 45 |
return untrailingslashit( plugin_dir_path( __FILE__ ) . '/classes/' ); |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
/* |
| 50 |
* loading plugin config file |
| 51 |
*/ |
| 52 |
require_once wpcf_get_path() . '/config.php'; |
| 53 |
|
| 54 |
/* ======= the plugin main class =========== */ |
| 55 |
require_once wpcf_get_class_path() . '/plugin.class.php'; |
| 56 |
|
| 57 |
/* |
| 58 |
* [1] |
| 59 |
* TODO: just replace class name with your plugin |
| 60 |
*/ |
| 61 |
$nmwpcomment = NM_PLUGIN_WPComments::get_instance(); |
| 62 |
NM_PLUGIN_WPComments::init(); |
| 63 |
|
| 64 |
|
| 65 |
if ( is_admin() ) { |
| 66 |
require_once wpcf_get_class_path() . '/admin.class.php'; |
| 67 |
} |