_constants();
$this->_hooks();
}
protected function _constants() {
//Plugin Version
define( 'APT_PLUGIN_VER', '0.0.6' );
//Plugin Text Domain
define("APT_TXTDM","pricing-table" );
//Plugin Name
define( 'APT_PLUGIN_NAME', __( 'Pricing', APT_TXTDM ) );
//Plugin Slug
define( 'APT_PLUGIN_SLUG', 'abc-pricing' );
//Plugin Directory Path
define( 'APT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
//Plugin Directory URL
define( 'APT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'APT_SECURE_KEY', md5( NONCE_KEY ) );
} // end of constructor function
protected function _hooks() {
//Load text domain
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
//add testimonial menu item, change menu filter for multisite
add_action( 'admin_menu', array( $this, 'pricing_menu' ), 101 );
//Create pricing table Custom Post
add_action( 'init', array( $this, 'Pricing' ));
//Add meta box to custom post
add_action( 'add_meta_boxes', array( $this, 'admin_add_meta_box' ) );
//loaded during admin init
add_action( 'admin_init', array( $this, 'admin_add_meta_box' ) );
add_action('save_post', array(&$this, '_apt_save_settings'));
//Shortcode Compatibility in Text Widgets
add_action('widget_text', 'do_shortcode');
} // end of hook function
public function load_textdomain() {
load_plugin_textdomain( APT_TXTDM, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
public function pricing_menu() {
$theme_menu = add_submenu_page( 'edit.php?post_type='.APT_PLUGIN_SLUG, __( 'Our Theme', APT_TXTDM ), __( 'Our Theme', APT_TXTDM ), 'administrator', 'sr-theme-page', array( $this, 'apt_theme_page') );
$plugins_help_menu = add_submenu_page( 'edit.php?post_type='.APT_PLUGIN_SLUG, __( 'Our Plugins', 'APT_TXTDM' ), __( 'Our Plugins', 'GGP_TXTDM' ), 'administrator', 'pricing-featured-plugins-page', array( $this, '_abcpt_featured_plugins') );
}
public function Pricing() {
$labels = array(
'name' => _x( 'Pricing Table', 'post type general name', 'APT_TXTDM' ),
'singular_name' => _x( 'Pricing Table', 'post type singular name', 'APT_TXTDM' ),
'menu_name' => _x( 'Pricing Table', 'admin menu', 'your-plugin-textdomain' ),
'name_admin_bar' => _x( 'Pricing Table', 'add new on admin bar', 'APT_TXTDM' ),
'add_new' => _x( 'Add Pricing Table', 'APT_TXTDM' ),
'add_new_item' => __( 'Add Pricing Table', 'APT_TXTDM' ),
'new_item' => __( 'New Pricing Table', 'APT_TXTDM' ),
'edit_item' => __( 'Edit Pricing Table', 'APT_TXTDM' ),
'view_item' => __( 'View Pricing Table', 'APT_TXTDM'),
'all_items' => __( 'All Pricing Table', 'APT_TXTDM' ),
'search_items' => __( 'Search Pricing Table', 'APT_TXTDM' ),
'parent_item_colon' => __( 'Parent Pricing Table:', 'APT_TXTDM' ),
'not_found' => __( 'No Pricing Table.', 'APT_TXTDM' ),
'not_found_in_trash' => __( 'No Pricing Table found in Trash.', 'APT_TXTDM' )
);
$args = array(
'labels' => __( 'Pricing Table', APT_TXTDM ),
'description' => __( 'Description.', 'your-plugin-textdomain' ),
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
//'rewrite' => array( 'slug' => 'pricing' ),
'capability_type' => 'page',
'has_archive' => true,
'hierarchical' => false,
'menu_icon' => 'dashicons-cart',
'menu_position' => null,
'supports' => array( 'title'),
);
register_post_type( 'abc-pricing', $args );
}
public function admin_add_meta_box() {
add_meta_box( __('Add pricing table', APT_TXTDM), __('Add pricing table', APT_TXTDM), array(&$this, 'apt_pricing_upload'), 'abc-pricing', 'normal', 'default' );
add_meta_box( __('Upgrade pricing table Pro', APT_TXTDM), __('Upgrade pricing table Pro', APT_TXTDM), array(&$this, 'apt_upgrade_pro'), 'abc-pricing', 'side', 'default' );
add_meta_box( __('Rate Our Plugin', APT_TXTDM), __('Rate Our Plugin', APT_TXTDM), array(&$this, 'apt_rate_plugin'), 'abc-pricing', 'side', 'default' );
}
// meta upgrade pro
public function apt_upgrade_pro() { ?>
Live Demo
Upgrade Pro
If you like our plugin then please Rate us on WordPress