Reputation
Next privilege 10,000 Rep.
Access moderator tools
Badges
13 33
Newest
 Proofreader
Impact
~360k people reached

1h
reviewed Edit How to make WordPress use new Upload Path settings in Multisite Setup
1h
revised How to make WordPress use new Upload Path settings in Multisite Setup
Changed layout to make it easier for reading
5h
answered Elegant way to add parent categories?
6h
comment What is the impact if i ignore title and content in my custom post types CPT?
Ok if you are happy with Auto Draft as your title then no problem... You can always overwrite that too much like you are the status.
6h
revised What is the impact if i ignore title and content in my custom post types CPT?
added 259 characters in body
6h
comment What is the impact if i ignore title and content in my custom post types CPT?
It will be blank, the only thing that is mandatory is actually post_content, the slug will get set for you if no title is provided, but if you do not provide any value for post_content then the post will be set to post_status = auto-draft and the title then gets set to "Auto Draft"
6h
comment What is the impact if i ignore title and content in my custom post types CPT?
Yes, from a client view perspective WP will just output (no title) where a post has no title, but the slug, post_name column in the database will contain the post ID, e.g. 1234, and thus that becomes the slug because you need a way to uniquely identify the object from a permalink standpoint. As mentioned you can filter the slug before insertion if you want to generate something more meaningful.
6h
revised What is the impact if i ignore title and content in my custom post types CPT?
added 172 characters in body
7h
answered What is the impact if i ignore title and content in my custom post types CPT?
1d
comment Storing posts from query and accessing later via AJAX call
@BarberCraig yeah, cybmeta is right on this. I also mentioned it above in my comments... object cache is not going to help you because once you make the request, store your result in the object cache and the page finishes loading, your object cache value is gone. Any AJAX request you make back to the server after your initial request is an additional request, e.g. request #2. The only way to access the result again is to set and get a transient value.
1d
comment Storing posts from query and accessing later via AJAX call
Just remember that the default object cache implementation provided by WordPress only persists over the life of the request, so if you hit the database, cache the result and request terminates execution, you cannot access the result stored in cache. So you may want to also look at the Transient API as I mentioned, cybmeta provides an example below...
1d
comment Storing posts from query and accessing later via AJAX call
WordPress provides both an object cache (non-persistent) and a tranisent API (persistent within the database) that you could use to store the query for later. Other persistent solutions required more advanced configuration. How many posts are you pulling into the page? How much data? You could return all the results and store them on the DOM node using jQuery.data(). For persisting results in the database you can store the result in a transient, then you would query the transient for the data you need. It would still require that you hit the database but it is computationally less expensive.
1d
answered What SQL / WordPress queries would need a nonce?
1d
comment Edit meta data does't work with custom sql
I'll look, however if this answer helped you solve your problem please mark it as accepted so as it may help others facing similar issues.
1d
comment Edit meta data does't work with custom sql
No problem... There's nothing you can't do with WordPress than you can with PHP as WordPress is PHP (and of course JavaScript). WordPress just provides it's own core API to abstract away things that are common tasks. There's plenty of hooks (actions and filters) that allow you to do a lot. Of course nothing stops you from writing your own functions and classes which may or may not make use of core functions. You can learn a lot just by using this site alone (which is an invaluable resource) or refer to the WordPress source code or Codex/Developer docs.
1d
comment Edit meta data does't work with custom sql
You can write your variables directly into the query, that is fine. In my example, I named them so it's clear what they are for any prospective persons in the future that might be reading this it's easier to understand. Also, if it were me, I would leave them as they are and instead encapsulate the call in a function or class method e.g. wpse_update_meta($table, $post_id, $meta_key, $meta_value) so that my logic remained clean and easy to follow. It almost begs the question; what's wrong with using update_post_meta()?
1d
comment Contact Form 7 Dropdown menu populated with post titles, pre selected from url
What have you tried? What code have you written and what is not working?
1d
revised Edit meta data does't work with custom sql
added 366 characters in body
1d
comment Edit meta data does't work with custom sql
That will work because WordPress sets the prefix on core tables, so when you access the class property $postmeta it would have already been set to {prefix}postmeta prior to access. However it is just good habbit to call upon $wpdb->prefix or $wpdb->base_prefix depending on which you need for the aforementioned reasons above.
1d
revised Edit meta data does't work with custom sql
added 23 characters in body