Skip to content

Instantly share code, notes, and snippets.

@aaroneaton
Created September 30, 2014 22:04
Show Gist options
  • Save aaroneaton/abc310152977f14950c6 to your computer and use it in GitHub Desktop.
Save aaroneaton/abc310152977f14950c6 to your computer and use it in GitHub Desktop.
theme class instance
<?php
function om_sample_lightbox_theme_api( $api, $theme, $optin_id, $type ) {
// Let's make sure we're adding to the lightbox themes. If not, return early.
if ( 'lightbox' != $type ) {
return $api;
}
// Also return if we're not using the Sample theme
if ( 'sample' != $theme ) {
return $api;
}
// Require the theme file
if ( ! class_exists( 'Optin_Monster_Lightbox_Theme_Sample' ) ) {
require plugin_dir_path( __FILE__ ) . 'lightbox-sample.php';
}
$api = new Optin_Monster_Lightbox_Theme_Sample( $optin_id );
return $api;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment