GravityView_Extension
Extend this class to create a GravityView extension that gets updates from gravitykit.com
Since: 1.1
Source: lib/class-gravityview-extension.php:17
Details
- Kind:
class - Namespace:
(global)
Properties
| Property | Type | Description |
|---|---|---|
$_title | string | Name of the plugin in gravitykit.com |
$_version | string | Version number of the plugin |
$_item_id | int | The ID of the download on gravitykit.com |
$_text_domain | string | Translation textdomain |
$_min_gravityview_version | string | Minimum version of GravityView the Extension requires |
$_min_php_version | string | Minimum version of GravityView the Extension requires |
$_remote_update_url | string | The URL to fetch license info from. Do not change unless you know what you're doing. |
$_author | string | Author of plugin, sent when fetching license info. |
Methods
| Method | Description |
|---|---|
add_metabox_tab() | If Extension overrides tab_settings() and passes its own tab, add it to the tabbed settings metabox |
load_plugin_textdomain() | Load translations for the extension |
settings() | Register the updater for the Extension using GravityView license information |
admin_notice() | Outputs the admin notices generated by the plugin |
add_notice() | Add a notice to be displayed in the admin. |
add_hooks() | Extensions should override this hook to add their hooks instead of |
save_post() | Store the filter settings in the _gravityview_filters post meta |
tooltips() | Add tooltips for the extension. |
Method Reference
add_metabox_tab()
function add_metabox_tab()
If Extension overrides tab_settings() and passes its own tab, add it to the tabbed settings metabox
Returns
void
Since: 1.8 ((Extension version 1.0.7))
Source: lib/class-gravityview-extension.php:114
load_plugin_textdomain()
public function load_plugin_textdomain()
Load translations for the extension
- Check
wp-content/languages/gravityview/folder and load usingload_textdomain() - Check
wp-content/plugins/gravityview/languages/folder forgravityview-[locale].mofile and load usingload_textdomain() - Load default file using
load_plugin_textdomain()fromwp-content/plugins/gravityview/languages/
Returns
void
Source: lib/class-gravityview-extension.php:161
settings()
public function settings()
Register the updater for the Extension using GravityView license information
Returns
void
Source: lib/class-gravityview-extension.php:219
admin_notice()
public function admin_notice()
Outputs the admin notices generated by the plugin
Returns
void
Source: lib/class-gravityview-extension.php:232
add_notice()
public static function add_notice( $notice=[] )
Add a notice to be displayed in the admin.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$notice | array | [] | Array with class and message keys. The message is not escaped. |
Source: lib/class-gravityview-extension.php:254
add_hooks()
public function add_hooks()
Extensions should override this hook to add their hooks instead of
Source: lib/class-gravityview-extension.php:271
save_post()
public function save_post( $post_id )
Store the filter settings in the _gravityview_filters post meta
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$post_id | int | Post ID |
Returns
void
Source: lib/class-gravityview-extension.php:278
tooltips()
public function tooltips( $tooltips=[] )
Add tooltips for the extension.
Add a tooltip with an array using the title and value keys. The title key is the H6 tag value of the tooltip; it's the headline. The value is the tooltip content, and can contain any HTML.
The tooltip key must be gv_{name_of_setting}. If the name of the setting is "example_extension_setting", the code would be:
$tooltips['gv_example_extension_setting'] = array(
'title' => 'About Example Extension Setting',
'value' => 'When you do [x] with [y], [z] happens.'
);
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tooltips | array | [] | Existing GV tooltips, with title and value keys |
Returns
array— Modified tooltips
Source: lib/class-gravityview-extension.php:297