47 gravityview()->log->debug(
'$passed_atts: ', array(
'data' => $passed_atts ) );
50 if( !empty( $passed_atts[
'detail'] ) ) {
81 $supported_atts = array_fill_keys( array_keys( $defaults ),
'' );
84 $filtered_atts = shortcode_atts( $supported_atts, $passed_atts,
'gravityview' );
87 $filtered_atts = array_intersect_key( (array) $passed_atts, $filtered_atts );
91 foreach( $filtered_atts as $key => $passed_value ) {
96 switch( $defaults[ $key ][
'type'] ) {
104 if( is_numeric( $passed_value ) ) {
105 $atts[ $key ] = ( $passed_value + 0 );
111 if( GFFormsModel::is_valid_operator( $passed_value ) ) {
112 $atts[ $key ] = $passed_value;
118 $atts[ $key ] =
gv_empty( $passed_value,
true,
false ) ? 0 : 1;
126 $options = isset( $defaults[ $key ][
'choices'] ) ? $defaults[ $key ][
'choices'] : $defaults[ $key ][
'options'];
127 if( in_array( $passed_value, array_keys( $options ) ) ) {
128 $atts[ $key ] = $passed_value;
134 $atts[ $key ] = $passed_value;
157 case 'total_entries':
162 $return = empty( $paging ) ?
'' : number_format_i18n( \
GV\Utils::get( $paging,
'first', 0 ) );
166 $return = empty( $paging ) ?
'' : number_format_i18n( \
GV\Utils::get( $paging,
'last', 0 ) );
170 $return = number_format_i18n( \
GV\Utils::get( $paging,
'page_size', 0 ) );
179 $return = apply_filters(
'gravityview/shortcode/detail/' . $detail, $return );
shortcode( $passed_atts, $content=null)
Callback function for add_shortcode()
static getInstance( $passed_post=NULL)
$gravityview_view
array $entry array $form array $field_settings
get_view_detail( $detail='')
Display details for the current View.
if(empty( $field_settings['content'])) $content
new GravityView_Shortcode
Handle the [gravityview] shortcode.
gravityview()
The main GravityView wrapper function.
static defaults( $detailed=false, $group=null)
Retrieve the default View settings.
gv_empty( $value, $zero_is_empty=true, $allow_string_booleans=true)
Is the value empty?
parse_and_sanitize_atts( $passed_atts)
Validate attributes passed to the [gravityview] shortcode.
static getInstance()
Get the one true instantiated self.