1 | <?php |
||
19 | class GravityView_Plugin_Hooks_Pageviews extends GravityView_Plugin_and_Theme_Hooks { |
||
20 | |||
21 | /** |
||
22 | * @var string Check for the Gravity Flow constant |
||
23 | */ |
||
24 | protected $class_name = 'Pageviews'; |
||
25 | |||
26 | /** |
||
27 | * @var The next entry ID before the shortcode is gonna be output. |
||
28 | */ |
||
29 | public $next_id = false; |
||
30 | |||
31 | /** |
||
32 | * @var The shortcode attributes. |
||
33 | */ |
||
34 | public $atts = array(); |
||
35 | |||
36 | /** |
||
37 | * Filter the values shown in GravityView frontend |
||
38 | * |
||
39 | * @since 1.17 |
||
40 | */ |
||
41 | function add_hooks() { |
||
53 | |||
54 | /** |
||
55 | * Remove the autocontent filter on single entries. |
||
56 | * We do not need to be outputting the View counter. |
||
57 | */ |
||
58 | public function remove_autocontent( $r ) { |
||
64 | |||
65 | /** |
||
66 | * Maybe set self::$next_id from the context. |
||
67 | * |
||
68 | * Used as sort of an action via the gravityview/fields/custom/decode_shortcodes filter. |
||
69 | */ |
||
70 | public function inject_entry_id( $r, $content, $context ) { |
||
79 | |||
80 | /** |
||
81 | * Output the Pageviews stuffs |
||
82 | * |
||
83 | * Shortcode: [gv_pageviews] |
||
84 | * |
||
85 | * Attributes: `id` Overload the Entry ID. Default: {entry_id} for the custom content field |
||
86 | * `preload` The preload text. Default: ... |
||
87 | * |
||
88 | * @since develop |
||
89 | * |
||
90 | * @param array $atts The shortcode arguments |
||
91 | * |
||
92 | * @return string The content |
||
93 | */ |
||
94 | public function pageviews( $atts ) { |
||
112 | |||
113 | /** |
||
114 | * Set the preload text. |
||
115 | */ |
||
116 | public function preload_callback( $preload ) { |
||
119 | |||
120 | /** |
||
121 | * Set the increment configuration parameter. |
||
122 | */ |
||
123 | public function increment_callback() { |
||
131 | } |
||
132 | |||
134 |
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.