Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Product Database
- Description: Versatile product database
- Version: 1.0.0
- Author: James Bruce
- Author URI: http://make-money-blogging-ideas.com/
- */
- if (!class_exists("Products")) {
- class Products {
- function Products(){
- add_action('init', array(&$this,'products_init'));
- register_activation_hook(__FILE__, 'my_rewrite_flush');
- }
- // declare the new post type 'sites'
- function products_init() {
- $args = array(
- 'labels' => array(
- 'name' => __('Products'),
- 'singular_name' => __('Product'),
- ),
- 'public' => true,
- 'rewrite' => array("slug" => "products"), // permalink structure
- 'supports' => array('thumbnail','custom-fields','title','editor','comments'),
- 'has_archive' => true
- );
- register_post_type( 'products' , $args );
- }
- function my_rewrite_flush() {
- products_init();
- flush_rewrite_rules();
- }
- }
- if (!isset($pd_plugin_instance)) $pd_plugin_instance = new Products();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement