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

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