<commit_before><?php
/**
 * Plugin Name: Set Theme Directory
 */

if (! is_blog_installed()) {
    return;
}

register_theme_directory(dirname(__DIR__) . '/' . env('APP_PUBLIC', 'public') . '/themes');

add_filter('wp_prepare_themes_for_js', function ($themes) {
    foreach ($themes as &$theme) {
        if (! empty($theme['screenshot'])) {
            foreach ($theme['screenshot'] as &$screenshot) {
                $screenshot = str_replace(public_path(), '', $screenshot);
            }
        }
    }
    
    return $themes;
});
<commit_msg>Use public_path to register theme directory<commit_after><?php
/**
 * Plugin Name: Set Theme Directory
 */

if (! is_blog_installed()) {
    return;
}

register_theme_directory(public_path('themes'));

add_filter('wp_prepare_themes_for_js', function ($themes) {
    foreach ($themes as &$theme) {
        if (! empty($theme['screenshot'])) {
            foreach ($theme['screenshot'] as &$screenshot) {
                $screenshot = str_replace(public_path(), '', $screenshot);
            }
        }
    }
    
    return $themes;
});

{'fraction_non_alphanumeric': 0.16375344986200552, 'fraction_numerical': 0.0, 'mean_word_length': 2.9420289855072466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2458941', 'n_tokens_mistral': 355, 'n_tokens_neox': 333, 'n_words': 64}