sanitizeShortcodeParameters() public static method

Clean up provided shortcode values
Since: 1.3.0
public static sanitizeShortcodeParameters ( array $attributes = [] ) : array
$attributes array provided shortcode attributes { @type string shortcode attribute name @type mixed shortcode attribute value }
return array simplified shortcode values with defaults removed { @type string shortcode attribute name @type bool|string shortcode attribute value }
Ejemplo n.º 1
0
 /**
  * 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');
 }