Clean up provided shortcode values
public static sanitizeShortcodeParameters ( array $attributes = [] ) : array | ||
$attributes | array | provided shortcode attributes { @type string shortcode attribute name @type mixed shortcode attribute value } |
리턴 | array | simplified shortcode values with defaults removed { @type string shortcode attribute name @type bool|string shortcode attribute value } |
/** * Test extracting a Periscope username from a shortcode through username attribute * * @since 1.3.0 * * @covers ::sanitizeShortcodeParameters * @small * * @dataProvider usernameProvider * * @param string $username Twitter username test value * * @return void */ public function testSanitizeShortcodeParametersScreenName($username) { $expected = 'twitter'; $options = \Twitter\WordPress\Shortcodes\PeriscopeOnAir::sanitizeShortcodeParameters(array('username' => $username)); $this->assertTrue(isset($options['username']) && $options['username'] === $expected, 'Failed to extract screen name from attribute'); }