[wpuf_sub_info] shows all post types

This topic contains 24 reply and 5 voices, and was last updated by Scott 10 years, 3 months ago
Viewing 15 Posts - 1 through 15 (of 24 total)
Author Posts
July 13, 2014 at 7:42 pm 23481
Scott 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.
July 14, 2014 at 1:42 pm 23504
Sekander Badsha Sekander Badsha

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.

July 14, 2014 at 9:53 pm 23545
Scott Scott

Where does the code you provided go?

July 15, 2014 at 2:50 pm 23596
Sk Sk

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.

July 15, 2014 at 11:31 pm 23623
Scott Scott

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.

July 17, 2014 at 12:15 pm 23691
Sekander Badsha Sekander Badsha

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.

July 24, 2014 at 6:06 pm 24071
Scott Scott

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;
    }
August 4, 2014 at 5:45 pm 24509
Sk Sk

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

August 9, 2014 at 3:08 am 24820
Elizabeth Elizabeth

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;
}

August 10, 2014 at 8:26 pm 24889
Scott Scott

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.

August 13, 2014 at 8:08 pm 25110
Scott Scott

Any update on this?

August 14, 2014 at 1:09 am 25141
Elizabeth Elizabeth

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!

August 16, 2014 at 10:42 pm 25295
Elizabeth Elizabeth

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

August 17, 2014 at 1:43 am 25300
Elizabeth Elizabeth

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!!!!!

August 17, 2014 at 4:12 am 25309
Tareq Hasan Tareq Hasan

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!

August 17, 2014 at 8:04 pm 25366
Scott Scott

Hi Tareq,

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 as our changes will be overwritten on next update.

Thanks for your help on this!

Viewing 15 Posts - 1 through 15 (of 24 total)