• 
    /**
     * Retrieves WP OAuth Server settings
     *
     * @param  [type] $key [description]
     *
     * @return [type]      [description]
     */
    function wo_setting( $key = null ) {
    
    	$default_settings = _WO()->defualt_settings;
    	$settings         = get_option( 'wo_options' );
    	$settings         = array_merge( $default_settings, array_filter( $settings, function ( $value ) {
    		return $value !== '';
    	} ) );
    

    This code throws warnings whenever get_option returns false, meaning the option did not already exist. This is a valid use case for the get_option function. The array_filter then throws a warning as you’re passing a boolean to a function that accepts an array. After that, array_merge throws another warning as you’re then passing that same boolean to it when it expects an array.

Viewing 1 replies (of 1 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Thank you for reporting this issue. It has been marked down on our check list to updates for the plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘get_option returns false causing array warnings’ is closed to new replies.