Plugin Directory

Changeset 432139


Ignore:
Timestamp:
09/02/2011 09:04:30 AM (15 years ago)
Author:
timhodson
Message:

untested author selector

Location:
blog-in-blog/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • blog-in-blog/trunk/blog-in-blog.php

    r411985 r432139  
    260260        if($blog_in_blog_opts['custom_post_type'] != '') {
    261261            $params['post_type'] = $blog_in_blog_opts['custom_post_type'];
    262         }   
     262        }
     263        if($blog_in_blog_opts['author'] != '') {
     264            $params['author'] = $blog_in_blog_opts['author'];
     265        }
     266        if($blog_in_blog_opts['author_name'] != '') {
     267            $params['author_name'] =$blog_in_blog_opts['author_name'];
     268        }
    263269        if ($blog_in_blog_opts['custom_order_by'] != '') {
    264270            $params['orderby'] = 'meta_value';
     
    886892        $querystr .= "
    887893        AND $wpdb->posts.post_type = '".$blog_in_blog_opts['custom_post_type']."'";
     894    }
     895
     896    /**
     897     * If there is a author involved. TODO CHECK THIS BIT
     898     */
     899    if ($blog_in_blog_opts['author'] != '' || $blog_in_blog_opts['author_name'] != '' ){
     900       
     901        // do something with the author_name
     902        $querystr .= "
     903        AND $wpdb->posts.author = '".$blog_in_blog_opts['author']."'";
     904
     905        $querystr .= "
     906        AND $wpdb->posts.author = '".$blog_in_blog_opts['author']."'";
    888907    }
    889908
  • blog-in-blog/trunk/readme.txt

    r411897 r432139  
    8484* `custom_post_type=<post_type>` Posts with a custom post type that you want to show
    8585* `tag_slug=<tag_slug>` Posts of this tag slug will be shown. You can do OR (slug1,slug2,slug3) and AND (slug1+slug2+slug3)
     86* `author`=<author id> Posts from this author, identified by a numeric author id.
     87* `author_name`=<author user_nicename> Posts from this author, identified by their user nicename.
    8688* `post_id=<a post id>` If specified only shows a single post. All other selection or sort parameters are ignored.
    8789
Note: See TracChangeset for help on using the changeset viewer.