Code Duplication    Length = 13-14 lines in 2 locations

class-jetpack-wizard-banner.php 1 location

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

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.*`.