inboundnow / retired-leads

Track visitor activity, capture and manage incoming leads, and send collected emails to your email service provider for WordPress
http://www.inboundnow.com/leads/
11 stars 3 forks source link

Important Coding Standards #37

Closed DavidWells closed 10 years ago

DavidWells commented 10 years ago

As we rewrite as classes we need to follow the correct coding standards

So this example https://github.com/inboundnow/leads/blob/master/modules/module.dashboard.php#L8-L48

Needs to follow coding standards:

This:

 function remove_dashboard_widgets()
    {
        global $remove_defaults_widgets;

        foreach ($remove_defaults_widgets as $wigdet_id => $options)
        {
            remove_meta_box($wigdet_id, $options['page'], $options['context']);
        }
    }

Turns into

/* Removes standard wp widgets */
 static function remove_dashboard_widgets() {
        global $remove_defaults_widgets;

        foreach ($remove_defaults_widgets as $wigdet_id => $options) {
            remove_meta_box($wigdet_id, $options['page'], $options['context']);
        }
    }

I'm rewriting leads now

bordoni commented 10 years ago

You could use the WordPress PHP Code Sniffer, to be able to parse your code for you.

DavidWells commented 10 years ago

Ah very cool. Did you write this?

bordoni commented 10 years ago

Nahh, this is maintained by X-Team.