| @@ -19,9 +19,8 @@ | ||
| 19 | 19 | * |
| 20 | 20 | * @return array |
| 21 | 21 | */ |
| 22 | 22 | public static function get_tag_attributes( $tag ) { |
| 23 | - | |
| 24 | 23 | $tag = strstr( $tag, ' ', false ); |
| 25 | 24 | $tag = trim( $tag, '> ' ); |
| 26 | 25 | $args = shortcode_parse_atts( $tag ); |
| 27 | 26 | $return = array(); |
| @@ -43,9 +42,8 @@ | ||
| 43 | 42 | * |
| 44 | 43 | * @return bool |
| 45 | 44 | */ |
| 46 | 45 | public static function is_void_element( $element ) { |
| 47 | - | |
| 48 | 46 | $void_elements = array( |
| 49 | 47 | 'area', |
| 50 | 48 | 'base', |
| 51 | 49 | 'br', |
| @@ -100,9 +98,8 @@ | ||
| 100 | 98 | * |
| 101 | 99 | * @return string |
| 102 | 100 | */ |
| 103 | 101 | public static function build_attributes( $attributes ) { |
| 104 | - | |
| 105 | 102 | $parts = array(); |
| 106 | 103 | foreach ( $attributes as $attribute => $value ) { |
| 107 | 104 | if ( is_array( $value ) ) { |
| 108 | 105 | if ( count( $value ) !== count( $value, COUNT_RECURSIVE ) ) { |
| @@ -114,48 +111,7 @@ | ||
| 114 | 111 | $parts[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"'; |
| 115 | 112 | } |
| 116 | 113 | |
| 117 | 114 | return implode( ' ', $parts ); |
| 118 | - } | |
| 119 | 115 | |
| 120 | - /** | |
| 121 | - * Generate a new ID for a group. | |
| 122 | - * | |
| 123 | - * @return string | |
| 124 | - */ | |
| 125 | - public static function generate_id() { | |
| 126 | - | |
| 127 | - return uniqid( 'nd' ); | |
| 128 | 116 | } |
| 129 | - | |
| 130 | - /** | |
| 131 | - * Get a sanitized input text field. | |
| 132 | - * | |
| 133 | - * Reads directly from the superglobals rather than filter_input(), which has a | |
| 134 | - * long-standing PHP/SAPI bug where INPUT_POST/INPUT_GET can return NULL even | |
| 135 | - * though the superglobal has the value. | |
| 136 | - * | |
| 137 | - * @param int $type The type to get. | |
| 138 | - * @param string $var The value to get. | |
| 139 | - * | |
| 140 | - * @return mixed | |
| 141 | - */ | |
| 142 | - public static function get_sanitized_text( $type, $var ) { | |
| 143 | - | |
| 144 | - switch ( $type ) { | |
| 145 | - case INPUT_POST: | |
| 146 | - $value = isset( $_POST[ $var ] ) ? wp_unslash( $_POST[ $var ] ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Missing | |
| 147 | - break; | |
| 148 | - case INPUT_GET: | |
| 149 | - $value = isset( $_GET[ $var ] ) ? wp_unslash( $_GET[ $var ] ) : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 150 | - break; | |
| 151 | - case INPUT_SERVER: | |
| 152 | - $value = isset( $_SERVER[ $var ] ) ? wp_unslash( $_SERVER[ $var ] ) : null; | |
| 153 | - break; | |
| 154 | - default: | |
| 155 | - $value = null; | |
| 156 | - } | |
| 157 | - | |
| 158 | - return null === $value ? null : sanitize_text_field( $value ); | |
| 159 | - } | |
| 160 | - | |
| 161 | 117 | } |