I'd like to develop a plugin that allows me to insert a shortcode in one article [show_image_search key="Alghe Wakamè"] and which will show something similar to the image below.

enter image description here

Where can I start from? (even a link to other questions / article / WP documentation could be a valid starting point)

  • 3
    The shortcode part, no, the google part, probably? 3rd party services are off topic here, but maybe if you had an example of this in a static web page? Questions here are limited to WordPress, the Google API is out of scope here – Tom J Nowell Mar 17 '15 at 16:04
  • 2
    +1 to @TomJNowell comment, consider migrating this to StackOverflow for a PHP function that will return markup for a Google Search, then refer back here for help with shortcode implementation. – user12479 Mar 17 '15 at 16:35
  • 1
    Who is going to use this is somewhat irrelevant. 3rd party services ( such as Google ) are off topic on this site. I understand your question is reasonable, but parts of it are out of scope here, if we can remove those parts or factor them out then we can avoid closing the question and make your question more attractive to people answering – Tom J Nowell Mar 17 '15 at 16:37
  • 1
    It's stated clearly as one of the reasons available for closing a question. This is the WordPress stack exchange, and different stacks define what 'ontopic' means differently. E.g. a Physics question is off topic on a Biology stack exchange. However arguing in comments is not going to help, if you disagree we have processes for these things. Visit the Meta site and make your case, if you're persuasive, things will change – Tom J Nowell Mar 17 '15 at 17:32
  • 1
    Different stack exchange sites have different rules, e.g. I expect Google would be mentioned a lot on the Webmasters stack exchange, what works in one stack isn't appropriate in another, and if someone says "I googled for the answer and found nothing", that doesn't meant he question is about Google, but it would show up in your google search query – Tom J Nowell Mar 17 '15 at 18:24

In essence, your question boils down to "How do I display third-party data via a shortcode?" It's a frequent task that a large number of WordPress developers encounter at one time or another over the course of their career, and the solution is simple: combine the Shortcode API with a mechanism that retrieves the 3rd-party data and wrap it all up in a plugin.

That's really all there is to it. If the 3rd-party data changes infrequently, you may wish to cache it with the Transients API, or maybe just download it the first time and store it alongside relevant posts using the Metadata API and store binary data as an attachment.

It can be as simple and straightforward or complicated and efficient as you want it to be, and there are many ways to accomplish the same tasks. The Codex is always a good place to start, as is searching the web for relevant blog posts and tutorials.

We can help you out with any specific questions you have regarding the WordPress functions and structures and their use (there's likely already answers for most that you might ask here on the site), but for questions regarding obtaining data from a third-party service (or the specific application of PHP or Javascript towards doing so) you should inquire over at Stack Overflow, or on the 3rd-party's official support channels.

To increase your chances of receiving constructive answers, conduct ample research before asking a question, phrase it in a manner that makes it clear you are addressing WordPress functionality specifically, and generalize it as much as possible to apply to the largest possible audience.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.