Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / plugins
diff options
context:
space:
mode:
2 files changed, 36 insertions, 3 deletions
-rw-r--r--wp-content/plugins/dx-cars/class.cpt.php23
-rw-r--r--wp-content/plugins/dx-cars/dx-cars.php16
diff --git a/wp-content/plugins/dx-cars/class.cpt.php b/wp-content/plugins/dx-cars/class.cpt.php
index e69de29..f439934 100644
--- a/wp-content/plugins/dx-cars/class.cpt.php
+++ b/wp-content/plugins/dx-cars/class.cpt.php
@@ -0,0 +1,23 @@
+<?php
+class Vehicles {
+ function init() {
+ add_action( 'init', array( $this, 'cpt_create' ) );
+ }
+
+ public function labels() {
+ $arr = array(
+ 'labels' => array(
+ 'name' => __( 'Vehicles' ),
+ 'singular_name' => __( 'Vechicle' )
+ ),
+ 'public' => true,
+ 'has_archive' => true,
+ 'rewrite' => array( 'slug' => 'vechicles' ),
+ 'show_in_rest' => true, );
+ return $arr;
+ }
+
+ function cpt_create() {
+ register_post_type( 'Vechicles', $this->labels() );
+ }
+}
diff --git a/wp-content/plugins/dx-cars/dx-cars.php b/wp-content/plugins/dx-cars/dx-cars.php
index 5e32617..90cc6ec 100644
--- a/wp-content/plugins/dx-cars/dx-cars.php
+++ b/wp-content/plugins/dx-cars/dx-cars.php
@@ -1,4 +1,14 @@
-<?php
+<?php
/**
- * Plugin Name: DX Cars
- */ \ No newline at end of file
+ * Plugin Name: DX Cars
+ * Plugin URI: https://devrix.com
+ * Description: Plugin for handling cars
+ * Version: 0.1
+ * Author: DevriX-interns-2020
+ * Author URI: https://devrix.com
+ * Text Domain: dx-cars
+ */
+ include 'class.cpt.php';
+
+ $cars = new Vehicles;
+ $cars->init();