/** * Rendering the shortcode this class is responsible for. * * @return string $content */ public function render() { if (!is_user_logged_in()) { Sensei()->notices->add_notice(__('Please login to view your messages.', 'woothemes-sensei'), 'alert'); } elseif (0 == $this->messages_query->post_count) { Sensei()->notices->add_notice(__('You do not have any messages.', 'woothemes-sensei'), 'alert'); } $messages_disabled_in_settings = !(!isset(Sensei()->settings->settings['messages_disable']) || !Sensei()->settings->settings['messages_disable']); // don't show anything if messages are disable if ($messages_disabled_in_settings) { return ''; } //set the wp_query to the current messages query global $wp_query; $wp_query = $this->messages_query; ob_start(); Sensei()->notices->print_notices(); Sensei_Templates::get_part('loop', 'message'); $messages_html = ob_get_clean(); // set back the global query wp_reset_query(); return $messages_html; }
/** * This is a wrapper function for Sensei_Templates::get_part * It helps simplify templates for designers by removing the class::function call. * * @param string $slug the first part to the template file name * @param string $name the name of the template. * @since 1.9.0 */ function sensei_load_template_part($slug, $name) { Sensei_Templates::get_part($slug, $name); }
/** * sensei_get_template_part function. * * @deprecated sine 1.9.0 * @access public * @param mixed $slug * @param string $name (default: '') * @return void */ function sensei_get_template_part($slug, $name = '') { _deprecated_function('class-woothemes-sensei-frontend.php', '1.9.0', 'Sensei_Templates::get_part'); Sensei_Templates::get_part($slug, $name); }