Using Cforms and Memberwing on WordPress

W hile my nights are spent defending the rights of A.D.D.ers throughout Gotham City, during the day I’m a mild-mannered web developer. One of my on-going tasks as a web developer is the maintenance of a membership-based website. Paid members come to the website and, after logging in, they can access the members-only sections of the site. Recently I needed to add a new section to the website that would have a sign-up form that is only accessible to members. Since the website is based on WordPress, I created this sign-up form using a combination of three plugins – CForms II (for forms creation); Exec-PHP (for executing PHP code within a post or page); Member-Wing (for creating protected pages/posts in WordPress) – and a bit of PHP script.

Here are the steps for creating a “protected” form using these three plugins (assuming you installed and activated them).

1. Create your sign up form in CForms. Make note of the name of the form. You’ll need it later.

2. Go to the page or post where you want to create the protected form.

3. Switch the editor to HTML mode. Below is the code you’ll need.

<h2>This is a Members-Only Meeting</h2>
global $user_ID;
if ( '' != $user_ID ) insert_cform('THE NAME OF YOUR FORM GOES HERE');

Explanation of the Code


This code (brace, plus sign, brace) is used by MemberWing to mark premium content, that is, content that is only accessible to paid members. (See the note about “premium content” for more information.) Anything that appears below this code will not be visible to a visitor unless they are logged into the website. For example, going to the page without logging in, a visitor sees the following.

global $user_ID;
if ( '' != $user_ID ) insert_cform('THE NAME OF YOUR FORM GOES HERE');

If the visitor is logged in, then their user ID will not be equal to an empty string. Therefore, the insert_cform command used by CForms will display the form.

This is what the visitor sees after logging in.

Why Not Use This Code – <!–cforms name=”XYZ”–> – To Insert The Form?

You may be wondering why I had to use three plugins and some PHP code to create this members-only sign-up form. The reason is that if you just use the code <!–cforms name=”XYZ”–> to insert the form in your post or page, the form will be automatically inserted regardless of the premium content designation. That is, it will ignore the {+} because, well, it doesn’t “see” it.


Print Friendly

ADHD: Awesome and Deadly

An email from an ADHDer. Subject: Open this email I have ADD and I want to share! Message: Hi Jeff, [...]

What It Feels Like To Have ADHD

ADHD – A Love Story (Part 6)

The Trap is Set

The Wanderer

The Child Within The Man

ADHD – A Love Story (Part 5)

The System Is Blinking Red

ADHD – A Love Story (Part 4)

A Quick Bite

ADHD – A Love Story (Part 3)

Thick As A Brick

How Do You Know If You Have ADHD?

The Warning Signs of ADHD

ADHD – A Love Story (Part 2)

Warning Signs

ADHD – A Love Story (Part 1)

The Ground Shakes

A Cure for ADHD

Satisfaction Guaranteed Or Your Money Back!

The Perfect Month

What A Great Time Of Year

That’s What I Call ADHD-Friendly Software

A recent ADHD newsletter noted that The Brain — a mind mapping software — might be a useful tool for [...]

Life in the Modern Age

Sixteen months ago I moved from the world of entrepreneurship — a portmanteau comprised of the French word entrepreneur, which [...]

E-Card Fun

Some more e-card humor: Expressing Your ADHD Self…Digitally A Few Laughs, Giggles & Groans

While Rome Burns

I’ve started collecting screenshots of online advertising. I’m trying to understand the message. The ad below says that if I’m [...]

Kiss Your Distractions Goodbye

Do one thing at a time

ADHD Does Not Exist

I can’t tell what is more disturbing. A book titled “ADHD Does Not Exist: The Truth About Attention Deficit and [...]