@@ -109,8 +109,20 @@ public function is_ajax() {
109109 return defined ('DOING_AJAX ' ) && DOING_AJAX ;
110110 }
111111
112+ /**
113+ * A wrapper for the plugin's data fiala prefix as defined in $settings
114+ *
115+ * @return string Prefix
116+ */
117+ public function prefix ( $ field_name = null ) {
118+ if ( $ field_name ) {
119+ return self ::$ prefix . $ field_name ;
120+ }
121+ return self ::$ prefix ;
122+ }
123+
112124/**
113- * Wrapper for phpversion() and version_compare()
125+ * Wrapper for phpversion() and version_compare(), intended for legacy support.
114126 *
115127 * @return bool
116128 */
@@ -181,33 +193,4 @@ public function get_script_url($script, $return_minified = false) {
181193 return $ this ->get_script_path ($ script , $ return_minified , true );
182194 }
183195
184- /**
185- * Merges two array, eliminating duplicates
186- *
187- * array_merge_recursive_distinct does not change the datatypes of the values in the arrays.
188- * Matching keys' values in the second array overwrite those in the first array, as is the
189- * case with array_merge().
190- *
191- * @param array $array1
192- * @param array $array2
193- * @return array
194- * @author Daniel <daniel (at) danielsmedegaardbuus (dot) dk>
195- * @author Gabriel Sobrinho <gabriel (dot) sobrinho (at) gmail (dot) com>
196- */
197- private function array_merge_recursive_distinct ( array &$ array1 , array &$ array2 ) {
198- // Credit: http://php.net/manual/en/function.array-merge-recursive.php#92195
199- $ merged = $ array1 ;
200-
201- foreach ( $ array2 as $ key => &$ value )
202- {
203- if ( is_array ( $ value ) && isset ( $ merged [$ key ] ) && is_array ( $ merged [$ key ] ) ) {
204- $ merged [$ key ] = self ::array_merge_recursive_distinct ( $ merged [$ key ], $ value );
205- } else {
206- $ merged [$ key ] = $ value ;
207- }
208- }
209-
210- return $ merged ;
211- }
212-
213196}
0 commit comments