Jump to content

current user entry counter gravity forms display numbers


mikedelater

Recommended Posts

how can i display numbers with shortcode of submitted from gravity form only from current logged in user

 

add_filter( 'gform_shortcode_entry_count', 'gwiz_entry_count_shortcode', 10, 2 );
function gwiz_entry_count_shortcode( $output, $atts ) {

extract( shortcode_atts( array(
'id' => false,
'status' => 'total', // accepts 'total', 'unread', 'starred', 'trash', 'spam'
'format' => false // should be 'comma', 'decimal'
), $atts ) );

$valid_statuses = array( 'total', 'unread', 'starred', 'trash', 'spam' );

if( ! $id || ! in_array( $status, $valid_statuses ) ) {
return current_user_can( 'update_core' ) ? __( 'Invalid "id" (the form ID) or "status" (i.e. "total", "trash", etc.) parameter passed.' ) : '';
}

$counts = GFFormsModel::get_form_counts( $id );
$output = rgar( $counts, $status );

if( $format ) {
$format = $format == 'decimal' ? '.' : ',';
$output = number_format( $output, 0, false, $format );
}

return $output;
}

Edited by mikedelater
Link to comment
Share on other sites

1 - I usually can understand English, but I have a real problem with this statement:

 

how can i display numbers with shortcode of submitted from gravity form only from current logged in user

 

 

2 - if this is about something called 'gravity' why not post it in a forum that covers that thing? A CMS perhaps?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.