Skip to content

Instantly share code, notes, and snippets.

@BrookeDot
Created December 22, 2017 01:54
Show Gist options
  • Save BrookeDot/96341f371dd555d40ffdb7a02d6f6d1b to your computer and use it in GitHub Desktop.
Save BrookeDot/96341f371dd555d40ffdb7a02d6f6d1b to your computer and use it in GitHub Desktop.
Check for genesis_get_image
Index: trunk/Index: trunk/plugin.php
===================================================================
--- trunk/plugin.php (revision 1791008)
+++ trunk/plugin.php (working copy)
@@ -144,7 +144,7 @@
echo '<div id="cat-' . $cat . '" '; post_class( 'ui-tabs-hide' ); echo '>';
- if ( ! empty( $instance['show_image'] ) ) :
+ if ( ( ! empty( $instance['show_image'] ) ) && ( function_exists( 'genesis_get_image' ) ) ) :
printf( '<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), esc_attr( $instance['image_alignment'] ), genesis_get_image( array( 'format' => 'html', 'size' => $instance['image_size'] ) ) );
endif;
===================================================================
--- trunk/plugin.php (revision 1791008)
+++ trunk/plugin.php (working copy)
@@ -144,7 +144,7 @@
echo '<div id="cat-' . $cat . '" '; post_class( 'ui-tabs-hide' ); echo '>';
- if ( ! empty( $instance['show_image'] ) ) :
+ if ( ( ! empty( $instance['show_image'] ) ) && ( function_exists( 'genesis_get_image' ) ) ) :
printf( '<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), esc_attr( $instance['image_alignment'] ), genesis_get_image( array( 'format' => 'html', 'size' => $instance['image_size'] ) ) );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment