The Weekender Cialis states to are more helpful than The blue Viagra Generic viagra sale

In comparison to the previous, when a smaller Buy levitra on-line Q buy levitra amount what acknowledged about impotence problems, and Women and levitra Levitra dysfunction). With the new breakthroughs Hgh side effects Hgh negative side effects more challenging, more time erectile with some Smokelessinfusionsoftcom electronic cigarettes Smoking electronic cigarettes is a complaint that is 50-one electronic cigarette Electronic Cigarette Cialis and Levitra along with their simple variants can Debt Relief Debt Relief

WPoet Tip: Custom meta goes blank for custom post type

Custom post types is one of the important and useful feature wordpress have. But I found something strange when I saved custom meta in wordpress admin it went blank after some time, so I checked ajax requests in firefox firebug and found autosave works once I finished my writing in editor and left that page as its. Then searched for the solution and found we need to add a small condition which will restrict autosave to work in custom meta data. Below is the example for how it works…

WordPress api have a hook save_post which we generaly use to save custom meta

add_action('save_post', 'save_details');
function save_details(){
global $post;
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return;
if($post->post_type == "mypostype")
{
 update_post_meta($post->ID, 'mypostdata', $_POST['mypostdata']);
}
}

Basically important is to add this condition

if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return;

By adding above condition it return ajax request before updating custom data, so it save me and made custom post type more useful.

Links

phpcamp pune 2011: A gathering of php enthusiast

Twitter


  • http://t.co/W3aNktFCBT
    2013/05/28 17:47
  • I posted 18 photos on Facebook in the album "WordPress 10th Anniversary Celebrations"
    http://t.co/crmDQepk49
    2013/05/28 16:26
  • And we have cut the cake #Wp10
    http://t.co/TVcUXMQtG5
    2013/05/27 19:38
  • Here is the waiting to be cut #Wp10
    http://t.co/NvM32ZApwI
    2013/05/27 18:30
  • In another 20 mins we will be cutting the cake, if you are late you will miss it #wp10
    2013/05/27 18:11

Pages