[wp-hackers] Showing users post counts for custom post types

Jared Williams jaredwilli at gmail.com
Mon Oct 25 02:07:58 UTC 2010


On Sun, Oct 24, 2010 at 2:26 PM, <wp-hackers-request at lists.automattic.com>wrote:

> Send wp-hackers mailing list submissions to
>        wp-hackers at lists.automattic.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.automattic.com/mailman/listinfo/wp-hackers
> or, via email, send a message with subject or body 'help' to
>        wp-hackers-request at lists.automattic.com
>
> You can reach the person managing the list at
>        wp-hackers-owner at lists.automattic.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of wp-hackers digest..."
>
>
> Today's Topics:
>
>   1. Re: prevent indexing of page 2,3 and so on (Jeremy Visser)
>   2. Re: prevent indexing of page 2,3 and so on (Alex Hempton-Smith)
>   3. wp_get_archives by category and wp.org Ideas (Steve Taylor)
>   4. Re: Showing users post counts for custom post types (scribu)
>   5. Re: Showing users post counts for custom post types (Andrew Nacin)
>   6. Re: prevent indexing of page 2,3 and so on (scribu)
>   7. Re: "The Matrix Has You" easter egg (Chris Williams)
>   8. Re: "The Matrix Has You" easter egg (Ryan Bilesky)
>   9. Re: "The Matrix Has You" easter egg (Chip Bennett)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 24 Oct 2010 23:56:41 +1100
> From: Jeremy Visser <jeremy at visser.name>
> Subject: Re: [wp-hackers] prevent indexing of page 2,3 and so on
> To: wp-hackers at lists.automattic.com
> Message-ID: <4CC42D09.6070106 at visser.name>
> Content-Type: text/plain; charset=ISO-8859-1
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Alex Hempton-Smith said:
> > Just hook into the <head> with wp_head, and use a conditional statement
> in
> > that function:
>
> Call me old-fashioned, but wouldn't adding this line to robots.txt suffice?
>
> Disallow: /page
>
> (Yes, you'll need to hook into do_robotstxt to add that line, but that's
> left as an exercise to the reader.)
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkzELQkACgkQvs6Qqs8TxBqbbwCfXUzA9FIvT6OlOd7/KJI2un8/
> fZQAoLEXu8pMnEepa/m1xyOtDX0QAOIm
> =SbpT
> -----END PGP SIGNATURE-----
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 24 Oct 2010 14:59:55 +0200
> From: Alex Hempton-Smith <hempsworth at gmail.com>
> Subject: Re: [wp-hackers] prevent indexing of page 2,3 and so on
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <AANLkTimPU0nV7Y2iesXy=xVt8JPQGDm_8MmqY-i28RhC at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Wow, I didn't even know that existed. Much cleaner way of doing it!
>
> -- Alex
>
>
> On Sun, Oct 24, 2010 at 2:56 PM, Jeremy Visser <jeremy at visser.name> wrote:
>
> > (Yes, you'll need to hook into do_robotstxt to add that line, but that's
> > left as an exercise to the reader.)
> >
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 24 Oct 2010 15:29:24 +0100
> From: Steve Taylor <steve at sltaylor.co.uk>
> Subject: [wp-hackers] wp_get_archives by category and wp.org Ideas
> To: wp-hackers <wp-hackers at lists.automattic.com>
> Message-ID:
>        <AANLkTinob0bin7vY0uouHBwE6X8joEWdwoyt_YpmX8P6 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi folks,
>
> I'm trawling through the options for filtering wp_get_archives by
> category as well as year. It's a popular request and there's a number
> of solutions out there.
>
> While?I'm interested in the most recent, elegant solution for this if
> anyone wants to chip in, I'm a little more concerned about this:
>
> http://wordpress.org/extend/ideas/topic/implement-wp_get_archivescategory64
>
> Why is this flagged as "implemented"? I thought for a moment maybe
> just the Codex hadn't been updated, but the 3.0.1 source shows no such
> functionality, and I can't see anything lined up for 3.0.2 or 3.1 on
> Trac. Anyone know what's going on?
>
> cheers,
>
> Steve Taylor
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 24 Oct 2010 18:59:18 +0300
> From: scribu <mail at scribu.net>
> Subject: Re: [wp-hackers] Showing users post counts for custom post
>        types
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <AANLkTimY4qv=5Kaop0FghSHPucOKriy7Z4XNrWo0t4nA at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Sun, Oct 24, 2010 at 7:25 AM, Jared Williams <jaredwilli at gmail.com
> >wrote:
>
> > Hi,
> >
> > I'm trying to figure out how to hook into the users.php manage page to
> > create custom columns for showing the number of posts users have for my
> > custom post types. I created a trac
> > ticket<http://core.trac.wordpress.org/ticket/15200>for this, but
> > @nacin explained why it's a job more for a plugin to do
> > instead, so I turned here.
> >
> > I have been unable to find a way to manipulate the output of the users
> > table, so I can add custom columns for CPTs post counts for each user.
> And
> > that may have something to do with the question @nacin asked, what would
> > the
> > post count numbers link to. For the current 'post' post count a user has,
> > it
> > links to the post manage page, showing all posts for that user
> > (edit.php?author=ID#).
> >
> > If I were to link it somewhere, it would be to
> > 'edit.php?post_type=TYPE&author=ID' if that were even somehow possible I
> > guess. But I don't even necessarily need to link it to anywhere. I mostly
> > want to just show CPT post counts for each person, having 600 users and a
> > combined total of 300+ posts across 4 custom post types. Admins are only
> > one
> > who can submit 'post' posts, so that column in the users page is useless.
> >
> > Anyone have any tips on hooking into that to do this?
> >
>
> First of all, if you're going to be lazy and reply to a thread to open a
> new
> topic (you should send a clean email instead), at least don't quote the old
> topic in your message.
>
> Secondly, there's no way to alter an existing column at the moment. The
> best
> you can do is register a new column and unset the one you're trying to
> overwrite.
>
> Here's a tutorial I wrote for the posts screen:
> http://scribu.net/wordpress/custom-sortable-columns.html
>
> Just ignore the sortable part and replace 'edit-post' with 'users'.
>
  ----------------------------

>
> Message: 5
> Date: Sun, 24 Oct 2010 12:36:10 -0400
> From: Andrew Nacin <wp at andrewnacin.com>
> Subject: Re: [wp-hackers] Showing users post counts for custom post
>        types
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <AANLkTinCtXrJ1HfsXoTB4X4Dp1P+9RCF-wcb_S9wQsC5 at mail.gmail.com<AANLkTinCtXrJ1HfsXoTB4X4Dp1P%2B9RCF-wcb_S9wQsC5 at mail.gmail.com>
> >
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sun, Oct 24, 2010 at 11:59 AM, scribu <mail at scribu.net> wrote:
>
> > On Sun, Oct 24, 2010 at 7:25 AM, Jared Williams <jaredwilli at gmail.com
> > >wrote:
> >
> > > Hi,
> > >
> > > I'm trying to figure out how to hook into the users.php manage page to
> > > create custom columns for showing the number of posts users have for my
> > > custom post types. I created a trac
> > > ticket<http://core.trac.wordpress.org/ticket/15200>for this, but
> > > @nacin explained why it's a job more for a plugin to do
> > > instead, so I turned here.
> > >
> > > I have been unable to find a way to manipulate the output of the users
> > > table, so I can add custom columns for CPTs post counts for each user.
> > And
> > > that may have something to do with the question @nacin asked, what
> would
> > > the
> > > post count numbers link to. For the current 'post' post count a user
> has,
> > > it
> > > links to the post manage page, showing all posts for that user
> > > (edit.php?author=ID#).
> > >
> > > If I were to link it somewhere, it would be to
> > > 'edit.php?post_type=TYPE&author=ID' if that were even somehow possible
> I
> > > guess. But I don't even necessarily need to link it to anywhere. I
> mostly
> > > want to just show CPT post counts for each person, having 600 users and
> a
> > > combined total of 300+ posts across 4 custom post types. Admins are
> only
> > > one
> > > who can submit 'post' posts, so that column in the users page is
> useless.
> > >
> > > Anyone have any tips on hooking into that to do this?
> > >
> >
> > First of all, if you're going to be lazy and reply to a thread to open a
> > new
> > topic (you should send a clean email instead), at least don't quote the
> old
> > topic in your message.
> >
> > Secondly, there's no way to alter an existing column at the moment. The
> > best
> > you can do is register a new column and unset the one you're trying to
> > overwrite.
> >
> > Here's a tutorial I wrote for the posts screen:
> > http://scribu.net/wordpress/custom-sortable-columns.html
> >
> > Just ignore the sortable part and replace 'edit-post' with 'users'.
>
>
> Of note, that tutorial has some awesome 3.1 bits in it. But the process of
> hooking into manage_users_columns etc is all the same. In 3.1, you'll want
> to look in the list-table(s) files in wp-admin/includes. In 3.0 you'll want
> to look in wp-admin/includes/template.php.
>
> I knew how to create custom columns, but I didn't think the users table
> used the same hook. That was all I needed to know really.

For a full solution on how to link to the
> edit.php?%post_type%&author=%author_id% page from the post counts like the
> 'post's do, here's how it can be done http://goo.gl/ycaq.



> I was hoping it was possible to create a column for each ptype but not a
> big deal.   Thanks for the help though.
>


>
> ------------------------------
>
> Message: 6
> Date: Sun, 24 Oct 2010 19:56:35 +0300
> From: scribu <mail at scribu.net>
> Subject: Re: [wp-hackers] prevent indexing of page 2,3 and so on
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <AANLkTinikspuK-nNGD-J=7k+aFiS=LV4=qmwNjErNKgm at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Sun, Oct 24, 2010 at 3:56 PM, Jeremy Visser <jeremy at visser.name> wrote:
>
> > (Yes, you'll need to hook into do_robotstxt to add that line, but that's
> > left as an exercise to the reader.)
> >
>
> You only need to do that if you can't create the robots.txt file on your
> server.
>
>
> ------------------------------
>
> Message: 7
> Date: Sun, 24 Oct 2010 13:57:06 -0400
> From: Chris Williams <chris at clwill.com>
> Subject: Re: [wp-hackers] "The Matrix Has You" easter egg
> To: "wp-hackers at lists.automattic.com"
>        <wp-hackers at lists.automattic.com>
> Message-ID: <C8E9C182.6427C%chris at clwill.com<C8E9C182.6427C%25chris at clwill.com>
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> You miss the major point: if I don't know the egg exists, how am I supposed
> to be prescient enough to install the javascript/plugin?
>
> ________________________________
> From: Ryan Bilesky <rbilesky at gmail.com>
> Subject: Re: [wp-hackers] "The Matrix Has You" easter egg
>
> if you manage WP installs
> for someone, you can add the javascript so they won't ever see it.  IMO
> anyone who is able to install and manage WP by there own should have no
> problem with that, it would only cause a problem maybe for some horribly
> non-technical person, like my parents.  In which case there is probably
> someone with some technical ability who runs the site handles upgrades,
> ect.
>
> Plus the javascript can be added in via a plugin so really if someone
> writes
> the plugin its a simple as installing a plugin.
>
>
> ------------------------------
>
> Message: 8
> Date: Sun, 24 Oct 2010 11:03:55 -0700
> From: Ryan Bilesky <rbilesky at gmail.com>
> Subject: Re: [wp-hackers] "The Matrix Has You" easter egg
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <AANLkTinEN50Vf7tM1LoiiX5AVKkrzgpFfvT45tgAhNgH at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Well what then do you purpose because its not like its going to get turned
> off.
>
> On Sun, Oct 24, 2010 at 10:57 AM, Chris Williams <chris at clwill.com> wrote:
>
> > You miss the major point: if I don't know the egg exists, how am I
> supposed
> > to be prescient enough to install the javascript/plugin?
> >
> > ________________________________
> > From: Ryan Bilesky <rbilesky at gmail.com>
> > Subject: Re: [wp-hackers] "The Matrix Has You" easter egg
> >
> > if you manage WP installs
> > for someone, you can add the javascript so they won't ever see it.  IMO
> > anyone who is able to install and manage WP by there own should have no
> > problem with that, it would only cause a problem maybe for some horribly
> > non-technical person, like my parents.  In which case there is probably
> > someone with some technical ability who runs the site handles upgrades,
> > ect.
> >
> > Plus the javascript can be added in via a plugin so really if someone
> > writes
> > the plugin its a simple as installing a plugin.
> >  _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
> ------------------------------
>
> Message: 9
> Date: Sun, 24 Oct 2010 13:26:30 -0500
> From: Chip Bennett <chip at chipbennett.net>
> Subject: Re: [wp-hackers] "The Matrix Has You" easter egg
> To: wp-hackers at lists.automattic.com
> Message-ID:
>        <AANLkTikLZeD-1sxVLoLHTV5AmTVSfKumWYL=id3y_PtW at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hmm... it would appear that several things have been proposed - the most
> straight-forward being the so-called "lame" approach of providing a simple
> wp-config.php variable to disable all easter eggs.
>
> In any case, I find it rather disingenuous - or at least, strange - for
> anyone who has followed this particular thread to ask, at this point, "what
> do you propose?".
>
> Chip
>
> On Sun, Oct 24, 2010 at 1:03 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:
>
> > Well what then do you purpose because its not like its going to get
> turned
> > off.
> >
> > On Sun, Oct 24, 2010 at 10:57 AM, Chris Williams <chris at clwill.com>
> wrote:
> >
> > > You miss the major point: if I don't know the egg exists, how am I
> > supposed
> > > to be prescient enough to install the javascript/plugin?
> > >
> > > ________________________________
> > > From: Ryan Bilesky <rbilesky at gmail.com>
> > > Subject: Re: [wp-hackers] "The Matrix Has You" easter egg
> > >
> > > if you manage WP installs
> > > for someone, you can add the javascript so they won't ever see it.  IMO
> > > anyone who is able to install and manage WP by there own should have no
> > > problem with that, it would only cause a problem maybe for some
> horribly
> > > non-technical person, like my parents.  In which case there is probably
> > > someone with some technical ability who runs the site handles upgrades,
> > > ect.
> > >
> > > Plus the javascript can be added in via a plugin so really if someone
> > > writes
> > > the plugin its a simple as installing a plugin.
> > >  _______________________________________________
> > > wp-hackers mailing list
> > > wp-hackers at lists.automattic.com
> > > http://lists.automattic.com/mailman/listinfo/wp-hackers
> > >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>
> ------------------------------
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>
> End of wp-hackers Digest, Vol 69, Issue 51
> ******************************************
>



-- 

Jared Williams
*Web Developer / Designer*
*WPHonors.com <http://2010.wphonors.com> - 2010 WPHonors
*New2WP.com <http://new2wp.com> - Development
Tweeaks.com - Design/Tech


More information about the wp-hackers mailing list