BP_XProfile_Field_Type_Checkbox_Acceptance::admin_field_html( array $raw_properties = array() )

Field html for Admin-> User->Profile Fields screen.


Parameters Parameters

$raw_properties

(array) (Optional) properties.

Default value: array()


Source Source

File: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox-acceptance.php

	public function admin_field_html( array $raw_properties = array() ) {
		$page_id   = bp_xprofile_get_meta( bp_get_the_profile_field_id(), 'field', 'bp_xprofile_checkbox_acceptance_page', true );
		$page      = null;
		$default_r = array( 'type' => 'checkbox' );

		if ( bp_get_the_profile_field_is_required() ) {
			$default_r['required'] = 'required'; // HTML5 required attribute.
		}

		$r = bp_parse_args(
			$raw_properties,
			$default_r,
			'checkbox_acceptance'
		);

		if ( $page_id ) {
			$page = get_post( $page_id );
		}
		?>

		<?php if ( $page instanceof WP_Post ) : ?>
			<label for="<?php bp_the_profile_field_input_name(); ?>">
				<input <?php echo $this->get_edit_field_html_elements( $r ); ?>>
				<?php
				printf(
					/* translators: %s: link to the page the user needs to accept the terms of. */
					esc_html__( 'I agree to %s.', 'buddypress' ),
					'<a href="' . esc_url( get_permalink( $page ) ) . '">' . esc_html( get_the_title( $page ) ) . '</a>'
				);
				?>
			</label>
		<?php endif;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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