mrlarner
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: wp_logout_url not redirectingI 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 inwp_logout_urlcausing 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_urlcalledwp_nonce_urlwhich converts$amp;to&and then tops it off with anesc_html()converting&back to& amp;. Luckily there’s a nice filter to sneak in and correct it.Whew! Late night goose chase complete.
Forum: Themes and Templates
In reply to: Getting image metadatajust stumbled across this post…
attachments are stored like regular posts in the posts table. caption and description are stored are
post_excerptandpost_content.if you are getting attachments with
get_childrenyou could do something likeif($images =& get_children( 'post_type=attachment' )){ foreach($images as $image){ $caption = $image->post_excerpt; $description = $image->post_content; //do whatever } }hope that helps!