This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'sunshine_after_image', 'sunshine_show_image_keywords' ); | |
function sunshine_show_image_keywords( $image ) { | |
$metadata = $image->get_meta_value( '_wp_attachment_metadata' ); | |
if ( ! empty( $metadata['image_meta']['keywords'] ) ) { | |
echo join( ', ', $metadata['image_meta']['keywords'] ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/insert-headers-and-footers/ | |
add_action( 'sunshine_before_add_to_cart_form', function() { | |
echo '<p><a href="' . add_query_arg( 'action', 'add_gallery_download', get_permalink( SunshineFrontend::$current_gallery->ID ) ) . '">Entire Gallery Download</a></p>'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Redirects to Login page. | |
add_action( 'template_redirect', function() { | |
global $sunshine; | |
if ( ! is_user_logged_in() && is_page( $sunshine->options['page_checkout'] ) ) { | |
wp_redirect( wp_login_url( get_permalink( $sunshine->options['page_checkout'] ) ) ); | |
exit; | |
} | |
}); | |
// Redirects to Registration page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/insert-headers-and-footers/ | |
add_filter( 'sunshine_allowed_css', 'sunshine_custom_allowed_css' ); | |
function sunshine_custom_allowed_css( $allowed ) { | |
$allowed[] = 'cookie'; // This must contain a keyword from the wp_enqueue_style from your plugin/theme | |
return $allowed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/my-custom-functions/ | |
add_filter( 'sunshine_currencies', 'my_custom_sunshine_currencies' ); | |
function my_custom_sunshine_currencies( $currencies ) { | |
$currencies['TND'] = 'Tunisian Dinar'; // TND = Currency code and then name | |
return $currencies; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'sunshine_after_image', 'sunshine_exif_data' ); | |
function sunshine_exif_data( $image ) { | |
$meta = wp_get_attachment_metadata( $image->get_id() ); | |
$image_meta = $meta['image_meta']; // Get the meta data/EXIF from the image upload | |
foreach ( $image_meta as $key => $value ) { | |
if ( !empty( $value ) ) { | |
echo ucwords( $key ) . ': '; // Display key as label | |
if ( is_array( $value ) ) { | |
echo join( ', ', $value ); // Display array values comma separated, likely keywords | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Sunshine Photo Cart - Analytics (Stop image view tracking) | |
Plugin URI: http://www.sunshinephotocart.com/addon/analytics | |
Description: Stops image view tracking to keep database small | |
Version: 0.1 | |
Author: Sunshine Photo Cart | |
Author URI: http://www.sunshinephotocart.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to your theme's functions.php file | |
// Or use this plugin https://wordpress.org/plugins/my-custom-functions/ | |
add_filter( 'pre_get_posts', 'sunshine_order_galleries_by_date_in_admin' ); | |
function sunshine_order_galleries_by_date_in_admin( $wp_query ) { | |
global $pagenow; | |
if ( is_admin() && $_GET['post_type'] == 'sunshine-gallery' && 'edit.php' == $pagenow && !isset( $_GET['orderby'] ) ) { | |
$wp_query->set( 'orderby', 'date' ); | |
$wp_query->set( 'order', 'DESC' ); | |
} | |
} |
NewerOlder