How to Create a WordPress Logout Shortcode

Categories

//WordPress Logout Shortcode
function logout_func ($atts, $content = null) {
extract(shortcode_atts(array(
‘linktext’ => ‘Log Out’,
), $atts));
$logoutlink = wp_logout_url( home_url() );
return ‘‘. $linktext .’‘;
}
add_shortcode( ‘wplogout’, ‘logout_func’ );
?>

// Example Usage:
// [wplogout linktext=”YES”] – if you don’t specify linktext, will just display “Log Out”

Want more digital strategy advice and insights?

Sign up for our newsletter.
!
!
Something went wrong. Please check your entries and try again.

Joseph Riviello

Joseph L. Riviello is the CEO and Founder of Zen Agency. Joe's agency builds websites and web applications that attract, engage, and convert. Joe has over 30 years of experience in entrepreneurship and he is an expert digital marketing strategist who specializes in conversion-centric e-commerce experiences and cutting-edge solutions that maximize growth and profit. Check out Joe featured on: Business.com, Redbooth.com, Kabbage.com, MaterialDesignBlog.com

Leave a Comment

You must be logged in to post a comment.

See more digital strategy posts

 
 

 

 
Why Your Brand Must Reduce Churn 

Why Your Brand Must Reduce Churn 

September 7, 2020
For most advertisers, the 80/20 rule is practically etched in stone: 80% of your revenue will be produced by 20%...
Reality Vs. Perception: Why You Must Use Data to Steer Your Marketing 

Reality Vs. Perception: Why You Must Use Data to Steer Your Marketing 

September 4, 2020
Before the term “digital marketing” even existed, things were pretty simple. In traditional methods of marketing, it was quite easy...
Zen Agency Receives Gold Certification in Sharpspring Partner Certification Program

Zen Agency Receives Gold Certification in Sharpspring Partner Certification Program

July 23, 2020
WYOMING, PA, July 14th, 2020 Zen Agency, a full-service web development & digital marketing agency, obtained Gold-Level Certification in Sharpspring’s...
5 Secrets of Successful Content Marketing Companies

5 Secrets of Successful Content Marketing Companies

January 10, 2020
As the landscape of business changes on a daily basis, the importance of your brand's online presence only grows. With...
WooCommerce SEO Secrets to Rank High in Google

WooCommerce SEO Secrets to Rank High in Google

May 14, 2019
WooCommerce is a great eCommerce solution for many reasons. But if you're coming to this blog, you're well aware of...