Skip to content

Function file_in_theme is missing normalization #3820

@Santukon

Description

@Santukon

Hello Team,
Just to note that function file_in_theme at file https://github.com/reduxframework/redux-framework/blob/master/redux-core/inc/classes/class-redux-functions-ex.php on ilne 238 is missing normalization.
In my case it was not detecting the embedded core.

This is how I left it to work properly.

public static function file_in_theme( string $file ): bool {		
	// Normalization
	$filePath = self::wp_normalize_path( dirname( $file ) );
	
	if ( strpos( $filePath, self::wp_normalize_path( get_template_directory() ) ) !== false ) {
		return true;
	} elseif ( strpos( $filePath, self::wp_normalize_path( get_stylesheet_directory() ) ) !== false ) {
		return true;
	}

	return false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions