When programming for WordPress, sometimes you may need to get the ID of the last post that was inserted to the database (à la MySQL’s ‘LAST_INSERT_ID’). Here’s the thing: the wp_insert_post() function returns the newly inserted post’s ID, so you can use it to perform more stuff on the post right away, without having to mess around with any SQL commands to retrieve it. Clever, huh?
FIND SOMETHING
Pages
Tags
-
TWITTER FAVES
- @zeldman: "Magazines must step away from the "print business" and realize they are in the *content* business. @karenmcgrane #adaptivecontent #aea"
- @lukew: "Hacking Your Users Brains http://t.co/DhQmmlc1 my notes from @uxresearch talk at #aea about getting into customer's heads."
- @marketingwizdom: "Tip: Advertising says to people, 'Here's what we've got. Here's what it will do for you. Here's how to get it.' Leo Burnett"
- @jaffathecake: ".@uxresearch's eye tracking example on page 34 http://t.co/NkQKjaBu is fascinating #aea"
- @knell_belle: "Think of the user as a dog playing catch... try to avoid introducing a squirrel. #aea"
- @meyerweb: "“The web is a series of contextual content encounters.” —@zeldman #AEA"
- @smashingmag: "New on Smashing WP: How To Use Custom Post Types To Organize Online Marketing Campaigns - http://t.co/gStbpfJy"
- @vq20: "RT @leisa: Some rough notes from my @monkigras talk 'Why Most UX is Shite' http://t.co/bez1NfEx #ux #truth"
- @SusanCosmos: ""Your only limitation is how much action you are willing to take." - Carrie @barefoot_exec Wilkerson #quote"
- @lukew: "Incidentally performance optimization is a big reason companies still make separate mobile sites. http://t.co/F4XijCd3"