The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
15 views

Do define() statements need phpDocumentor-style docblocks?

There's no word on this in the WordPress Documentation Standards, but do define() statements need phpDocumentor-style docblocks? /** * Should this docblock be here? * * @since 1.0.0 */ define( ...
1
vote
1answer
30 views

Avoiding “Usage of a direct database call is discouraged”

WordPress-Coding-Standards reports that "Usage of a direct database call is discouraged." It's complaining about my usage of $wpdb->insert() in a plugin. Is this not recommended? What is the ...
0
votes
1answer
42 views

Sanitization html output itself

I've just started code according to VIP WordPress Coding Standards and I stuck with sanitization. I know that all outputs need sanitization without any exception. But how can I do sanitization of a ...
0
votes
1answer
46 views

Why the WP Core team does not allow filter_* functions? [closed]

This question is somehow related to this other question. Provided that is seems we have a solution for the magic quotes issues, why the WP Core team does not allow them? This is unclear to me and I ...
5
votes
2answers
83 views

How should I document function calls?

Reading the WordPress PHP Documentation Standards, I can't see anywhere that mentions how to document a function call such as add_action( 'foo', 'bar' ); Should I be documenting function calls and, ...
14
votes
2answers
1k views

Why is Wordpress code so “space-happy”?

The WP core, many WP plugins, and the WP coding standards themselves use a very "generous application" of the Space character (not for indentation, but "inside" of parens and brackets). This seems to ...
4
votes
2answers
240 views

How to name files of namespaced classes?

WP Core Handbook > PHP Coding Standards > Naming Conventions suggests the following for naming files with classes: Class file names should be based on the class name with class- prepended and ...
1
vote
0answers
61 views

What make possible unit test plugins?

This is more a theory related question. I'm not looking at the practical ways to do this, as I can find plenty of example (official and not), which however does not explain how it is possible to ...
3
votes
2answers
155 views

What to do when theme and WordPress coding standards conflict?

I am considering different starter themes such as _s and roots. Roots looks very good, especially its sass fork. Anyway, there's one thing that concerns me. It seems like Roots doesn't follow the ...
7
votes
5answers
327 views

Actions, functions and conditionals

When developing themes and plugins it is sometimes neccesary to add some functionality to some hook using conditional statements. Example: function my_custom_function() { if( is_home()) { ...
8
votes
3answers
696 views

Sandwich Coding Standards

I recently spotted the code for a wp-lunch.php file intended for a WordPress template, what would this look like if following the proper WordPress coding standards? <?php if ( ...
6
votes
2answers
501 views

Wordpress and event-driven programming - what is it about?

I want to state very clearly that this does not intend to revive the discussion about functional/procedural programming versus object-oriented programming. There is plenty said about that, on WPSE and ...
0
votes
0answers
29 views

Strict Standards: Declaration of … should be compatible with [duplicate]

I try this answer, and i changed the function start_el(&$output, $item, $depth = 0, $args = array() ) { but it did not work. The problem is, I have this theme, link here. and I'm getting this ...
0
votes
2answers
304 views

Wordpress Theme Validator?

I'm looking for a Wordpress theme Validator. Not necessarily something that validates the HTML but more along the lines of adhering to the Wordpress Coding Standards for Theme Development.
1
vote
2answers
663 views

What is WordPress file encoding?

I noticed that WordPress files use UNIX end-of-line and UTF-8 without BOM. Is this a standard that should be used? Is there anything else to pay attention to? I noticed that Filezilla fails to ...
0
votes
1answer
45 views

Is there a common structure for a wordpress formular?

I am working on a plugin for wordpress and was wondering if there is any common standard for the html and css structure and naming which I should use if I create a html form? so is there a definition ...
0
votes
1answer
75 views

spaces inside parenthesis

The Wordpress coding standards states to put parenthesis both inside and outside opening and closing parenthesis. What is the rationale behind spaces on the inside of parenthesis? I've hardly ever ...
0
votes
2answers
514 views

REQUIRED: Could not find wp_link_pages. See: wp_link_pages by Theme Checker

I have run my theme through WordPress theme checker to see if it can be submitted to WordPress.org. I encountered this error: REQUIRED: Could not find wp_link_pages. See: wp_link_pages But this ...
6
votes
1answer
408 views

Why does WordPress reverse conditional statements?

In WordPress' core code, you often see this: if (1 == $someVar) as opposed to this: if ($someVar == 1) I don't know if the first way is a WordPress-centric style of coding, but I've only noticed ...
2
votes
1answer
959 views

Using global $post v/s $GLOBALS['post']

It's probably more of a PHP question, but I would like to know if there are any differences in using global $post; echo $post->ID; when compared to echo $GLOBALS['post']->ID; to access the ...
10
votes
1answer
216 views

Why isn't WordPress part of Framework Interop Group?

Are there any technical reasons that prevent WP to be part of Framework Interop Group?
1
vote
1answer
75 views

Is it better to create a function or a variable for current_theme_supports?

Well I just asking myself this, there are two ways I could implement this. What would be a better fit to coding standards? Or is this just a a matter of personal like? And what about php and memory, ...
1
vote
1answer
241 views

WordPress mode for emacs?

Is anyone using emacs for editing WordPress and have a mode that follow the code style guidelines that they would care to share? If so I would appreciate it. Thanks.