Shortcode.php
734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace AIOSEO\Plugin\Common\Sitemap\Html;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Handles the HTML sitemap shortcode.
*
* @since 4.1.3
*/
class Shortcode {
/**
* Class constructor.
*
* @since 4.1.3
*/
public function __construct() {
add_shortcode( 'aioseo_html_sitemap', [ $this, 'render' ] );
}
/**
* Shortcode callback.
*
* @since 4.1.3
*
* @param array $attributes The shortcode attributes.
* @return string|void The HTML sitemap.
*/
public function render( $attributes ) {
$attributes = aioseo()->htmlSitemap->frontend->getAttributes( $attributes );
return aioseo()->htmlSitemap->frontend->output( false, $attributes );
}
}