[wp-hackers] Perhaps OT PHP Question

Chris chris.hearn01 at ntlworld.com
Tue May 29 00:26:26 GMT 2007


Less than 4.04 perhaps? cdigit does not exist until then?

Chris Williams wrote:
> This is a rudimentary question, I'm sure... But I am beating my head against
> the wall.
>
> I have a trivial plug-in thus:
>
> function shakes_get_cat ($categories, $r) {
>     if ('list' == $r['style']) {
>         foreach ($categories as $category) {
>             if (ctype_digit(substr($category->cat_name, 0, 2))) {
>                 $category->cat_name = $category->category_description;
>             }
>         }
>     }
>     return $categories;
> }
> add_filter('get_categories', 'shakes_get_cat', 10, 2);
>
> On my local test machine (php 5.2, wp 2.2) it works perfectly.  On the
> server (php 4.?, wp 2.2) it doesn't.  The $categories array is unchanged.
>
> Any help?  I know this is something obvious, but...
>
> CLWill
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>   


More information about the wp-hackers mailing list