diff --git a/includes/class-creativecommons-image.php b/includes/class-creativecommons-image.php index 35dc316..1895cca 100644 --- a/includes/class-creativecommons-image.php +++ b/includes/class-creativecommons-image.php @@ -653,8 +653,10 @@ public function init() { * ); */ - add_filter( 'the_content', array( $this, 'add_attribution_boxes' )); - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_attribution_boxes' )); + if (get_option("enable_attribution_box")) { + add_filter( 'the_content', array( $this, 'add_attribution_boxes' )); + add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_attribution_boxes' )); + } add_shortcode( 'license', diff --git a/includes/class-creativecommons.php b/includes/class-creativecommons.php index f036f7e..0a4de5e 100644 --- a/includes/class-creativecommons.php +++ b/includes/class-creativecommons.php @@ -105,6 +105,10 @@ public function page_init() { 'license', array( &$this, '_wrapper_settings_api_verify' ) ); + register_setting( + 'cc-admin', + 'enable_attribution_box' + ); /** * This section includes: * License selector. @@ -174,6 +178,18 @@ public function page_init() { 'license-attribution-settings', array( 'label_for' => 'display_as' ) ); + + add_settings_field( + 'enable_attribution_box', + __( + 'Display attribution information for images', + 'CreativeCommons' + ), + array( &$this, 'enable_attribution_box' ), + 'cc-admin', + 'license-attribution-settings', + array( 'label_for' => 'enable_attribution_box' ) + ); } @@ -376,7 +392,14 @@ public function display_license_as() { + /> +