WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WP-Library

Provides a foundation and extensions for/to common WordPress developer functions/tasks - creating/installing plugins, complex database queries, etc

How do I include files?

You have several options: - WP_LIBRARY_DIR: constant path to base plugin directory (where wp-library-init.php resides) - WP_LIBRARY_URL: same as ...DIR, but public-facing URL path - wp_library_path($file): function to get library path to given file (automatically prefixes with directory slash /) - wp_library_url($file): same as ...path, but public-facing url to file - wp_library_include($file, $isRequired = false, $isOnce = true): function to include/require/"_once a library file, optionally require or do it once - wp_is_library($file): check whether the requested library file exists

By default, the common functions (includes/common-functions.php and mvc/common_micromvc.php), are included.

There's also a really simple class WP_Library_Base that exposes "hook" wrappers add_hook and add_hook_with, which internally call add_filter using a class function of the same name as a callback, so you don't need to declare array(&$this, 'callback_func').

What's the difference between the `mvc` files and `includes` files?

MVC files include the model-view-controller stack, as well as related helper files/functions. These files/patterns have been adapted from Xeoncross's awesome MicroMVC library. You'll need to include at least the mvc-stack wp_mvc.php.

The other includes are standalone helper wrappers/classes, which you can include as needed.

How do I use the Lang class for labels?

Create a language file with the extension .lang.php. It should contain a $lang array variable, to which you add the label key and value.

  1. Include the language helper mvc/lang.micromvc.php
  2. load your label file with Lang::load($file, $module, $rel)
  3. then reference your label like: sprintf( Lang::get('validation_required', $module), $field) which would return something like: The (VALUE_OF_$field) field is required and cannot be empty.
$module

is the identifier used to refer to the language group - if omitted, will use the default lang file /mvc/ui/.lang.php.

$rel

is used to get the language file relative to this path -- use __FILE__ to get from the current-dir/ui/... folder, omit to use the default lang file.

How do I do XYZ?

Coming soon! There's a lot of stuff to cover - check out the files themselves, they should be decently documented.

Requires: 3.0 or higher
Compatible up to: 3.2.1
Last Updated: 2012-7-2
Downloads: 687

Ratings

0 stars
0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.