Code Duplication    Length = 13-14 lines in 2 locations

class.jetpack.php 1 location

@@ 982-995 (lines=14) @@
979
		return $params;
980
	}
981
982
	function jetpack_connection_banner_callback() {
983
		check_ajax_referer( 'jp-connection-banner-nonce', 'nonce' );
984
985
		// Disable the banner dismiss functionality if the pre-connection prompt helpers filter is set.
986
		if (
987
			isset( $_REQUEST['dismissBanner'] ) &&
988
			! Jetpack_Connection_Banner::force_display()
989
		) {
990
			Jetpack_Options::update_option( 'dismissed_connection_banner', 1 );
991
			wp_send_json_success();
992
		}
993
994
		wp_die();
995
	}
996
997
	/**
998
	 * Removes all XML-RPC methods that are not `jetpack.*`.

class-jetpack-wizard-banner.php 1 location

@@ 125-137 (lines=13) @@
122
	/**
123
	 * AJAX callback
124
	 */
125
	public static function ajax_callback() {
126
		check_ajax_referer( 'jp-wizard-banner-nonce', 'nonce' );
127
128
		if (
129
			current_user_can( 'jetpack_manage_modules' )
130
			&& isset( $_REQUEST['dismissBanner'] )
131
		) {
132
			Jetpack_Options::update_option( 'dismissed_wizard_banner', 1 );
133
			wp_send_json_success();
134
		}
135
136
		wp_die();
137
	}
138
139
	/**
140
	 * Renders the Wizard Banner