Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • I was having this same issue.

    wp_redirect( wp_logout_url( $foo ) ); would redirect me to /wp-login.php?action=logout& amp;redirect_to=%2Fabout%2F.

    The & was being escaped in wp_logout_url causing the logout action to send me along to /wp-login.php?loggedout=true. $_REQUEST['redirect_to'] was actually $_REQUEST['& amp;redirect_to'] causing it to default to the login page. Anyway, blah blah blah, read through the source code and fixed it with a filter inside my plugin:

    add_filter('logout_url', 'fix_logout_url');
    function fix_logout_url( $url )
    {
      $url = str_replace( '& amp;', '&', $url );
      return $url;
    }

    Basically wp_logout_url called wp_nonce_url which converts $amp; to & and then tops it off with an esc_html() converting & back to & amp;. Luckily there’s a nice filter to sneak in and correct it.

    Whew! Late night goose chase complete.

    just stumbled across this post…

    attachments are stored like regular posts in the posts table. caption and description are stored are post_excerpt and post_content.

    if you are getting attachments with get_children you could do something like

    if($images =& get_children( 'post_type=attachment' )){
       foreach($images as $image){
          $caption = $image->post_excerpt;
          $description = $image->post_content;
          //do whatever
       }
    }

    get_children

    hope that helps!

Viewing 2 replies - 1 through 2 (of 2 total)