Code Duplication    Length = 2-4 lines in 3 locations

modules/publicize.php 1 location

@@ 46-47 (lines=2) @@
43
		if ( $this->in_jetpack) {
44
			// if sharedaddy isn't active, the sharing menu hasn't been added yet
45
			$active = Jetpack::get_active_modules();
46
			if ( in_array( 'publicize', $active ) && !in_array( 'sharedaddy', $active ) )
47
				add_action( 'admin_menu', array( &$publicize_ui, 'sharing_menu' ) );
48
		}
49
50
		// TODO: Not really a block. The underlying logic doesn't care, so we should rename to

modules/comment-likes.php 1 location

@@ 47-50 (lines=4) @@
44
		if ( ! Jetpack::is_module_active( 'likes' ) ) {
45
			$active = Jetpack::get_active_modules();
46
47
			if ( ! in_array( 'sharedaddy', $active ) && ! in_array( 'publicize', $active ) ) {
48
				// we don't have a sharing page yet
49
				add_action( 'admin_menu', array( $this->settings, 'sharing_menu' ) );
50
			}
51
52
			if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) {
53
				// we have a sharing page but not the global options area

modules/likes.php 1 location

@@ 56-59 (lines=4) @@
53
54
			$active = Jetpack::get_active_modules();
55
56
			if ( ! in_array( 'sharedaddy', $active ) && ! in_array( 'publicize', $active ) ) {
57
				// we don't have a sharing page yet
58
				add_action( 'admin_menu', array( $this->settings, 'sharing_menu' ) );
59
			}
60
61
			if ( in_array( 'publicize', $active ) && ! in_array( 'sharedaddy', $active ) ) {
62
				// we have a sharing page but not the global options area