1 | <?php |
||
26 | class ShortcodeAttsParser implements ShortcodeAttsParserInterface { |
||
27 | |||
28 | use ConfigTrait; |
||
29 | |||
30 | /** |
||
31 | * Instantiate the shortcode attributes parser object |
||
32 | * |
||
33 | * @since 0.1.0 |
||
34 | * |
||
35 | * @param ConfigInterface $config Configuration array to |
||
36 | * parametrize the shortcode |
||
37 | * attributes. |
||
38 | * @throws RuntimeException If the config could not be processed. |
||
39 | */ |
||
40 | public function __construct( ConfigInterface $config ) { |
||
43 | |||
44 | /** |
||
45 | * Parse and validate the shortcode's attributes. |
||
46 | * |
||
47 | * @since 0.1.0 |
||
48 | * |
||
49 | * @param array $atts Attributes passed to the shortcode. |
||
50 | * @param string $tag Tag of the shortcode. |
||
51 | * @return array Validated attributes of the shortcode. |
||
52 | */ |
||
53 | public function parse_atts( $atts, $tag ) { |
||
62 | |||
63 | /** |
||
64 | * Return an array of default attributes read from the configuration array. |
||
65 | * |
||
66 | * @since 0.1.0 |
||
67 | * |
||
68 | * @return array Default attributes. |
||
69 | */ |
||
70 | protected function default_atts() { |
||
87 | |||
88 | /** |
||
89 | * Return an array of validated attributes checked against the |
||
90 | * configuration array. |
||
91 | * |
||
92 | * @since 0.1.0 |
||
93 | * |
||
94 | * @param array $atts Attributes that were passed to the shortcode. |
||
95 | * @return array Validated attributes. |
||
96 | */ |
||
97 | protected function validated_atts( $atts ) { |
||
115 | } |
||
116 |