@@ -195,13 +195,13 @@ function wc_graphql_price_range( $from, $to ) {
195195/**
196196 * Converts a camel case formatted string to a underscore formatted string.
197197 *
198- * @param string $string String to be formatted.
198+ * @param string $str String to be formatted.
199199 * @param boolean $capitalize Capitalize first letter of string.
200200 *
201201 * @return string
202202 */
203- function wc_graphql_underscore_to_camel_case ( $ string , $ capitalize = false ) {
204- $ str = str_replace ( ' ' , '' , ucwords ( str_replace ( '- ' , ' ' , $ string ) ) );
203+ function wc_graphql_underscore_to_camel_case ( $ str , $ capitalize = false ) {
204+ $ str = str_replace ( ' ' , '' , ucwords ( str_replace ( '- ' , ' ' , $ str ) ) );
205205
206206if ( ! $ capitalize ) {
207207$ str [0 ] = strtolower ( $ str [0 ] );
@@ -215,14 +215,14 @@ function wc_graphql_underscore_to_camel_case( $string, $capitalize = false ) {
215215/**
216216 * Converts a camel case formatted string to a underscore formatted string.
217217 *
218- * @param string $string String to be formatted.
218+ * @param string $str String to be formatted.
219219 *
220220 * @return string
221221 */
222- function wc_graphql_camel_case_to_underscore ( $ string ) {
222+ function wc_graphql_camel_case_to_underscore ( $ str ) {
223223preg_match_all (
224224'!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)! ' ,
225- $ string ,
225+ $ str ,
226226$ matches
227227);
228228
@@ -240,13 +240,13 @@ function wc_graphql_camel_case_to_underscore( $string ) {
240240/**
241241 * Get an option value from WooGraphQL settings
242242 *
243- * @param string $option_name The key of the option to return.
244- * @param mixed $default The default value the setting should return if no value is set.
245- * @param string $section_name The settings section name.
243+ * @param string $option_name The key of the option to return.
244+ * @param mixed $default_value The default value the setting should return if no value is set.
245+ * @param string $section_name The settings section name.
246246 *
247247 * @return mixed|string|int|boolean
248248 */
249- function woographql_setting ( string $ option_name , $ default = '' , $ section_name = 'woographql_settings ' ) {
249+ function woographql_setting ( string $ option_name , $ default_value = '' , $ section_name = 'woographql_settings ' ) {
250250$ section_fields = get_option ( $ section_name );
251251
252252/**
@@ -256,27 +256,27 @@ function woographql_setting( string $option_name, $default = '', $section_name =
256256 * @param string $section_name The name of the section
257257 * @param mixed $default The default value for the option being retrieved
258258 */
259- $ section_fields = apply_filters ( 'woographql_settings_section_fields ' , $ section_fields , $ section_name , $ default );
259+ $ section_fields = apply_filters ( 'woographql_settings_section_fields ' , $ section_fields , $ section_name , $ default_value );
260260
261261/**
262262 * Get the value from the stored data, or return the default
263263 */
264- if ( is_array ( $ default ) ) {
265- $ value = is_array ( $ section_fields ) && ! empty ( $ section_fields [ $ option_name ] ) ? $ section_fields [ $ option_name ] : $ default ;
264+ if ( is_array ( $ default_value ) ) {
265+ $ value = is_array ( $ section_fields ) && ! empty ( $ section_fields [ $ option_name ] ) ? $ section_fields [ $ option_name ] : $ default_value ;
266266} else {
267- $ value = isset ( $ section_fields [ $ option_name ] ) ? $ section_fields [ $ option_name ] : $ default ;
267+ $ value = isset ( $ section_fields [ $ option_name ] ) ? $ section_fields [ $ option_name ] : $ default_value ;
268268}
269269
270270/**
271271 * Filter the value before returning it
272272 *
273273 * @param mixed $value The value of the field
274- * @param mixed $default The default value if there is no value set
274+ * @param mixed $default_value The default value if there is no value set
275275 * @param string $option_name The name of the option
276276 * @param array $section_fields The setting values within the section
277277 * @param string $section_name The name of the section the setting belongs to
278278 */
279- return apply_filters ( 'woographql_settings_section_field_value ' , $ value , $ default , $ option_name , $ section_fields , $ section_name );
279+ return apply_filters ( 'woographql_settings_section_field_value ' , $ value , $ default_value , $ option_name , $ section_fields , $ section_name );
280280}
281281endif ;
282282
@@ -379,14 +379,3 @@ function woographql_verify_nonce( $nonce, $action = -1 ) {
379379return false ;
380380}
381381endif ;
382-
383-
384-
385-
386-
387-
388-
389-
390-
391-
392-
0 commit comments