1 | <?php |
||
8 | class GravityView_Field_Created_By extends GravityView_Field { |
||
9 | |||
10 | var $name = 'created_by'; |
||
11 | |||
12 | var $search_operators = array( 'is', 'isnot' ); |
||
13 | |||
14 | var $group = 'meta'; |
||
15 | |||
16 | var $_custom_merge_tag = 'created_by'; |
||
17 | |||
18 | public function __construct() { |
||
22 | |||
23 | /** |
||
24 | * Add custom merge tags to merge tag options |
||
25 | * |
||
26 | * @since 1.16 |
||
27 | * |
||
28 | * @param array $form GF Form array |
||
29 | * @param GF_Field[] $fields Array of fields in the form |
||
30 | * |
||
31 | * @return array Modified merge tags |
||
32 | */ |
||
33 | protected function custom_merge_tags( $form = array(), $fields = array() ) { |
||
60 | |||
61 | /** |
||
62 | * Exactly like Gravity Forms' User Meta functionality, but instead shows information on the user who created the entry |
||
63 | * instead of the currently logged-in user. |
||
64 | * |
||
65 | * @see http://docs.gravityview.co/article/281-the-createdby-merge-tag Read how to use the `{created_by}` merge tag |
||
66 | * |
||
67 | * @since 1.16 |
||
68 | * |
||
69 | * @param array $matches Array of Merge Tag matches found in text by preg_match_all |
||
70 | * @param string $text Text to replace |
||
71 | * @param array $form Gravity Forms form array |
||
72 | * @param array $entry Entry array |
||
73 | * @param bool $url_encode Whether to URL-encode output |
||
74 | * @param bool $esc_html Whether to apply `esc_html()` to output |
||
75 | * |
||
76 | * @return string Text, with user variables replaced, if they existed |
||
77 | */ |
||
78 | public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
||
113 | |||
114 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
||
134 | |||
135 | } |
||
136 | |||
138 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.