Picker

Picker

Wordpress plugin

Install on Wordpress

App Details

Picker is a simple and flexible plugin which allow users to choose a specific post inside admin widgets page and display it in their site frontend.

If you need to display a specific post, not a generic list of last posts, top ranked posts, category posts, etc.. but only the one that you configure in the backend. Picker plugin makes it possible in a very quick and easy way. It adds a widget on the admin widgets page that you can use to select and show a post on your site’s frontend. You can work with standard types (like posts) and custom types simply by changing the settings page of the plugin.

Picker plugin is extensible in many of its features, such as, applying filters and action, managing layout template, etc.. moreover, plugin is based on the WordPress Transient API for caching issue.
As mentioned before, the plugin provides a way to override the default layout template. With a few lines of code, you can create your layout template (copying the default one) and completely override the plugin look&feel thanks to a complete access to all widget item data throw Picker classes.

Widget usage

You can use Picker plugin like all the other WordPress plugins, dragging the widget to a sidebar you can enable a Picker widget. Initially, the widget is not published on the frontend. In this way you can safely configure widget’s data and then publish/display the widget.
Picker widget is composed by the following fields:

  • Publish checkbox: flag it to publish the widget
  • Widget title: a widget title, for backend and users only, not shown on frontend
  • Post list: a lists of the last posts by date
  • Post search: a search field to provide a post ID or search it if post is not in the above post list
  • Time to publish: a datetime to set when the widget could be shown on frontend
  • Time to expire: a datetime to set when the widget should be removed from frontend
  • Alternative URL: an alternative URL instead the default posts permalink
  • Alternative title: an alternative title instead the default post_title field
  • Alternative excerpt: an alternative excerpt instead the default post_excerpt field

For some field there is a jQuery validation to check right formats. Picker plugin checks all numbers, url and datetime fields showing you an alert if data are wrong.

Customizing layout template

Picker plugin provide a default widget template that show a linked title (using post title), the featured image of the post and the post excerpt. Alternatively, you can manage widget template overriding default template. Picker plugin has a tool to detect the template path used for widget layout inclusion.
This is the load order of the template files:

  • theme / template_path / template_name (default: theme template folder)
  • theme / template_name (default: theme root folder)
  • default_path / template_name (default: plugin templates folder)

Plugin filters

Picker plugin provides many filters to extend default behavior of the plugin core functions. This is a list of the most important available filters:

  • picker_item_title: allow to modify picker item title
  • picker_item_excerpt: allow to modify picker item excerpt
  • picker_item_content: allow to modify picker item content
  • picker_template_path: allow to modify layout template path

To better understand how you can interact with plugin filters, here are some examples.
If you want, you can modify the default (usually “picker/” folder), with a folder in your theme root. In the following example, adding the function to your “functions.php” theme file, we are telling to Picker plugin to search template files inside a “templates/” folder in your theme root.

function modify_picker_template_path() { return 'templates'; } add_filter( 'picker_template_path', 'modify_picker_template_path' ); 

Also, you can modify the default post title (usually “post_title” field), adding for example a prefix/suffix. In the following example, adding the function to your “functions.php” theme file, we are telling to Picker plugin to call your function before return to template the item post title value.

function modify_picker_post_title( $value ) { return 'my_prefix ' . $value; } add_filter( 'picker_item_title', 'modify_picker_post_title' ); 

Template utility class and functions

As described in the previous paragraph, you can customize widget template according to you site specs. Inside the template file you can use a $picker_item global variable to access the picker class methods:

  • get_post_data(): get WP_Post object
  • get_permalink(): get post permalink
  • get_title(): get post title
  • get_excerpt($max_words = ”, $use_content_if_empty = false): get post excerpt
  • get_content($max_words = ”): get post content
  • get_categories($sep = ‘, ‘, $before = ”, $after = ”): get post categories as a list of category links
  • get_tags($sep = ‘, ‘, $before = ”, $after = ”): get post tags as a list of tag links
  • get_formats($sep = ‘, ‘, $before = ”, $after = ”): get post formats as a list of format links
  • has_image(): tell if post has image
  • get_image($size = ‘thumbnail’, $attr = array()): get post featured image (use thumbnail, medium, large, full default sizes or your registered new image size)
  • get_image_id(): get post featured image ID
  • using __get magic method you can read a custom field (eg: $picker_item->my_custom_field)

In addition to $picker_item global variable, you can use custom variables values, such as:

  • get_custom_url(): the provided alternative post URL
  • get_custom_title(): the provided alternative post title
  • get_custom_excerpt(): the provided alternative post excerpt
  • get_widget_sidebar(): which sidebar contains the the widget
  • get_widget_order(): the widget order (position)

In the template file are available special variables, for now:

  • $use_cache: boolean

Very important is the widget_sidebar variable. With this value you can display a different widget layout according to which sidebar contains the widget.

Caching management

To increase performance and reduce database queries Picker plugin use a persistent caching management. To get a persistent cache without using external plugins Picker plugin uses WordPress Transient API.
Anytime WordPress display Picker plugin on a site frontend page a calls Picker plugin widget management. First of all, Picker plugin look for a cached object into Transient cache, if found it, gets data, prepares HTML and provides it to frontend.
If data isn’t in Transient cache, Picker plugin go on with widget date and status validation, then, after looked up post into database, create Picker item object that contains all the widget post data, and in the end like a cached object prepares HTML and provides it to frontend.
Before concluding by Picker plugin widget management, the Picker item is saved to Transient cache. Only the Picker item is saved to cache, no HTML neither frontend logic are saved to cache. The goal to Picker caching management is only to reduce database usage.
Picker plugin cache has many expiration rules, the most important are:

  • widgets are cached 5 minutes if you specify a time to publish or a time to expire
  • widgets are cached 1 day if you don’t specify a time to publish and a time to expire
  • widgets cache expire if you update the widget
  • widgets cache expire when one of the following action is triggered:
    • save_post
    • deleted_post
    • publish_future_post
    • switch_theme

Usage

  1. Go to WP-Admin -> Appearance -> Widgets.
  2. Drag Picker widget to a sidebar.
  3. Customize Picker widget.

Links: Author’s Site

Pricing

Starting from $0 per month.

Check Out the Company Branch List Widget

By Common Ninja

Company Branch ListTry For Free!

App Info

Rating

Reviewers

2 reviews

Tags

admin
pick
picker
usability
widget

Developed By

Andrea Landonio

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Company Branch List for Wordpress logo

Company Branch List

Present all your locations with a clear company branch list that helps customers find nearby offices, understand key details, and enjoy a smoother experience.

Charts & Graphs for Wordpress logo

Charts & Graphs

Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.

Opening Hours for Wordpress logo

Opening Hours

Add opening hours to your site to give visitors clear, reliable business information that improves trust, reduces confusion, and supports user experience.

Job Application Form for Wordpress logo

Job Application Form

Collect candidate information with a job application form that organizes submissions, streamlines hiring, and helps you manage applicants efficiently.

Comparison Tables for Wordpress logo

Comparison Tables

Add comparison tables to your site to help visitors evaluate features side by side, understand differences quickly, and choose the right option with confidence.

Payment Method Logos for Wordpress logo

Payment Method Logos

Show payment method logos that highlight accepted payment options, build trust at checkout, and help visitors feel confident completing their purchase.

Feedback Popup for Wordpress logo

Feedback Popup

Collect user insights with a feedback popup that reveals issues early, improves user experience, and captures valuable leads through a clear feedback form.

Sitejabber Reviews for Wordpress logo

Sitejabber Reviews

Show Sitejabber reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.

Instagram Carousel for Wordpress logo

Instagram Carousel

Show Instagram posts in a responsive carousel layout to enhance social proof and keep your site content visually fresh.

Trust Badges for Wordpress logo

Trust Badges

Show trust badges that highlight security and reliability, build customer confidence, and help visitors feel safe making purchases on your site.

Company Branch Flip Cards for Wordpress logo

Company Branch Flip Cards

Display locations with company branch flip cards that help customers find nearby offices, understand key details, and enjoy a smoother overall experience.

Order Form for Wordpress logo

Order Form

Use an order form to let customers submit product orders, save entries, receive notifications, and collect payments through PayPal or Stripe for a smoother buying experience.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms