PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.0.22
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.0.22
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / includes / class-shortcodes.php

class-shortcodes.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.0.22, at includes/class-shortcodes.php

53 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Shortcode related functions
4 *
5 * This class defines all code necessary for UsersWP shortcodes.
6 *
7 * @since 1.0.0
8 * @author GeoDirectory Team <info@wpgeodirectory.com>
9 */
10 class UsersWP_Shortcodes {
11
12 private $templates;
13
14 public function __construct($templates) {
15 $this->templates = $templates;
16 }
17
18 /**
19 * Returns the UsersWP profile page template content.
20 *
21 * @since 1.0.0
22 * @package userswp
23 * @return string UsersWP template content.
24 */
25 public function profile() {
26 return $this->uwp_generate_shortcode('profile');
27 }
28
29 /**
30 * Returns the UsersWP template content based on type.
31 *
32 * @since 1.0.0
33 * @package userswp
34 * @param string $type Template type.
35 * @return string UsersWP template content.
36 */
37 public function uwp_generate_shortcode($type = 'register') {
38
39 $template = $this->templates->uwp_locate_template($type);
40
41 ob_start();
42 echo '<div class="uwp_page">';
43 if ($template) {
44 include($template);
45 }
46 echo '</div>';
47 $output = ob_get_contents();
48 ob_end_clean();
49
50 return trim($output);
51 }
52
53 }