Exemplo n.º 1
0
function lpo_pre($var)
{
    $html = '<pre>';
    $html .= print_r($var, true);
    $html .= '</pre>';
    lpo_logit($html);
}
Exemplo n.º 2
0
function lpo_process_gforms($entry, $form)
{
    $site = LPO_Site::$active_site;
    if ($site === null) {
        lpo_logit("ERROR: " . __FILE__ . ":" . __LINE__ . ": Active site was not set!");
        return;
    }
    // Setup the lpo_site custom post type
    $site->id = $entry['post_id'];
    $u = get_userdata($entry['created_by']);
    $site->post_meta['_lpo_sandbox'] = $u->user_login . ".lpobox.com";
    $site->update_post_meta();
}
Exemplo n.º 3
0
function lpo_remove_all_sites()
{
    $loop = lpo_get_site_loop();
    if ($loop == null) {
        $html .= "Rats something smells fishy, we could not the the Sites loop";
        return $html;
    }
    lpo_logit(__FUNCTION__ . ": removing all lpo_site posts");
    // Loop through all the sites and print them as a list.
    while ($loop->have_posts()) {
        $post = $loop->the_post();
        lpo_logit('    removing post id: ' . $post->ID);
        wp_delete_post($post->ID);
    }
}
Exemplo n.º 4
0
 function populate_from_form($entry)
 {
     global $lpo_forms_map;
     $this->id = $entry['post_id'];
     $this->wp_user_id = $entry['created_by'];
     $form_id = $entry['form_id'];
     if (!array_key_exists($form_id, $lpo_forms_map)) {
         lpo_logit("Could not find form id: " . $form_id . " will not be able to create site post");
         return null;
     }
     $map = $lpo_forms_map[$form_id];
     /*
      * We'll gather together all of the meta keys and values
      */
     foreach ($entry as $fld => $v) {
         if (array_key_exists($fld, $map)) {
             $metakey = $map->map[$fld];
             $this->post_meta[$metakey] = $v;
         }
     }
     return $this->post_meta;
 }