| @@ -18,8 +18,30 @@ | ||
| 18 | 18 | return $default; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | + * Render the guest login form used on topic/reply/forum prompts. | |
| 23 | + * | |
| 24 | + * Uses the Shortcodes setting when set; otherwise falls back to [forumax_login_form] | |
| 25 | + * so Sign In / Create Account tabs always appear (when registration is allowed). | |
| 26 | + * | |
| 27 | + * @return void | |
| 28 | + */ | |
| 29 | +function forumax_render_topic_login_form() { | |
| 30 | + $shortcode = ''; | |
| 31 | + | |
| 32 | + if ( function_exists( 'forumax_get_opt' ) ) { | |
| 33 | + $shortcode = trim( (string) forumax_get_opt( 'topic_login_shortcode', '[forumax_login_form]' ) ); | |
| 34 | + } | |
| 35 | + | |
| 36 | + if ( '' === $shortcode ) { | |
| 37 | + $shortcode = '[forumax_login_form]'; | |
| 38 | + } | |
| 39 | + | |
| 40 | + echo do_shortcode( $shortcode ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 41 | +} | |
| 42 | + | |
| 43 | +/** | |
| 22 | 44 | * Check if a plugin has been installed for specific number of days |
| 23 | 45 | * |
| 24 | 46 | * @param string $plugin_path The plugin path (e.g. 'woocommerce/woocommerce.php') |
| 25 | 47 | * @param int $days Number of days to check against |