Beispiel #1
0
 if (defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) {
     return $post_id;
 }
 if (wp_is_post_revision($post_id) or wp_is_post_autosave($post_id)) {
     return $post_id;
 }
 if (isset($_POST['tiempo_preparacion']) and check_admin_referer(__FILE__, '_extras_receta_nonce')) {
     update_post_meta($post_id, 'tiempo_preparacion', $_POST['tiempo_preparacion']);
     update_post_meta($post_id, 'numero_personas', $_POST['numero_personas']);
     update_post_meta($post_id, 'nivel_de_preparacion', $_POST['nivel_de_preparacion']);
     update_post_meta($post_id, 'pasos_preparacion', $_POST['pasos_preparacion']);
 }
 if (isset($_POST['ingredientes']) and check_admin_referer(__FILE__, 'ingredientes_nonce')) {
     if (!empty($_POST['ingredientes'])) {
         foreach ($_POST['ingredientes'] as $ingredientes) {
             storeShipIngredients($post_id, $ingredientes);
         }
     }
 }
 if (isset($_POST['costo_visita']) and check_admin_referer(__FILE__, '_datos_visitas_nonce')) {
     update_post_meta($post_id, 'costo_visita', $_POST['costo_visita']);
     update_post_meta($post_id, 'capacidad_visita', $_POST['capacidad_visita']);
     update_post_meta($post_id, 'persona_extra_visita', $_POST['persona_extra_visita']);
     update_post_meta($post_id, 'persona_extra_visita_2', $_POST['persona_extra_visita_2']);
 }
 if (isset($_POST['latitud_contacto']) and check_admin_referer(__FILE__, '_latlong_nonce')) {
     update_post_meta($post_id, 'latitud_contacto', $_POST['latitud_contacto']);
     update_post_meta($post_id, 'longitud_contacto', $_POST['longitud_contacto']);
 }
 if (isset($_POST['telefono_c']) and check_admin_referer(__FILE__, '_info_cont_nonce')) {
     update_post_meta($post_id, 'telefono_c', $_POST['telefono_c']);
Beispiel #2
0
/**	
 * ACTUALIZA LOS INGREDIENTES DE TEMPORADA
 * @param  [array] $data [description]
 * @return [type]       [description]
 */
function saveSeasonalIngredients($data)
{
    $ingredientes = isset($data['ingredientesTemporada']) ? $data['ingredientesTemporada'] : array();
    if (!empty($ingredientes)) {
        destroyShipIngredients(0);
        foreach ($ingredientes as $ingrediente) {
            storeShipIngredients(0, $ingrediente);
        }
    }
}