Home Forums Plugin Support WP User Frontend Pro Show posts in overvieuw sorted by Form

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  MDelcour 5 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5905

    MDelcour
    Participant
    Post count: 46

    I have a question about the overvieuw page of the users where they can edit/delete/see their posts. Ain't it a good idea to show posts sorted by which forms they were published with.

    So if I have form1 and form2 and I want to see only posts made by form1. Is there already a solution for this?

    #5908

    Tareq Hasan
    Keymaster
    Post count: 2831

    The isn't any direct solution for this, but you could use filters to achieve sorting.

    [php]
    function wpufe_dashboard_post_type( $args ) {
    if ( $args[‘post_type'] == ‘something_unique' ) {
    $args[‘post_type'] = ‘post';
    $args[‘meta_query'] = array(array(
    ‘key' => ‘_wpuf_form_id',
    ‘value' => ‘6'
    ));
    }

    return $args;
    }

    add_filter( ‘wpuf_dashboard_query', ‘wpufe_dashboard_post_type' );
    [/php]

    You might add a unique post type name, then check the post type and set the correct post type again (if you want post to be filtered out based on different form id). Then add a meta query and placing the form ID will filter your posts using that form id.

    #5909

    MDelcour
    Participant
    Post count: 46

    Hello Tareq, Thank you again for your great solution! I'll go and try this out.
    I'll let you know.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Show posts in overvieuw sorted by Form’ is closed to new replies.