How to fix "unexpected T_CONSTANT_ENCAPSED_STRING" syntax error?
        Posted  
        
            by 
                user2534376
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user2534376
        
        
        
        Published on 2013-06-29T10:16:29Z
        Indexed on 
            2013/06/29
            10:21 UTC
        
        
        Read the original article
        Hit count: 216
        
php
I have the following code:
function wp_logout_url($redirect = '') {
$args = array( 'action' => 'logout' );
if ( !empty($redirect) ) {
    $args['redirect_to'] = urlencode( $redirect );
}
$logout_url = add_query_arg($args, site_url(wp-login.php', 'login'));
$logout_url = wp_nonce_url( $logout_url, 'log-out' );
return apply_filters('logout_url', $logout_url, $redirect);
}
But I get the following error:
Parse error: syntax error, unexpected
T_CONSTANT_ENCAPSED_STRING
How can I fix this?
© Stack Overflow or respective owner