What should I use instead of WP_CONTENT_DIR and WP_PLUGIN_DIR?

Reference file in current path or deeper nested To reference the current path plugin_dir_path( __FILE__ ).”further/nesting/here.css”; which works in Plugins and Themes. Reference URl/URi in a plugin To point to a plugin or theme file, use plugins_url( “path/to/file”, __FILE__ ); which works only in plugins Reference URl/URi in wp-admin folder Always point them to admin_url( … Read more

Use of ‘const’ for function parameters

The reason is that const for the parameter only applies locally within the function, since it is working on a copy of the data. This means the function signature is really the same anyways. It’s probably bad style to do this a lot though. I personally tend to not use const except for reference and … Read more

Where to declare/define class scope constants in C++?

I’m curious about the benefits/detriments of different constant declaration and definition options in C++. For the longest time, I’ve just been declaring them at the top of the header file before the class definition: While this pollutes the global namespace (which I know is a bad thing, but have never found a laundry list of … Read more

What is a class constant?

JLS-8.3.1.1. static Fields says (in part) A static field, sometimes called a class variable, is incarnated when the class is initialized (§12.4). JLS-4.12.4. final Variables says (in part) A constant variable is a final variable of primitive type or type String that is initialized with a constant expression (§15.28) tl;dr Putting that together, a class constant is a static final field.

Why does JSHint throw a warning if I am using const?

When relying upon ECMAScript 6 features such as const, you should set this option so JSHint doesn’t raise unnecessary warnings. /*jshint esnext: true */ (Edit 2015.12.29: updated syntax to reflect @Olga’s comments) This option, as the name suggests, tells JSHint that your code uses ECMAScript 6 specific syntax. http://jshint.com/docs/options/#esversion Edit 2017.06.11: added another option based on this answer. While inline … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)