• Resolved robenson21

    (@robenson21)


    Dear TobiasBG.

    Good day,

    I’m so sorry I know my question is already answered by other queries, but I totally lost. Ok here’s my query.

    I want also to filter the data in Tablepress like others do but still not work. I add this to my functions.php

    #Code Begin

    add_shortcode( ‘table-user-filtered’, ‘formfunia_tablepress_filtered_table’ );
    function formfunia_tablepress_filtered_table( $atts ) {
    if ( ! is_user_logged_in() ) {
    return ‘Error: No user is logged in.’;
    }
    $current_user = wp_get_current_user();
    $username = $current_user->user_login;
    $atts[‘filter’] = $username;
    $atts[‘cache_table_output’] = false;
    return tablepress_get_table( $atts );
    }

    #End of code

    Then add the short code in WP Page with this code.

    [table-user-filtered user_login=2 /]

    My table ID is 2.

    I want only to show the data of seedcenter user. Insted of showing only seedcenter record they show all records.

    Can you help me to do that, I mean what is the right shortcode to use to show only the seedcenter user. Seedcenter is the current logged in user on my queries.

    Here’s my table design. Can you check Sir if it’s right design or need to change something there?

    https://prntscr.com/obn4q9

    Best regards,

    • This topic was modified 5 years, 8 months ago by robenson21.
    • This topic was modified 5 years, 8 months ago by robenson21.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Trouble in Filtering Data’ is closed to new replies.