Пример #1
0
 function gafa_unsubscribe_from_acciones($data)
 {
     global $current_user;
     global $mensaje;
     parse_str($data, $data);
     $accionesIds = isset($data["acciones"]) ? $data["acciones"] : array();
     $accionesIdsCount = count($accionesIds);
     if (!$current_user) {
         $mensaje->add_error("No has iniciado sesión.");
         return;
     }
     $user = new \operaciondespierta\Usuario($current_user->ID);
     $user->UnsubscribeFromActions($accionesIds);
     $mensaje->add_mensaje("Has dejado de seguir {$accionesIdsCount} causas.");
 }
Пример #2
0
<?php

if (!is_user_logged_in()) {
    $redirectionUrl = get_page_link(INSCRIBIRSE);
    header("location: {$redirectionUrl}");
    die;
}
get_header();
global $current_user;
$ususario = new \operaciondespierta\Usuario($current_user->ID);
$acciones = $ususario->GetSubscribedActions(array("posts_per_page" => -1));
?>
<div class="Fundacion-info">
    <div class="Fundacion-info-15px text-center bold"><?php 
echo $current_user->nickname;
?>
, <br> <?php 
echo $acciones ? "estas son las causas a las que te has inscrito" : "No te has suscrito a ninguna accion.";
?>
</div>
    <form data-gafa-form="unsubscribe-from-acciones">
    <div class="causas">
        <?php 
/**
 * @var $accion \operaciondespierta\Accion
 */
foreach ($acciones as $i => $accion) {
    ?>
            <a href="<?php 
    echo get_permalink($accion->id);
    ?>