Home Forums Plugin Support WP User Frontend Pro [wpuf_sub_info] shows all post types

This topic is: resolved

This topic contains 24 replies, has 5 voices, and was last updated by  Scott 4 years, 8 months ago.

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #23481

    Scott
    Member
    Post count: 48

    How can I have the [wpuf_sub_info] display only a certain post type? Currently you can see all like this

    post=0
    page=0
    contest=20
    submission=0
    safecss=0
    feedback=0

    Also the what are the cancel and change buttons here for? The do not do anything but refresh the page.

    #23504

    Sekander Badsha
    Member
    Post count: 2067

    See the code block below:

    [php]
    add_filter( ‘wpuf_posts_type', ‘remove_posts_type' );
    function remove_posts_type( $post_types ) {
    unset(
    $post_types[‘attachment'],
    $post_types[‘revision'],
    );

    return $post_types;
    }
    [/php]

    If you want to display only one post type, then you'll have to write all other post types except the one you want to show inside the unset() function. Like you don't want to show page, so you'll have to write $post_types['page'] inside unset().

    The cancel button is for cancelling the the subscription and the change button is to change the subscription package. The cancel mechanism works with paypal. when you click the cancel button, it sends a response to PayPal to cancel further payments. We should've showed a confirmation message that, “Your Subscription is Cancelled”. But don't worry, everything is working fine. I have added that as an issue and it will be fixed in our next update.

    #23545

    Scott
    Member
    Post count: 48

    Where does the code you provided go?

    #23596

    Sk
    Moderator
    Post count: 371

    Hello Scott,

    You could use the code to your themes functions.php or navigate to wp-user-frontend/wpuf-functions.php write the code at the bottom of this page.

    Thank you.

    #23623

    Scott
    Member
    Post count: 48

    Adding this code to the functions.php causes whitescreen on frontend and backend of the site.

    In dreamweaver I get a syntax error on line 6 of the code provided. Please advise.

    #23691

    Sekander Badsha
    Member
    Post count: 2067

    You were supposed to add some post types, did you do so ? if yes, then check if you have missed something. The error should tell you about the error. Please check carefully.

    #24071

    Scott
    Member
    Post count: 48

    Yes I added the post types according to what was shown. Exactly as below.

    add_filter( 'wpuf_posts_type', 'remove_posts_type' );
        function remove_posts_type( $post_types ) {
            unset(
                $post_types['post'],
                $post_types['page'],
                $post_types['submission'],
                $post_types['safecss'],
                $post_types['feedback'],
            );
     
            return $post_types;
        }
    #24509

    Sk
    Moderator
    Post count: 371

    hi Scott,

    does it works? if no, please check if you put the code in any class. the code you provided is ok. there is no error.

    thank you

    #24820

    Elizabeth
    Member
    Post count: 41

    I get the same problem….is there an update to this code?

    This doesn't work and gives the following error:
    Parse error: syntax error, unexpected ‘)' in /home3/kkellie123/public_html/siteforbiz.com/wp-content/plugins/wp-user-frontend-pro/wpuf-functions.php on line 1122

    It's something to do with the );

    Can you guys pls double check and let us know….

    add_filter( ‘wpuf_posts_type', ‘remove_posts_type' );
    function remove_posts_type( $post_types ) {
    unset(
    $post_types[‘post'],
    $post_types[‘page'],
    $post_types[‘os_myapp'],
    $post_types[‘os_results'],
    $post_types[‘feedback'],
    );

    return $post_types;
    }

    #24889

    Scott
    Member
    Post count: 48

    Could you guys have the plugin not display post types that we enter 0 for. This would be a much better solution than having us add code to your plugin.

    #25110

    Scott
    Member
    Post count: 48

    Any update on this?

    #25141

    Elizabeth
    Member
    Post count: 41

    PLEASE! PLEASE! This is a MUST HAVE for many of us….can we get this fixed?

    As I mentioned in my post above, the code that you guys gave, does not work.

    I don't mind adding it, but we need it to work. Appears to be an error with the ; at the end of the code…

    If you can pls take a look again? We can try to add it to our theme functions.php file or the wp-user-frontend/wpuf-functions.php file again as you in structed. And hopefully not get any errors this time.

    If you can at least do this until you release a new version/fix for this – that would be great….

    Thanks so much!

    #25295

    Elizabeth
    Member
    Post count: 41

    EDIT: READ THE NOTE AT THE BOTTOM – THIS SOLUTION DOES NOT WORK

    Hey Guys – I think I figured this out for anybody who still needs solution. I am trying it now, although I have no idea why we can't get tech support to help us out or answer our posts.

    Anyway….take out the last comma after your list of post types that you want to exclude:

    add_filter( ‘wpuf_posts_type', ‘remove_posts_type' );
    function remove_posts_type( $post_types ) {
    unset(
    $post_types[‘post'],
    $post_types[‘page'],
    $post_types[‘excludethisposttype'],
    $post_types[‘excludethisposttype']
    );

    return $post_types;
    }

    See? After that 2nd last exclude and before the ; I removed the comma…this doesn't throw any syntax errors. So hoping this will work. Give it a try and see if you have any luck. Fingers crossed for us all.

    If anyone else has a solution, or if tech support can pls post the correct code….pls do.

    Thanks

    #25300

    Elizabeth
    Member
    Post count: 41

    The edit above did fix the syntax error – but it is still showing all the post types.

    So we still need a solution for this – PLEASE!!!!!

    #25309

    Tareq Hasan
    Keymaster
    Post count: 2831

    Sorry for the trouble guys:

    Those who wants to print some certain post types, you need to edit the /class/subscription.php file. Here's the position looks like:
    previous

    Now replace the code with this:
    [php]
    echo isset( $user_sub[‘your_post_type'] ) ? sprintf( ‘Your Post Type: %d', $user_sub[‘your_post_type'] ) : ”;
    echo isset( $user_sub[‘another_post_type'] ) ? sprintf( ‘Another Type: %d', $user_sub[‘another_post_type'] ) : ”;
    [/php]

    So now it looks like this:
    current

    Hope that makes sense!

Viewing 15 posts - 1 through 15 (of 25 total)

The topic ‘[wpuf_sub_info] shows all post types’ is closed to new replies.