Sindbad~EG File Manager

Current Path : /home/escuelai/public_html/wp-content/plugins/learnpress/assets/src/js/admin/
Upload File :
Current File : /home/escuelai/public_html/wp-content/plugins/learnpress/assets/src/js/admin/lp-duplicate-post.js

( function( $ ) {
	const duplicatePost = function duplicatePost( e ) {
		e.preventDefault();

		const _self = $( this ),
			_id = _self.data( 'post-id' );

		$.ajax( {
			url: '',
			data: {
				'lp-ajax': 'duplicator',
				id: _id,
				nonce: lpGlobalSettings.nonce,
			},
			success( response ) {
				response = LP.parseJSON( response );

				if ( response.success ) {
					window.location.href = response.data;
				} else {
					alert( response.data );
				}
			},
		} );
	};

	$( function() {
		$( document ).on( 'click', '.lp-duplicate-row-action .lp-duplicate-post', duplicatePost );
	} );
}( jQuery ) );

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists