/**
  * Outputs the body of the widget.
  *
  * @param array   $args     Widget args.
  * @param array   $instance Widget instance.
  * @param array   $settings Widget settings.
  * @return string The widget body content.
  */
 function widget_body($args, $instance, $settings)
 {
     extract($args);
     extract($settings);
     $admin_only = !isset($show_non_admins) || empty($show_non_admins) || '0' === $show_non_admins;
     $args = array('admin_only' => $admin_only, 'echo' => false, 'return' => false);
     return c2c_RevealTemplate::get_instance()->reveal($template_path_type, $args);
 }
Exemplo n.º 2
0
 function test_c2c_reveal_template_arg_format_from_settings()
 {
     apply_filters('category_template', get_stylesheet_directory() . '/category.php');
     $options = c2c_RevealTemplate::get_instance()->get_options();
     $this->assertEquals(str_replace('%template%', 'category.php', $options['format']), c2c_reveal_template(false, 'filename', array('format' => 'Abc (%template%)', 'format_from_settings' => true)));
 }
Exemplo n.º 3
0
 function c2c_reveal_template($echo = true, $template_path_type = '', $args = array())
 {
     // See (and possibly override) 'echo' value in $args with value passed as the $echo argument.
     $args['echo'] = $echo;
     return c2c_RevealTemplate::get_instance()->reveal($template_path_type, $args);
 }