Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    That’s a bit tricky… you could filter on the “author” column (you’d have to customize the form so that parameter was visible: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/Config_post_selector_relation), but that still wouldn’t dynamically determine the current user’s ID. This would make a good feature request.

    Thread Starter Rajesh Soni

    (@rajeshsoni)

    Thanks for your reply, I appreciate.

    I eventually had to modify the plugin to get it work.

    Here’s what I did:

    File: custom-content-type-manager/ajax-controllers/get_posts.php
    I inserted my code before this line:

    $hash['content'] .= CCTM::parse($item_tpl, $r);

    // Rajesh Soni
    	// 08 March 2013
    	// Hide Private posts from other users (for non-admin users)
    
    	global $user_ID;
    
    	if( !current_user_can("administrator") && $r['post_status'] == 'private' && $r['post_author'] != $user_ID)
    		continue;

    That seemed to do the trick!

    — I can now ONLY see my own private posts
    — I can see everybody’s private posts if logged in as an administrator

    Let me know your thoughts.

    Cheers!

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    If you took the time to hack the plugin, please take the time to file a feature request: your edits will be overwritten if/when you update the plugin to the next version.

    Thread Starter Rajesh Soni

    (@rajeshsoni)

    For sure, will do that.

    Do you think, this approach of mine is better, mass-usable?

    Thread Starter Rajesh Soni

    (@rajeshsoni)

    Just wondering, should this be reported as a Bug?
    I see no option for “Feature request”.

    Thanks.

    Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Report it as a bug — I can categorize it as a feature request later. Thanks.

    As for “mass-appeal” — I don’t know. I rely on feature requests for that. ??

    Thread Starter Rajesh Soni

    (@rajeshsoni)

    Gotcha!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Relation field -> Hide other's Private posts’ is closed to new replies.