Skip to content

Commit f9802a1

Browse files
committed
Some bug fixed
1 parent fe2794f commit f9802a1

File tree

8 files changed

+8
-36
lines changed

8 files changed

+8
-36
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# WP CRUD Project With vue
1+
# WP CRUD Project With Vue
22

33
#### A simple CRUD plugin for WordPress using vue js.
44

@@ -22,7 +22,6 @@
2222
* Change all the `CRUDPROJECT` to YOUR-PLUGINNAME (Upper case)
2323
* Change all the `CrudProject` to Your-PluginName (Upper Camel Case)
2424
* Change all the `Crud_Project` to Your-Plugin_Name
25-
* Change all the `crud_project` to your-plugin_name
2625

2726

2827
## All done have fun

assets/js/boot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78332,8 +78332,8 @@ element_ui_lib_locale__WEBPACK_IMPORTED_MODULE_2___default.a.use(element_ui_lib_
7833278332
/*! no static exports found */
7833378333
/***/ (function(module, exports, __webpack_require__) {
7833478334

78335-
__webpack_require__(/*! /Users/zoos/Downloads/sites/wp/wp-content/plugins/crud-project-plugin-with-vuejs/src/js/boot.js */"./src/js/boot.js");
78336-
module.exports = __webpack_require__(/*! /Users/zoos/Downloads/sites/wp/wp-content/plugins/crud-project-plugin-with-vuejs/src/scss/admin/app.scss */"./src/scss/admin/app.scss");
78335+
__webpack_require__(/*! /Users/zoos/Downloads/sites/wp/wp-content/plugins/wp-crud-project-plugin-with-vuejs/src/js/boot.js */"./src/js/boot.js");
78336+
module.exports = __webpack_require__(/*! /Users/zoos/Downloads/sites/wp/wp-content/plugins/wp-crud-project-plugin-with-vuejs/src/scss/admin/app.scss */"./src/scss/admin/app.scss");
7833778337

7833878338

7833978339
/***/ })

assets/js/crud_project.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ __webpack_require__.r(__webpack_exports__);
221221
message: 'Post successfully Created',
222222
type: 'success'
223223
});
224-
225-
console.log(response.data.post_id);
226224
}).fail(function (error) {
227225
console.log(error);
228226
});
@@ -313,7 +311,7 @@ __webpack_require__.r(__webpack_exports__);
313311
route: 'edit_post',
314312
post_id: this.$route.params.id
315313
}).then(function (response) {
316-
_this.post = response.data.post; // console.log(this.$route.params.id);
314+
_this.post = response.data.post;
317315
}).fail(function (error) {
318316
console.log(error);
319317
});
@@ -544,7 +542,6 @@ __webpack_require__.r(__webpack_exports__);
544542
});
545543
},
546544
showModal: function showModal(data) {
547-
console.log(data);
548545
this.activeID = data.ID;
549546
this.activeTitle = data.post_title;
550547
this.dialogVisible = true;
@@ -574,12 +571,10 @@ __webpack_require__.r(__webpack_exports__);
574571
handleSizeChange: function handleSizeChange(val) {
575572
this.per_page = val;
576573
this.fetchPosts();
577-
console.log("".concat(val, " items per page"));
578574
},
579575
handleCurrentChange: function handleCurrentChange(val) {
580576
this.page_number = val;
581577
this.fetchPosts();
582-
console.log("current page: ".concat(val));
583578
}
584579
},
585580
mounted: function mounted() {
@@ -3970,7 +3965,7 @@ var routes = [{
39703965
/*! no static exports found */
39713966
/***/ (function(module, exports, __webpack_require__) {
39723967

3973-
module.exports = __webpack_require__(/*! /Users/zoos/Downloads/sites/wp/wp-content/plugins/crud-project-plugin-with-vuejs/src/js/main.js */"./src/js/main.js");
3968+
module.exports = __webpack_require__(/*! /Users/zoos/Downloads/sites/wp/wp-content/plugins/wp-crud-project-plugin-with-vuejs/src/js/main.js */"./src/js/main.js");
39743969

39753970

39763971
/***/ })

includes/Classes/AdminAjaxHandler.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ public function handleEndPoint()
3232
'update_post' => 'updatePost',
3333
'create_post' => 'createPost',
3434
'delete_post' => 'deletePost',
35-
//'get_post' => 'getPost'
36-
3735
);
3836
if (isset($validRoutes[$route])) {
3937
do_action('crud_project/doing_ajax_events_' . $route);
@@ -72,22 +70,6 @@ protected function editPost(){
7270

7371
}
7472

75-
// frontend
76-
// protected function getPostPreview($postId)
77-
// {
78-
// dd($postId);
79-
80-
// $postId = absint($_REQUEST['post_id']);
81-
// $post = Posts::getPostDB($postId);
82-
83-
// wp_send_json_success(array(
84-
// 'post' => $post
85-
// ), 200);
86-
// }
87-
88-
89-
90-
9173
// update post
9274
protected function updatePost(){
9375

@@ -165,6 +147,5 @@ protected function deletePost(){
165147
), 200);
166148
}
167149

168-
169-
150+
170151
}

includes/Classes/Models/Posts.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ public static function getPostsDB($args = array())
4141
}
4242

4343
$posts = $postsQuery->get();
44+
4445
$total = $postsQuery->count();
4546

4647
// frontend Preview link
4748
foreach ($posts as $post) {
4849
$post->preview_url = site_url('?wp_crudproject_preview=' . $post->ID);
50+
$post->post_content = wp_strip_all_tags($post->post_content);
4951
}
5052

5153
$posts = apply_filters('crudproject/get_all_posts', $posts);

src/js/Components/AddNewPost.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export default {
5858
message: 'Post successfully Created',
5959
type: 'success'
6060
});
61-
console.log(response.data.post_id);
6261
})
6362
.fail(error => {
6463
console.log(error);

src/js/Components/AllPosts.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@
142142
143143
},
144144
showModal(data){
145-
console.log(data);
146145
this.activeID = data.ID;
147146
this.activeTitle = data.post_title
148147
this.dialogVisible = true
@@ -172,12 +171,10 @@
172171
handleSizeChange(val) {
173172
this.per_page = val;
174173
this.fetchPosts();
175-
console.log(`${val} items per page`);
176174
},
177175
handleCurrentChange(val) {
178176
this.page_number = val;
179177
this.fetchPosts();
180-
console.log(`current page: ${val}`);
181178
}
182179
},
183180

src/js/Components/EditPost.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export default {
5151
})
5252
.then(response => {
5353
this.post = response.data.post;
54-
// console.log(this.$route.params.id);
5554
})
5655
.fail( error => {
5756
console.log(error);

0 commit comments

Comments
 (0)