Permalink
Browse files

Ability to disable watermarking functionality in settings.

  • Loading branch information...
1 parent 1c0f7af commit 897ffa32c4867d444222f9a1321ec2fab85e6117 @willmot willmot committed May 30, 2012
Showing with 25 additions and 1 deletion.
  1. +4 −1 wpthumb.php
  2. +21 −0 wpthumb.settings.php
View
@@ -42,8 +42,11 @@
}
+include_once( WP_THUMB_PATH . '/wpthumb.settings.php' );
+
// Load the watermarking class
-include_once( WP_THUMB_PATH . '/wpthumb.watermark.php' );
+if ( get_option( 'wpthumb_watermark' ) )
+ include_once( WP_THUMB_PATH . '/wpthumb.watermark.php' );
/**
* Base WP_Thumb class
View
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Add the watermark setting field to the media settings page
+ */
+function wpthumb_watermark_setting() {
+
+ register_setting( 'media', 'wpthumb_watermark' );
+ add_settings_field( 'wpthumb_watermark', 'Enable watermarking functionality', 'wpthumb_watermark_setting_field', 'media' );
+
+}
+add_action( 'admin_init', 'wpthumb_watermark_setting' );
+
+/**
+ * Output the watermark setting field
+ */
+function wpthumb_watermark_setting_field() { ?>
+
+ <input name="wpthumb_watermark" id="wpthumb_watermark" type="checkbox"<?php checked( get_option( 'wpthumb_watermark' ), 'on' ); ?> /> <label for="wpthumb_watermark">Adds the ability to watermark images through the media library.</label>
+
+<?php }

0 comments on commit 897ffa3

Please sign in to comment.