In the continued spirit of sharing ordinary plugins to the WordPress repository, we posted Aviation Quotes a few years ago. It's purpose is to simply return a random aviation quote on your website. We have a growing database of quotes and the plugin was designed primarily to service a few of our own aviation websites. It's one of a few plugins we submitted only because we used them ourselves... and WordPress provided an easy means to maintain and update them.
One of the most limiting aspects of the current setup is that we'll indiscriminately deliver a quote - comedic, serious, or otherwise. The ability to specifically request quotes of a specific nature hasn't yet been implemented. The same applies for quotes that might be considered NSFW.
While there's a WordPress plugin hosted in the WP repository, we've also provided shortcode and a PHP function.
The shortcode of
[aviationquote p="1"] in your text editor will render the following on your WordPress website (blockquote is my own formatting):
“If you don't gear up your brain before takeoff, you'll probably gear up your airplane on landing.”
p=1 is used to wrap the quote in paragraph <p> tags. If not used the quote will display inline (as follows): “If you don't gear up your brain before takeoff, you'll probably gear up your airplane on landing.”
The individual receiving attribution for the quote can be formatted with standard HTML tags (if attribution exists). For example, to render the attribution text as bold and in italics, use the following:
[aviationquote p="1" tags="em,strong"]. Note that the opening and closing tags aren't used, and each html formatting instruction is separated by a comma.
"The important achievement of Apollo was demonstrating that humanity is not forever chained to this planet and our visions go rather further than that and our opportunities are unlimited." - Neil Armstrong
We use an m-dash between the quote and attribution by default. You can alter this as follows:
[aviationquote p="1" sep="~"]. The result:
"Nobody who gets too damned relaxed builds up much flying time." ~ Ernest K. Gann, advice from the 'old pelican', The Black Watch, 1989
Again, the attribution will only be formatted if it is returned in the API response.
Copy and paste the WordPress function into your theme's
functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
The following attributes can be used.
sepis the separator between the text and the attribution. Defaults to em-dash (--).
p="1". We only built this in because of issues with WordPress that often prevents paragraph tags being applied.
offline="your text in here".
cache_tempbefore making another request.
cache. We cache on our end for (usually) 20 minutes.
Used outside of WordPress, the following function can be used. The function requires Simple Cache.
- The feature to submit new quotes from within your dashboard is now being tested by a few colleagues. Quotes are held for moderation and later make their way into the database.