2017 © Pedro Peláez
 

library wp-utils

WordPress utility classes.

image

lucatume/wp-utils

WordPress utility classes.

  • Monday, August 25, 2014
  • by theAverageDev
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,749 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

WordPress utilities

A small set of utilities to speed up WordPress development., (*1)

tad_Script

A utility class that will make dealing with script and style suffix a breeze. Depending on the SCRIPT_DEBUG constant it will try to enqueue the minified or non minified version of the script or style., (*2)

$path = get_stylesheet_directory_uri() . '/assets/css/theme_style.css';
$debugDependantPath = tad_Script::suffix($path);

wp_enqueue_style('theme-style', $debugDependantPath);

tad_Str(ings)

Will make string conversion to go from one naming convention to another., (*3)

$string = 'some_name_here';

// someNameHere
$out = tad_Str::camelBack($string);
// some-name-here
$out = tad_Str::hyphen($string);
// some_name_here
$out = tad_Str::underscore($string);
// SomeNameHere
$out = tad_Str::camelCase($string);
// some/name/here (some\name\here on Win)
$out = tad_Str::toPath($string);

it also packs some methods to split strings into lines on a char or word basis with html tags preservation., (*4)

$in = "lorem ipsum some other stuff here"

// lorem ipsum some other...
$out = tad_Str::atMostChars($in, 25, '...');

// <span class="line">lorem ipsum</span>
// <span class="line">some other</span>
// <span class="line">stuff here</span>
$out = tad_Str::splitLinesByWords($in, 2);

$in = 'some words are longer than others'

// <span class="line">some words are longer</span>
// <span class="line">than others</span>
$out = tad_Str::splitLinesByChars($in, 25);

tad_Arr(ays)

Array utilities., (*5)

tad_JsObject

A quasi WordPress specific set of functions meant to make printing JavaScript objects on the page easy. The class will take care to print objects containing callback functions too., (*6)

$in = array(
    'value' => 'hello there',
    'callback' => 'function(){alert("hello there");}'
    );

$out = tad_JsObject::on($in)->getOut();

// or print on the page in WordPress
tad_JsObject::on($in)->localize();

Changelog

  • 2.0.0 - "updated" the package to work with PHP 5.2
  • 1.1.0 - first public release

The Versions

25/08 2014

dev-master

9999999-dev http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress

25/08 2014

2.1.10

2.1.10.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress

21/08 2014

2.1.9

2.1.9.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress

20/08 2014

2.1.8

2.1.8.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

13/08 2014

2.1.7

2.1.7.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

13/08 2014

2.1.6

2.1.6.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

13/08 2014

2.1.5

2.1.5.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

13/08 2014

2.1.4

2.1.4.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

13/08 2014

2.1.3

2.1.3.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

11/08 2014

2.1.2

2.1.2.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

08/08 2014

2.1.1

2.1.1.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

08/08 2014

2.1.0

2.1.0.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

08/08 2014

2.0.1

2.0.1.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

23/07 2014

2.0.0

2.0.0.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress

11/06 2014

1.1.0

1.1.0.0 http://github.com/lucatume/wp-utils

WordPress utility classes.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

wordpress