Show title in a widget from protected posts

Custom Post types are protected by a Membership 2. Please advise how to show custom post titles in a widget for every visitor?

  • Ivan

    Hi Inesta !

    It seems your attached image wasn't attached for some reason. Could you try it again or just to upload it to an online service for that, like Google Drive, Dropbox and so on? Also, I checked your credentials which you provided my colleagues - SFTP doesn't work and your staging site asks Basic access authentication. By the way, do you have this issue on the staging site?
    Also, if you want to apply it only to one Custom Post Type - you can try to modify the snippet in the following way

    function wpmu_membership_show_title_in_widget( $wp_query, $obj ) {
    	if ( 'subsidy' === $wp_query->query_vars['post_type'] ) {
    		$wp_query->query_vars['post__in'] = array();
    	}
    }
    add_action( 'ms_rule_cptgroup_model_protect_posts', 'wpmu_membership_show_title_in_widget', 10, 2 );

    Where is subsidy is your name of Custom Post Type.
    If it won't help - please, provide me with additional login credentials, I can look into it more.

    https://premium.wpmudev.org/contact/#i-have-a-different-question
    Please visit our private Contact page and complete the form with the following information:

    Subject: "Attn: Ivan Svyrskyi"

    In the Message box, please provide the following:

    link back to this thread for reference
    any other relevant urls

    Basic access authentication
    login
    password

    Admin login:
    Admin username
    Admin password
    Login url

    FTP/SFTP credentials
    host
    username
    password
    (and port if required)

    Note: Don't send any credentials via this forum because it's public forum.

    Best,
    Ivan.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.