URL Parameter WordPress Shortcode Plugin

The other day I was setting up a form on the consulting page with Gravity Forms. If you haven’t used Gravity Forms yet, you really should. It has this really cool feature where when the user finishes filing out a form they can be redirected to a URL of your choice. This URL can then contain a query string that can be used to capture data or personalize a thank you message. I love that idea because it makes form confirmation so much more friendly. Take a look at my thank you page as an example. However WordPress does not include an easy method of capturing these query values to display in content.

So I knew it was time to create a plugin! The full source code is found below. Heres how it works:

Lets say that you have a URL like so: http://joehall.me/thank/?fname=John and you want to print the value for “fname” in the text of the page. Then all you need to do is install the plugin below and use the following shortcode where ever you’d like to print that value.

Selection_004

 

Full Source

/**
 * Plugin Name: URL Parameter Shortcode Plugin
 * Plugin URI: http://joehall.me/url-parameter-wordpress-shortcode-plugin/21/
 * Description: A shortcode to display the value of a parameter in a URL query string.
 * Version: 1
 * Author: Joe Hall
 * Author URI: http://joehall.me/
 * License: GPL2
 */

function parameters_func( $atts ) {
 $a = shortcode_atts( array(
 'parameter' => '',
 ), $atts );
$q = $a['q'];
return $_GET[$q];
}
add_shortcode( 'parameters', 'parameters_func' );

No Longer A Ninja, But There Is More To Come!

1 year, 8 months, 22 days ago I took the position of Senior Marketing Analyst at Internet Marketing Ninjas. It has been an amazing experience filled with awesome memories and opportunities. However, this was my last week working at IMN. Jim Boykin has done an amazing job assembling a stellar team of digital marketers that […]

Continue reading...

How To Switch To HTTPS URLs For Optimal SEO

Https

Last week Google announced that the use of HTTPS or SSL security certificates will be added to their long list of ranking factors. How much influence will using SSL certificates have on rankings? Who knows. But because Google has formally stated that this is in fact a ranking factor, it now should be considered an […]

Continue reading...

Why I Support The Civil Rights Of The Gay, Lesbian, Bisexual, and Transgender Communities

equal

I am a straight white man with a genetic disability, who was born and raised in South Carolina, and I support the full civil rights of the gay, lesbian, bisexual, and transgender communities. A lot of folks might not understand why I feel the need to express this support. Many may be confused why a […]

Continue reading...

Updated Design From Copyblogger/StudioPress :)

studiopress logo

I bought my first theme from StudioPress in April of 2009 and to be completely honest I have loved pretty much everything that Brian Gardner and the entire team at CopyBlogger has put out since. I started creating my own WordPress themes in 2007, so for me to put my name behind someone else, should […]

Continue reading...

Google Glass Review (Explorer)

Joe Hall wearing Google Glass

Here are my initial thoughts using Google Glass. I will likely form more opinions about the device as I continue to use it. To make this review as well rounded as possible, I decided to break it up into Pros/Cons. BUT if you don’t have the time to read all this, then here’s the TLDR […]

Continue reading...

UPDATED: Help Us Bring Eli Home

ayers

As most of you know I don’t talk very much about my disability online. But, I want to tell you all about a very special project that I have decided to help with. In previous posts I have mentioned that I have Osteogenesis Imperfecta (OI), which is a rare bone disorder that makes my bones […]

Continue reading...

Identifying Patterns for Fun, Profit, and Rankings – Search Exchange 2013

Today I had the pleasure of speaking at Search Exchange 2013! I promised all in attendance that I would share my presentation, so here it is! Here are some great resources from the presentation: Random Color Algorithm Majestic SEO Gephi – open source graph mapping software for backlink analysis Post by Justin Briggs about using […]

Continue reading...

30 Day Challenge: Exercise Every Day

In this post, I am announcing two things: A new category to my blog, and a new 30 day challenge for August. During the month of August, I am going to exercise everyday. I used to swim three days a week, but for various reasons, I quit doing that. Now I want to get back […]

Continue reading...

Coffee, Clarity, and Art.

There’s a small table in the corner of the coffee shop that I like to sit at. My back faces the large floor to ceiling windows, but it allows me to face the rest of the shop. I can see everyone from that vantage point. I enjoy watching what seems like every walk of life […]

Continue reading...

30 Day Challenge: No Social Media

Several years ago I watched this video by famed Googler, Matt Cutts. Since then I have always wanted to take a 30 day challenge. Quitting social media for 30 days has always been something I have had an interest in. However, I have never been able to, due to the demands of my career in […]

Continue reading...

How To Build Your Own “Google Reader”

rss

So there has been a lot of talk today about Google shutting down Google Reader. I haven’t really been concerned because years ago, I created my own. I have been calling it “Joe Reader” for years. So now that Google is killing their Reader, I have decided to release mine as Open Source code under […]

Continue reading...

Is Marissa Mayer Restarting Yahoo Search?

marissa_new4

In July, Yahoo announced that they had hired Google famed Marissa Mayer as their new CEO. Unlike everyone else in the tech sector, I was disappointed. My disappointment stemmed from the fact that for the last several years Yahoo has been the surefire place where things go to die. This made me sad because Mayer […]

Continue reading...

Plugin Contest (aka how I will beat @Norcross like a drum)

trading

So it has been awhile since I last developed a WordPress Plugin for free. Sure I have done dozens for clients, but it has been awhile since I have given one away. But soon all of that will change. Starting April 1st I am entering myself into a two man competition with my buddy Andrew […]

Continue reading...

How To Build A Kindle

kindle

Something odd happened about 6 months ago. I started buying books on the Kindle. This was odd to me because 1) I am usually against technology with strict DRMs and, 2) I don’t own a Kindle! I have been reading my books on my phone and on my PC. However this morning I wanted to […]

Continue reading...

SEO “Outing” Is Immoral

When I first started working in the SEO industry I couldn’t understand why “outing” was such a big deal. In fact (like others in the industry) I felt the inability to talk openly prohibited our industry from growing and handling our reputation. However, back then I was naive and inexperienced. I have now seen the […]

Continue reading...