|
7 | 7 | | Theme Actions
|
8 | 8 | |-----------------------------------------------------------
|
9 | 9 | |
|
10 |
| -| This file purpose is to include your theme custom |
11 |
| -| actions hooks, which allows to process various |
12 |
| -| logic is specifed parts of your system. |
| 10 | +| This file purpose is to include your custom |
| 11 | +| actions hooks, which process a various |
| 12 | +| logic at specific parts of WordPress. |
13 | 13 | |
|
14 | 14 | */
|
15 | 15 |
|
16 |
| -use function Tonik\Theme\App\template; |
17 |
| - |
18 |
| -/** |
19 |
| - * Renders post thumbnail by its formats. |
20 |
| - * |
21 |
| - * @see do_action('theme/index/post/thumbnail') |
22 |
| - * @uses resources/templates/partials/post/thumbnail-{format}.tpl.php |
23 |
| - */ |
24 |
| -function render_post_thumbnail() |
25 |
| -{ |
26 |
| - template(['partials/post/thumbnail', get_post_format()]); |
27 |
| -} |
28 |
| -add_action('theme/index/post/thumbnail', 'Tonik\Theme\App\Setup\render_post_thumbnail'); |
29 |
| - |
30 |
| -/** |
31 |
| - * Renders post contents by its formats. |
32 |
| - * |
33 |
| - * @see do_action('theme/index/post/content') |
34 |
| - * @uses resources/templates/partials/post/content-{format}.tpl.php |
35 |
| - */ |
36 |
| -function render_post_content() |
37 |
| -{ |
38 |
| - template(['partials/post/content', get_post_format()]); |
39 |
| -} |
40 |
| -add_action('theme/single/content', 'Tonik\Theme\App\Setup\render_post_content'); |
41 |
| - |
42 |
| -/** |
43 |
| - * Renders empty post content where there is no posts. |
44 |
| - * |
45 |
| - * @see do_action('theme/index/content/none') |
46 |
| - * @uses resources/templates/partials/index/content-none.tpl.php |
47 |
| - */ |
48 |
| -function render_empty_content() |
49 |
| -{ |
50 |
| - template(['partials/index/content', 'none']); |
51 |
| -} |
52 |
| -add_action('theme/index/content/none', 'Tonik\Theme\App\Setup\render_empty_content'); |
53 |
| - |
54 |
| -/** |
55 |
| - * Renders sidebar content. |
56 |
| - * |
57 |
| - * @see do_action('theme/index/sidebar') |
58 |
| - * @see do_action('theme/single/sidebar') |
59 |
| - * @uses resources/templates/partials/sidebar.tpl.php |
60 |
| - */ |
61 |
| -function render_sidebar() |
62 |
| -{ |
63 |
| - get_sidebar(); |
64 |
| -} |
65 |
| -add_action('theme/index/sidebar', 'Tonik\Theme\App\Setup\render_sidebar'); |
66 |
| -add_action('theme/single/sidebar', 'Tonik\Theme\App\Setup\render_sidebar'); |
67 |
| - |
68 | 16 | /**
|
69 |
| - * Renders [button] shortcode after homepage content. |
| 17 | + * Example action handler. |
70 | 18 | *
|
71 |
| - * @see do_action('theme/header/end') |
72 |
| - * @uses resources/templates/shortcodes/button.tpl.php |
| 19 | + * @return integer |
73 | 20 | */
|
74 |
| -function render_documentation_button() |
| 21 | +function example_action() |
75 | 22 | {
|
76 |
| - echo do_shortcode("[button href='https://github.com/tonik/tonik']Checkout documentation →[/button]"); |
| 23 | + // |
77 | 24 | }
|
78 |
| -add_action('theme/header/end', 'Tonik\Theme\App\Setup\render_documentation_button'); |
| 25 | +add_filter('excerpt_length', 'Tonik\Theme\App\Setup\example_action'); |
0 commit comments