Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Table_Achievements::get_actions_html( int $achievement_id )

Get HTML for buttons in the actions cell of the table.


Parameters Parameters

$achievement_id

(int) (Required) WP Post ID of the achievement post.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/reporting/tables/llms.table.achievements.php

	private function get_actions_html( $achievement_id ) {
		ob_start();
		?>
		<?php if ( get_edit_post_link( $achievement_id ) ) : ?>
		<a class="llms-button-secondary small" href="<?php echo esc_url( get_edit_post_link( $achievement_id ) ); ?>">
			<?php _e( 'Edit', 'lifterlms' ); ?>
			<i class="fa fa-pencil" aria-hidden="true"></i>
		</a>
		<?php endif; ?>
		<form action="" method="POST" style="display:inline;">

			<button type="submit" class="llms-button-danger small" id="llms_delete_achievement" name="llms_delete_achievement">
				<?php _e( 'Delete', 'lifterlms' ); ?>
				<i class="fa fa-trash" aria-hidden="true"></i>
			</button>

			<input type="hidden" name="achievement_id" value="<?php echo absint( $achievement_id ); ?>">
			<?php wp_nonce_field( 'llms-achievement-actions', '_llms_achievement_actions_nonce' ); ?>

		</form>

		<script>document.getElementById( 'llms_delete_achievement' ).onclick = function( e ) {
			return window.confirm( '<?php esc_attr_e( 'Are you sure you want to delete this achievement? This action cannot be undone!', 'lifterlms' ); ?>' );
		};</script>
		<?php
		return ob_get_clean();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Show a button to edit earned achievements.
3.18.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.