| 1 |
<?php |
| 2 |
/** |
| 3 |
* Helpers Posts |
| 4 |
* |
| 5 |
* @package Powerkit |
| 6 |
* @subpackage Modules/Helper |
| 7 |
*/ |
| 8 |
|
| 9 |
/** |
| 10 |
* Widget template handler |
| 11 |
* |
| 12 |
* @param string $name Specific template. |
| 13 |
* @param array $posts Array of posts. |
| 14 |
* @param array $params Array of params. |
| 15 |
* @param array $instance Widget instance. |
| 16 |
*/ |
| 17 |
function powerkit_widget_featured_posts_handler( $name, $posts, $params, $instance ) { |
| 18 |
$templates = apply_filters( 'powerkit_featured_posts_templates', array() ); |
| 19 |
|
| 20 |
if ( isset( $templates[ $name ] ) && function_exists( $templates[ $name ]['func'] ) ) { |
| 21 |
call_user_func( $templates[ $name ]['func'], $posts, $params, $instance ); |
| 22 |
} else { |
| 23 |
call_user_func( 'powerkit_widget_featured_posts_template', $posts, $params, $instance ); |
| 24 |
} |
| 25 |
} |
| 26 |
|