Plugin Directory

Changeset 563377


Ignore:
Timestamp:
06/25/2012 02:43:41 AM (14 years ago)
Author:
technosis
Message:

fixing template scanner by adding cookies to request (must be signed in to use the preview feature)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • templ33t/branches/01_02_handling_posts/templ33t_object.php

    r563350 r563377  
    680680        $tname = str_replace('.php', '', basename($template));
    681681       
    682         $preview = wp_remote_get(site_url('?preview=1&template='.$theme.'&stylesheet='.$theme.'&templ33t_preview='.$tname.'&preview_iframe=1&TB_iframe=true'));
     682        // put together cookies
     683        $cookies = array();
     684        if(!empty($_COOKIE)) {
     685            foreach($_COOKIE as $key => $val) {
     686                    $c = new WP_Http_Cookie($key);
     687                    $c->name = $key;
     688                    $c->value = $val;
     689                    $c->domain = COOKIE_DOMAIN;
     690                    $cookies[] = $c;
     691            }
     692        }
     693       
     694        $preview = wp_remote_get(site_url('?preview=1&template='.$theme.'&stylesheet='.$theme.'&templ33t_preview='.$tname.'&preview_iframe=1&TB_iframe=true'), array('cookies' => $cookies));
    683695       
    684696        if(!is_wp_error($preview)) {
Note: See TracChangeset for help on using the changeset viewer.