BP_XProfile_Field_Type_WordPress_Textbox::__construct()

Constructor for the WordPress regular field type.


Source Source

File: bp-xprofile/classes/class-bp-xprofile-field-type-wordpress-textbox.php

	public function __construct() {
		parent::__construct();

		$this->category            = _x( 'WordPress Fields', 'xprofile field type category', 'buddypress' );
		$this->name                = _x( 'Text field', 'xprofile field type', 'buddypress' );
		$this->accepts_null_value  = true;
		$this->do_settings_section = true;
		$this->wp_user_key         = '';

		$this->set_format( '/^.*$/', 'replace' );

		/**
		 * Fires inside __construct() method for BP_XProfile_Field_Type_WordPress_Textbox class.
		 *
		 * @since 8.0.0
		 *
		 * @param BP_XProfile_Field_Type_WordPress_Textbox $this Instance of the field type object.
		 */
		do_action( 'bp_xprofile_field_type_wordpress_textbox', $this );

		/*
		 * As we are using an xProfile field meta to store the WordPress field meta key we need
		 * to make sure $this->wp_user_key is set before once the field has been populated.
		 */
		add_action( 'bp_xprofile_field', array( $this, 'set_wp_user_key' ), 10 );
	}


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.