@@ -27,33 +27,7 @@ public static function show_notice( $msg, $type = 'error', $is_dismissible = fal
2727 }
2828
2929 /**
30- * Combine function attributes with known attributes and fill in defaults when needed.
31- *
32- * @param array $pairs Entire list of supported attributes and their defaults.
33- * @param array $atts User defined attributes in shortcode tag.
34- * @return array Combined and filtered attribute list.
35- * @link https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/shortcodes.php#L540 Original source
36- * @since 0.2.0
37- */
38- public static function set_default_atts ( $ pairs , $ atts ) {
39-
40- $ atts = (array )$ atts ;
41- $ result = array ();
42-
43- foreach ($ pairs as $ name => $ default ) {
44- if ( array_key_exists ($ name , $ atts ) ) {
45- $ result [$ name ] = $ atts [$ name ];
46- } else {
47- $ result [$ name ] = $ default ;
48- }
49- }
50-
51- return $ result ;
52-
53- }
54-
55- /**
56- * Merges two array, eliminating duplicates
30+ * Merges two arrays, eliminating duplicates
5731 *
5832 * array_merge_recursive_distinct does not change the datatypes of the values in the arrays.
5933 * Matching keys' values in the second array overwrite those in the first array, as is the
@@ -168,29 +142,4 @@ public static function get_post_categories($as_slugs = false, $post_id = null) {
168142 return $ return ;
169143 }
170144
171- /**
172- * Encrypts string using WP_ENCRYPT_KEY as salt if defined, else SECURE_AUTH_KEY.
173- *
174- * @param string $str String to encrypt
175- * @return string Encrypted string
176- * @since 0.2.1
177- */
178- public static function encrypt ( $ str ) {
179- $ salt = defined ( 'WP_ENCRYPT_KEY ' ) && WP_ENCRYPT_KEY ? WP_ENCRYPT_KEY : SECURE_AUTH_KEY ;
180- return openssl_encrypt ($ str , self ::$ config ->get ( 'encrypt_method ' ), $ salt );
181- }
182-
183- /**
184- * Decrypts encrypted string
185- *
186- * @param string $str String to decrypt
187- * @return string Decrypted string
188- * @since 0.2.1
189- * @see Helpers::encrypt()
190- */
191- public static function decrypt ( $ str ) {
192- $ salt = defined ( 'WP_ENCRYPT_KEY ' ) && WP_ENCRYPT_KEY ? WP_ENCRYPT_KEY : SECURE_AUTH_KEY ;
193- return openssl_decrypt ($ str , self ::$ config ->get ( 'encrypt_method ' ), $ salt );
194- }
195-
196145}
0 commit comments