xprofile_admin_delete_field_screen( $field_id,  $field_type )

Display the delete confirmation screen of xprofile field/option.


Source Source

File: bp-xprofile/bp-xprofile-admin.php

function xprofile_admin_delete_field_screen( $field_id, $field_type ) {
	if ( ! bp_current_user_can( 'bp_moderate' ) ) {
		die( '-1' );
	}

	$field = xprofile_get_field( $field_id, null, false );

	$base_url = remove_query_arg( array( 'mode', 'field_id', 'bp_xprofile_delete_field' ), $_SERVER['REQUEST_URI'] ); ?>

	<div class="wrap">
		<h1 class="wp-heading-inline">
			<?php
			printf(
				/* translators: %s is the field type name. */
				esc_html__( 'Delete %s', 'buddypress' ),
				$field_type
			);
			?>
		</h1>

		<hr class="wp-header-end">

		<p>
			<?php
			printf(
				/* translators: %s is the field type name. */
				esc_html__( 'You are about to delete the following %s:', 'buddypress' ),
				$field_type
			);
			?>
		</p>

		<ul class="bp-xprofile-delete-group-list">
			<li><?php echo esc_html( $field->name ); ?></li>
		</ul>

		<p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ); ?></strong></p>

		<a class="button-primary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'mode' => 'do_delete_field', 'field_id' => $field_id ), $base_url ), 'bp_xprofile_delete_field-' . $field_id, 'bp_xprofile_delete_field' ) ); ?>"><?php esc_html_e( 'Delete Permanently', 'buddypress' ); ?></a>
		<a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a>
	</div>

	<?php
}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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