Bump Reset plugin - Annotated to help new devs

The post-admin-menu widget has been “removed” recently in favor of a glimmer component here admin-post-menu.gjs.

https://github.com/discourse/discourse/pull/23650

The proper way to add a button is to use the addPostAdminMenuButton API instead:

	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 Likes