GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
templates
deprecated
fields
created_by.php
Go to the documentation of this file.
1
<?php
2
/**
3
* Display the created_by field type
4
*
5
* @package GravityView
6
* @subpackage GravityView/templates/fields
7
*/
8
9
$gravityview_view
=
GravityView_View::getInstance
();
10
11
extract(
$gravityview_view
->getCurrentField() );
12
13
// There was no logged in user.
14
if
( empty(
$value
) ) {
15
return
;
16
}
17
18
// Get the user data for the passed User ID
19
$User
= get_userdata(
$value
);
20
21
// Display the user data, based on the settings `id`, `username`, or `display_name`
22
$name_display
= empty(
$field_settings
[
'name_display'
] ) ?
'display_name'
:
$field_settings
[
'name_display'
];
23
24
echo esc_html(
$User
->{
$name_display
} );
GravityView_View\getInstance
static getInstance( $passed_post=NULL)
Definition:
class-template.php:195
$field_settings
$field_settings['content']
Definition:
custom.php:27
$value
$value
Definition:
search-field-date_range.php:10
$gravityview_view
$gravityview_view
Definition:
created_by.php:9
$name_display
$name_display
Definition:
created_by.php:22
$User
if(empty( $value)) $User
Definition:
created_by.php:19