plugin issue - protect content plugin

I am getting an error.

Warning: Illegal offset type in isset or empty in /home/buddymar/public_html/brighttrackpainting/wp/wp-content/plugins/protected-content/app/model/class-ms-model-rule.php on line 493

I have protected two categories of posts. I am trying to make a list of those posts show up in a sidebar. One membership would see List A, and the other membership would see List A and List B.

I am using "W4 Post List" to create List A and List B. I believe there is a conflict. I have also tried a method of setting up a Custom Menu that created menu items which were the names of the post. I got the same error as above.

I don't really care which plugin I use to make the List A and List B, I just need a way to make different lists of post names appear depending on which Membership a person has.

Can you help?

  • Jude
    • DEV MAN

    Hi there Brian,

    We'd love to help.

    Have you considered using code to do this instead of plugins ? If all you want is a list of posts there are much easier ways of getting this done.

    I looked into the W4 Post plugin
    https://wordpress.org/plugins/w4-post-list/

    The query it creates is not compatible with membership. Maybe you can cutomize the one below for your purposes ?

    $args = array(
    	'post_type' => 'post',
    	'tax_query' => array(
    		'relation' => 'OR',
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'slug',
    			'terms'    => array( 'quotes' ),
    		),
    		array(
    			'taxonomy' => 'post_format',
    			'field'    => 'slug',
    			'terms'    => array( 'post-format-quote' ),
    		),
    	),
    );
    // The Query
    $query = new WP_Query( $args );
    
    // The Loop
    if ( $the_query->have_posts() ) {
    	echo '<ul>';
    	while ( $the_query->have_posts() ) {
    		$the_query->the_post();
    		echo '<li>' . get_the_title() . '</li>';
    	}
    	echo '</ul>';
    } else {
    	// no posts found
    }
    /* Restore original Post Data */
    wp_reset_postdata();

    If you want further assistance maybe you can share support access with me ? I can take a look inside.
    Cheers
    Jude

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.