[wp-hackers] Perhaps OT PHP Question

Chris Williams chris at clwill.com
Tue May 29 00:43:26 GMT 2007


Not that.  If I change it to:

foreach ($categories as $category) {
    $categories->cat_name = 'mud';
}

It still doesn't change it.

I've even changed the whole thing (no if at all) to that, $categories never
gets modified in the plug-in.  It IS getting called, I put echo statements
in there, and they are showing....

Any other ideas?

On 5/28/07 5:26 PM, "Chris" <chris.hearn01 at ntlworld.com> wrote:

> 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
>> 
>>   
> _______________________________________________
> 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