Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
PUM_Utils_Fields::render_field( array $args = array() )


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813

Parameters Parameters

$args

(Optional)

Default value: array()


Top ↑

Source Source

File: classes/Utils/Fields.php

	public static function render_field( $args = array() ) {
		$args = static::parse_field( $args );

		// If no type default to text.
		$type = ! empty( $args['type'] ) ? $args['type'] : 'text';

		/**
		 * Check if any actions hooked to this type of field and load run those.
		 */
		if ( has_action( "pum_{$type}_field" ) ) {
			do_action( "pum_{$type}_field", $args );
		} else {
			if ( method_exists( 'PUM_Form_Fields', $type . '_callback' ) ) {
				/**
				 * Check if renderer method exists and load that.
				 */
				$function_name = array( 'PUM_Form_Fields', $type . '_callback' );
			} else if ( function_exists( "pum_{$type}_callback" ) ) {
				/**
				 * Check if function exists and load that.
				 */
				$function_name = "pum_{$type}_callback";
			} else {
				/**
				 * No method exists, lets notify them the field type doesn't exist.
				 */
				$function_name = array( 'PUM_Form_Fields', 'missing_callback' );
			}

			/**
			 * Call the determined method, passing the field args & $value to the callback.
			 */
			call_user_func_array( $function_name, array( $args ) );
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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