GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Data Fields | Protected Attributes | Private Attributes
GravityView_Metabox_Tab Class Reference

The class for a metabox tab in the GravityView View Settings metabox. More...

Public Member Functions

 __construct ( $id, $title='', $file='', $icon_class_name='', $callback='', $callback_args=array())
 Create a new metabox tab. More...
 
 parse_icon_class_name ( $icon_class_name='')
 If the name of the CSS class has dashicon in it, add the dashicons prefix. More...
 
 render ( $post)
 Render the tab. More...
 

Data Fields

 $icon_class_name = ''
 
 $id = ''
 String for use in the 'id' attribute of tags. More...
 
 $title = ''
 Title of the meta box. More...
 

Protected Attributes

 $callback = ''
 Function that fills the box with the desired content. More...
 
 $callback_args = array()
 Optional. More...
 
 $context = 'advanced'
 Optional. More...
 
 $priority = ''
 Optional. More...
 
 $render_template_file = ''
 
 $screen = ''
 Optional. More...
 

Private Attributes

 $prefix = 'gravityview_'
 

Detailed Description

The class for a metabox tab in the GravityView View Settings metabox.

See also
https://gist.github.com/zackkatz/6cc381bcf54849f2ed41 For example
Since
1.8

Definition at line 10 of file class-gravityview-metabox-tab.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id,
  $title = '',
  $file = '',
  $icon_class_name = '',
  $callback = '',
  $callback_args = array() 
)

Create a new metabox tab.

Since
1.8
Parameters
$idstring Metabox HTML ID, without gravityview_ prefix
string$titleName of the metabox. Shown in the tab.
string$fileThe file name of a file stored in the /gravityview/includes/admin/metaboxes/views/ directory to render the metabox output, or the full path to a file. If defined, callback is not used.
string$icon_class_nameIcon class used in vertical tabs. Supports non-dashicon. If dashicons, no need for dashicons prefix
string$callbackFunction to render the metabox, if $file is not defined.
array$callback_argsArguments passed to the callback
Returns
void

Definition at line 100 of file class-gravityview-metabox-tab.php.

References $callback, $callback_args, $icon_class_name, $title, and parse_icon_class_name().

Member Function Documentation

◆ parse_icon_class_name()

parse_icon_class_name (   $icon_class_name = '')

If the name of the CSS class has dashicon in it, add the dashicons prefix.

Since
1.8
Parameters
string$icon_class_namePassed class name
Returns
string sanitized CSS class

Definition at line 119 of file class-gravityview-metabox-tab.php.

References $icon_class_name.

Referenced by __construct().

◆ render()

render (   $post)

Render the tab.

If the $file parameter was passed when registering a new GravityView_Metabox_Tab, then the file is included.

The include checks for a full file path first, and if a file exists, use that file. If the file doesn't exist, then the code looks inside the [gravityview]/includes/admin/metaboxes/views/ dir.

Finally, if there's no file specified, but there's a $callback parameter specified, use the callback.

Since
1.8
Parameters
WP_Post$postCurrently edited post object
See also
do_accordion_sections()

Definition at line 143 of file class-gravityview-metabox-tab.php.

References $post, $render_template_file, gravityview(), and GRAVITYVIEW_DIR.

Field Documentation

◆ $callback

$callback = ''
protected

Function that fills the box with the desired content.

The function should echo its output.

Since
1.8
Parameters
callback

Definition at line 38 of file class-gravityview-metabox-tab.php.

Referenced by __construct().

◆ $callback_args

$callback_args = array()
protected

Optional.

Data that should be set as the $args property of the box array (which is the second parameter passed to your callback). Default null.

Since
1.8
Parameters
array

Definition at line 71 of file class-gravityview-metabox-tab.php.

Referenced by __construct().

◆ $context

$context = 'advanced'
protected

Optional.

The context within the screen where the boxes should display. Available contexts vary from screen to screen. Post edit screen contexts include 'normal', 'side', and 'advanced'. Comments screen contexts include 'normal' and 'side'. Menus meta boxes (accordion sections) all use the 'side' context. Global default is 'advanced'.

Since
1.8
Parameters
string

Definition at line 57 of file class-gravityview-metabox-tab.php.

◆ $icon_class_name

$icon_class_name = ''

Definition at line 85 of file class-gravityview-metabox-tab.php.

Referenced by __construct(), and parse_icon_class_name().

◆ $id

$id = ''

String for use in the 'id' attribute of tags.

Since
1.8
Parameters
string

Definition at line 24 of file class-gravityview-metabox-tab.php.

◆ $prefix

$prefix = 'gravityview_'
private

Definition at line 17 of file class-gravityview-metabox-tab.php.

◆ $priority

$priority = ''
protected

Optional.

The priority within the context where the boxes should show ('high', 'low'). Default 'default'.

Since
1.8
Parameters
string

Definition at line 64 of file class-gravityview-metabox-tab.php.

◆ $render_template_file

$render_template_file = ''
protected

Definition at line 78 of file class-gravityview-metabox-tab.php.

Referenced by render().

◆ $screen

$screen = ''
protected

Optional.

The screen on which to show the box (like a post type, 'link', or 'comment'). Default is the current screen.

Since
1.8
Parameters
string|WP_Screen

Definition at line 46 of file class-gravityview-metabox-tab.php.

◆ $title

$title = ''

Title of the meta box.

Since
1.8
Parameters
string

Definition at line 31 of file class-gravityview-metabox-tab.php.

Referenced by __construct().


The documentation for this class was generated from the following file: