1 | <?php |
||
10 | class View extends Block { |
||
11 | const BLOCK_NAME = 'view'; |
||
12 | |||
13 | /** |
||
14 | * Generate `[gravityview]` shortcode |
||
15 | * |
||
16 | * @param array $attributes |
||
17 | * array['id'] string The ID of the View you want to display |
||
18 | * array['page_size'] string Number of entries to show at a time |
||
19 | * array['sort_field'] string What form field id should be used to sort? |
||
20 | * array['sort_direction'] string ASC / DESC |
||
21 | * array['search_field'] string Only display entries with this text in the value |
||
22 | * array['search_value'] string Change the type of search to be performed. |
||
23 | * array['search_operator'] string Possible values include: 'is', 'isnot', '<>', 'not in', 'in', '>', '<', 'contains', 'starts_with', 'ends_with', 'like', '>=', '<=' |
||
24 | * array['start_date'] string Filter the results by date. This sets a limit on the earliest results shown. In YYYY-MM-DD format. |
||
25 | * array['end_date'] string Filter the results by date. This sets a limit on the latest results shown. In YYYY-MM-DD format. |
||
26 | * array['class'] string Add a HTML class to the view wrapper |
||
27 | * array['offset'] string This is the start point in the current data set (Count starts with 0) |
||
28 | * array['single_title'] string Define a custom single entry view title (default: post/page title) |
||
29 | * array['back_link_label'] string Define a custom single entry back link label (default: ← Go back) |
||
30 | * array['post_id'] string When using the shortcode in a widget or template, you may want to specify a page where a View is embedded as the base URL for entry links |
||
31 | * |
||
32 | * @return string $output |
||
33 | */ |
||
34 | static function render( $attributes = array() ) { |
||
68 | } |
||
69 |
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.