pods icon indicating copy to clipboard operation
pods copied to clipboard

pods in backend

Open wreciak opened this issue 13 years ago • 2 comments

hi maybe beginners question, but i cannot find any info about this. I'm trying edit some custom field form in user profile, but it look's pod's is not accsessible in wp backend - what sound quite stupid. My code:

add_action ( 'edit_user_profile', 'my_show_extra_profile_fields' );
function my_show_extra_profile_fields ( $user )
{
?>
    ... text ...
<select id="category_lat" name="category_lat" >
                                      <?php

                                global $pods;
                                 $params = array(
                                        'GROUP BY' => 't.name',
                                        'limit'   => -1  // Return all rows
                                    );
                                $tmp='';
                                $pods = new pods('dance_category_latino', $params);

                                        while ( $pods->fetch()) {
        echo data ...
                                                } 
                                           }
                                    }

                                ?>
                                </select>

but i gat the error Fatal error: Class 'pods' not found in ...

do i have to declare something if i would like to use pods in wp backend? Gracias Martin

wreciak avatar Aug 19 '13 19:08 wreciak

pods() is a global function, no need to use the new keyword.

pglewis avatar Aug 19 '13 19:08 pglewis

Thanks a lot! you saved me 100 hours of troubleshooting :) Have a nice day

wreciak avatar Aug 19 '13 19:08 wreciak