http
2 weeks ago
integrations
2 weeks ago
mfa
2 weeks ago
mfa-flow
2 weeks ago
AdminNoticesController.php
2 weeks ago
Ajax.php
2 weeks ago
CloudApp.php
2 weeks ago
Config.php
2 weeks ago
Helpers.php
2 weeks ago
LimitLoginAttempts.php
2 weeks ago
LoginFlowTransientStore.php
2 weeks ago
MfaConstants.php
2 weeks ago
Shortcodes.php
2 weeks ago
Shortcodes.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace LLAR\Core; |
| 4 | |
| 5 | if( !defined( 'ABSPATH' ) ) exit(); |
| 6 | |
| 7 | class Shortcodes { |
| 8 | |
| 9 | /** |
| 10 | * Register all shortcodes |
| 11 | */ |
| 12 | public function register() { |
| 13 | |
| 14 | add_shortcode( 'llar-link', array( $this, 'llar_link_callback' ) ); |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * [llar-link url="" text=""] callback |
| 19 | * |
| 20 | * @param $attr |
| 21 | * |
| 22 | * @return string |
| 23 | */ |
| 24 | public function llar_link_callback( $attr ) { |
| 25 | |
| 26 | $attr = shortcode_atts( array( |
| 27 | 'url' => '#', |
| 28 | 'text' => 'Link' |
| 29 | ), $attr ); |
| 30 | |
| 31 | return '<a href="' . esc_url( $attr['url'] ) . '" target="_blank">' . esc_html( $attr['text'] ) . '</a>'; |
| 32 | } |
| 33 | |
| 34 | } |