Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created September 2, 2015 10:50
Show Gist options
  • Save tommcfarlin/7b142f3daca88e4cc7e3 to your computer and use it in GitHub Desktop.
Save tommcfarlin/7b142f3daca88e4cc7e3 to your computer and use it in GitHub Desktop.
[WordPress] An example of a helper function calling into a predefined class.
<?php
/**
* A function accessible via the front-end of the theme that will
* return the swatches associated with the current post ID.
*
* @since 1.0.0
*
*/
function acme_get_data() {
$acme = Acme_Get_Data::get_instance();
echo $acme->get_data( get_the_ID() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment