Support » Plugin: Gravity Forms Sticky List » Allow Users to only see their entry

  • Resolved reclifton

    (@reclifton)


    I feel like I’m missing something or not understanding something that has been previously asked and I’m really hoping this is possible.

    How do I make it so that a “customer” can only see their entries and not all other entries submitted by other customers.

    I am using this with woocommerce and the customer is created through Gravity Forms Registration. I am using gravity forms for a custom quote request and would like to be able to log that request on the users account page so that they can view a history of their requests.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi reclifton i made this with my own code. How?
    I create a custom template and assign the template to a wp-page.
    This is the code:
    ——————————————————————-
    <?php
    $url_edit = get_site_url(null,’editar-documento’).’?entry=’;
    $url_form_action = get_site_url(null,’editar-documento’); // ‘editar-documento’ is a page created in WP pages admin, with template “Editar documento” (edit-entry.php)
    //$url_show_post = get_site_url(null,’mostrar-documento’); // ‘mostrar-documento’ is a page created in WP pages admin, with template “Mostrar documento” (show-entry-post.php)
    $current_user_id = get_current_user_id();
    $forms = RGFormsModel::get_forms(null,’title’);
    foreach( $forms as $form ):
    $leads = RGFormsModel::get_leads($form->id);
    foreach( $leads as $lead ):
    if($lead[‘created_by’]==$current_user_id):

    $post = get_post($lead[‘post_id’]);
    $post_link = $post->guid;

    $originalDate = $lead[‘date_created’];
    echo ‘<form action=”‘.$url_form_action.'” method=”post”>’;
    echo ‘<input name=”mode” value=”edit” type=”hidden”>’;
    echo ‘<input name=”edit_id” value=”‘.$lead[‘id’].'” type=”hidden”>’;
    echo ‘<input name=”formID” value=”‘.$form->id.'” type=”hidden”>’;
    echo $form->title;
    //echo ‘ ,Autor: ‘.$lead[‘created_by’];
    echo ‘<br/>’._(“Creado el “).date(“d-m-Y”, strtotime($originalDate));
    echo ‘<button class=”sticky-list-edit submit”><span aria-hidden=”true” class=”icon_pencil”></span></button>’;
    //echo ‘id.'”>Editar‘;
    //print_r($lead);
    if($post_link):
    echo ‘ ‘.__(“Ver documento”).’ </form>’;
    endif;
    //echo ‘——————————————————-<br>’;
    //print_r($post);
    endif;
    endforeach;
    endforeach;
    ?>
    ————————————————————————–

    I hope this help to you

    Plugin Author fried_eggz

    (@fried_eggz)

    There are two ways to do this.

    Option 1. Put this in a template file:

    echo do_shortcode( "[stickylist id='1' user='" . get_current_user_id() . "']");

    Option 2. Put this in functions.php

    add_filter('filter_entries','hide_some_rows' );
    function hide_some_rows($entries) {
        foreach ($entries as $entryKey => $entryValue) {
            if ($entryValue["creaded_by"] != get_current_user_id()) {
                unset($entries[$entryKey]);
            }
        }
        return $entries;
    }
    • This reply was modified 2 years, 1 month ago by  fried_eggz.
    • This reply was modified 2 years, 1 month ago by  fried_eggz.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Allow Users to only see their entry’ is closed to new replies.