Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Themes::fill_missing_defaults( array $settings = array() )
Fills default settings only when missing.
Description Description
Excludes checkbox type fields where a false value is represented by the field being unset.
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $settings
-
(Optional)
Default value: array()
Return Return
(array)
Source Source
File: classes/Admin/Themes.php
public static function fill_missing_defaults( $settings = [] ) { $excluded_field_types = [ 'checkbox', 'multicheck' ]; $defaults = self::defaults(); foreach ( $defaults as $field_id => $default_value ) { $field = PUM_Utils_Fields::get_field( self::fields(), $field_id ); if ( isset( $settings[ $field_id ] ) || in_array( $field['type'], $excluded_field_types ) ) { continue; } $settings[ $field_id ] = $default_value; } return $settings; }
Expand full source code Collapse full source code View on Trac