Comments (9)
Unfortunately not, but its a good idea, I'll have a look into it. Thanks :)
from wp-custom-post-type-class.
I tested using 'post' as the post type and it actually works. You do a check if the post type was previously registered so it doesn't conflict.
from wp-custom-post-type-class.
Awesome! Thanks for trying it out and getting back.
from wp-custom-post-type-class.
@jjgrainger Although It does work at adding taxonomies and all other features, registering posts with this plugin breaks other plugins and not sure why. So it cannot be used as is.
from wp-custom-post-type-class.
@matthewsoares Yeah, I never really built it to be used with post types already registered, but I will be working on making this possible, without breaking.
Could you give me some details as to what you've tried to do with the CPT class and what plugins its affected.
Thanks :)
from wp-custom-post-type-class.
Thanks for you looking into this. I think it's a good addition.
For example I get this warning.
Notice: Undefined property: CPT::$ID in wp-includes/query.php on line 3939 Notice: Undefined property: CPT::$post_author in wp-includes/query.php on line 3941 Notice: Undefined property: CPT::$post_date in wp-includes/query.php on line 3943 Notice: Undefined property: CPT::$post_date in wp-includes/query.php on line 3944 Notice: Undefined property: CPT::$post_content in wp-includes/query.php on line 3952 Notice: Undefined property: CPT::$post_content in wp-includes/query.php on line 3967
from wp-custom-post-type-class.
@matthewsoares Are you getting this error because you're passing the CPT object into a wp_query
or query
?
Could you give me some additional details as to what it is you're trying to do with the class and what plugins you have installed etc?
Thanks :)
from wp-custom-post-type-class.
using $post = new CPT('post'); was giving me issues. Maybe was conflicting with some global vars in my functions. Using $dtpost = new CPT('post'); for example it works. Sorry for the confusion, all is well now.
from wp-custom-post-type-class.
@matthewsoares Good detective work. The $post
variable you where using with the class was conflicting with one of the Wordpress global variables (codex).
Thanks for getting back, enjoy :)
from wp-custom-post-type-class.
Related Issues (20)
- Add contributing guide
- Sorting Taxonomies HOT 2
- Add field "type" in composer.json HOT 1
- Setting labels HOT 1
- cut 'post' HOT 5
- How to translate post type name HOT 5
- Add menu_position HOT 4
- Won't register on add_action('init') HOT 1
- Custom taxonomy not registering HOT 2
- Changing the bulk actions
- How do I add field price HOT 2
- Adding post_row_actions
- Category HOT 2
- Adding custom columns removed wordpress edit, quick edit, trash and view links HOT 1
- Has Archive HOT 3
- Display custom post type tags HOT 6
- is it possible to pass show_in_nav_menus? HOT 3
- Unable to sort on menu_order
- Taxonomy generating problem
- time to add taxonomy colums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-custom-post-type-class.