Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commiteb94b69b25874885871f6bd63ac09f21cf3abd49 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2020-07-02 18:25:51 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2020-07-02 18:25:51 +0300
Files032c86587178c49977488b03e81a5e14676b8913
tues-interns-2020-eb94b69b25874885871f6bd63ac09f21cf3abd49.tar
tues-interns-2020-eb94b69b25874885871f6bd63ac09f21cf3abd49.tar.gz
tues-interns-2020-eb94b69b25874885871f6bd63ac09f21cf3abd49.zip
Parent0cb132edda1e194c3628b2ada0d1158c75348c75 (diff)
Implimented vechicles cpt. Fixed issue 41.
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();