Bump Reset plugin - Annotated to help new devs

El widget post-admin-menu ha sido “eliminado” recientemente en favor de un componente glimmer aquí admin-post-menu.gjs.

La forma correcta de añadir un botón es usar la API addPostAdminMenuButton en su lugar:

	api.addPostAdminMenuButton((name, attrs) => {
		return {
			action: (post) => {
				const ajaxParams = {
					type: 'POST',
					data: { post_id: post.id }
				};

				ajax("/reset_bump", ajaxParams).catch(popupAjaxError);
			},
			icon: 'calendar-times',
			className: 'reset-bump',
			label: 'reset_bump.button_label',
		};
	});
2 Me gusta