The MU forums have moved to

Post to Friends Only (4 posts)

  1. xiand0
    Posted 16 years ago #

    Spec: Write Post has a field called "Status" where you can select "Published", "Draft" and "Private".

    I would really like to .. be able to Post To Friends.

    This means that if you are in the friendslist then you can view the post, if not then you don't get to see it.

    I'm not really sure how to go about adding this feature.

    I would very much like hints on what hooks to use, if there are any plugins out there who manipulate posts status which I could look at as an example and most importantly, Is This Even Possible?

    Also, I realize the pitfalls include:
    * The /feed/'s must be cencored if the Post Status is set to (for example) FriendsOnly
    * Sitewide feed must be censored,
    * etc.

    (I admit I probably should have looked into this before posting, I admit I got an urge to make this right now and posted here before even trying to write 1 line of code, so sorry about that)

  2. dsader
    Posted 16 years ago #

    If the post status is anything other than Public it won't show in a feed.

    To get something to appear in the edit-form-advanced sidebar:
    edit-form-advanced.php has<?php do_action('dbx_post_sidebar'); ?> so your plugin needs a<?php add_action('dbx_post_sidebar', 'my_new_function'); ?>

    For example, wp-sticky ( is a normal wordpress plugin that functions in a way to get you started. The status of a post is changed via a form in the post edit sidebar. His code is very well commented so you'll see what's going on easy enough.

    I'm stuck on how posts could display to friends only, though. Some kind of
    if(is_user_my_friend() ) { get posts where status is "my_friends"}

  3. divrom
    Posted 16 years ago #

    Any luck on advancing this?

    It seems like it would be a natural extension of the friendlist plug-in.

  4. dsader
    Posted 16 years ago #

    Try the following:

    1. Wordpress does a category only feed. Put posts for friends in a category as Friends. Now an RSS feed for Friends now exists at http://blog.domain.tld/category/friends/feed/. This feed can be "fetched" into the body of the "My Friends" page just as the devnews loads on the Dashboard.

    2. Finally wordpress plugins exist to keep categories from appearing in the blog loop. I think this will keep posts out of the rss, though.

    1 works, sort of,(if no friends category, then default feed loads, I think cached?)haven't tried 2.

About this Topic