ftt 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ftt +0 -1
- data/lib/php/ftt.php +62 -0
- metadata +2 -1
data/lib/php/ftt.php
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* Fast Templating Toolkit
|
4
|
+
* URL: http://github.com/doolin/ftt
|
5
|
+
* Author: David M. Doolin
|
6
|
+
* Author URL: http://dool.in/
|
7
|
+
* License: GPL2
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* The purpose of the Fast Templating Toolkit is to
|
11
|
+
* provide a thin API wrapper around the most commonly
|
12
|
+
* used functions for writing theme templates in WordPress.
|
13
|
+
* The goal is 100% consistency in naming and behavior.
|
14
|
+
*
|
15
|
+
* Ultimately, each method in the class should be
|
16
|
+
* 1. public static
|
17
|
+
* 2. unit tested
|
18
|
+
*/
|
19
|
+
|
20
|
+
class ftt {
|
21
|
+
|
22
|
+
const excerpt_more_string = ' foobar';
|
23
|
+
|
24
|
+
public static function echo_title($id = 0) {
|
25
|
+
echo ftt::get_title($id);
|
26
|
+
}
|
27
|
+
|
28
|
+
public static function get_title($id = 0) {
|
29
|
+
return get_the_title($id);
|
30
|
+
}
|
31
|
+
|
32
|
+
public static function echo_permalink() {
|
33
|
+
echo ftt::get_permalink();
|
34
|
+
}
|
35
|
+
|
36
|
+
public static function get_permalink() {
|
37
|
+
return get_permalink();
|
38
|
+
}
|
39
|
+
|
40
|
+
public static function echo_excerpt() {
|
41
|
+
echo ftt::get_excerpt();
|
42
|
+
}
|
43
|
+
|
44
|
+
public static function get_excerpt() {
|
45
|
+
add_filter('excerpt_more','ftt::excerpt_more');
|
46
|
+
return get_the_excerpt();
|
47
|
+
}
|
48
|
+
|
49
|
+
public static function echo_template_name() {
|
50
|
+
echo ftt::get_template_name();
|
51
|
+
}
|
52
|
+
|
53
|
+
public static function get_template_name() {
|
54
|
+
global $template;
|
55
|
+
return basename($template);
|
56
|
+
}
|
57
|
+
|
58
|
+
public static function excerpt_more() {
|
59
|
+
return ftt::excerpt_more_string;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
?>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ftt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -20,6 +20,7 @@ extensions: []
|
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
22
|
- lib/ftt.rb
|
23
|
+
- lib/php/ftt.php
|
23
24
|
- bin/ftt
|
24
25
|
homepage: http://website-in-a-weekend.net/gems/ftt
|
25
26
|
licenses: []
|