Tag Info

Hot answers tagged

2

The wp_rand function mixes up the randomization of random numbers with various means, and in between runs it stores the random seed so as to keep the shuffling going every run. The random_seed transient is where it stores that.


2

The only really interesting (and very important) part of the 3rd query is this: 'project_location_children', 'a:7:{i:22;a:1:{i:0;i:23;}...etc...}}' The a:n:{i:n; etc } stuff is a serialized PHP array. WordPress - for some historical reason - keeps track of term children in one option entry per taxonomy term. The painful thing is, that a lot of people ...


2

The option you're showing in your question is a serialized array. Retrieving the option with get_option() gives you back the array, but unserialized. This is done by maybe_unserialize(), which get_option uses. Just add a new 'key' => 'value' pair to the array you retrieved and then update the option with update_option(), et voilĂ  you have added the ...


1

You can pass boolean false to supports to have post type support nothing at all. However note that: you might run into issues with saving "empty" posts (not having one of title/editor/excerpt) likely you still want it to support custom-fields at least, rather than nothing at all


1

I believe that if you are not going to do a massive sql insert (which I think is likely just as efficient) that you need to go ahead and utilize the plugin api and at the time of the button being pressed, create them. I think it's pretty clear your choice is either to create the widgets on the fly, or to import through an sql insert. ...


1

Can you just tell me how I can grab the input value for "name" and add the entry to custom_post_type? Sure thing: if ( isset( $_POST['name'] ) ) { $name = sanitize_text_field( wp_unslash( $_POST['name'] ) ); if ( $name ) { wp_insert_post( array( 'post_title' => $name, 'post_type' => ...


1

Definitely a really bad idea. Just send what you need, exposing all this data publicly opens a lot (and some more) attack vectors.



Only top voted, non community-wiki answers of a minimum length are eligible