<commit_before><?php wp_template(__FILE__, true);

////////////////////////////////////////////////////////////
// functions/admin.php - Admin Customizations


// Hide the front-end admin bar when logged in
add_filter( 'show_admin_bar', function() {
    remove_action( 'wp_head', '_admin_bar_bump_cb' );
    return false;
});

// Hide wysiwyg editor for home page
add_action( 'edit_form_after_editor', function($post) {
    if( $post->ID == get_option('page_on_front') ) {
        echo '<style>#postdivrich { display: none; }</style>';
    }
});

// Customize tinymce
add_filter('tiny_mce_before_init', function($init) {
    $init['block_formats'] = 'Paragraph =p;Header 2=h2;Header 3=h3;Header 4=h4';
    $init['toolbar2'] = 'formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,undo,redo,wp_help';
    $default_colours = '
        "39b54a", "Green",
        "000000", "Black",
        "1c1c1c", "Very dark grey",
        "242424", "Dark Grey",
        "8d8d8d", "Grey",
        "d4d4d4", "Light Grey",
        "e1e1e1", "Off White",
        "ffffff", "White",
        ';
    $init['textcolor_map'] = '['.$default_colours.']';
    return $init;
});

// Setup Site Settings Menu
add_action('admin_menu', function() {
    add_options_page(
        'Site Settings',  // Page Title
        'Site Settings', // Menu Title
        'administrator', // Permissions
        'site_settings_page',  // Menu Slug
        function() { // Function used to display these settings ?>
            <h2>Specific Waste Industries General Website Settings</h2>
            <form method="post" action="options.php">
                <?php settings_fields( 'site_settings' ); ?>
                <?php do_settings_sections( 'site_settings_page' ); ?>
                <?php submit_button(); ?>
            </form><?php
        }
    );
});

// Register Site Settings Fields
add_action('admin_init', function() {

    add_settings_section(
        'co_general_section',
        'General Settings',
        null,
		'site_settings_page'
    );

	add_settings_field(
		'co_address',
		'Company Address',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'Street Address',
			'input_type'  => 'text',
			'input_name'  => 'co_address',
			'input_size'  => '50'
		)
	);

	add_settings_field(
		'co_city',
		'City',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'City',
			'input_type'  => 'text',
			'input_name'  => 'co_city',
			'input_size'  => '10'
		)
	);

	add_settings_field(
		'co_state',
		'State',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'State',
			'input_type'  => 'text',
			'input_name'  => 'co_state',
			'input_size'  => '2'
		)
	);

	add_settings_field(
		'co_zipcode',
		'Zipcode',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'Zipcode',
			'input_type'  => 'text',
			'input_name'  => 'co_zipcode',
			'input_size'  => '5'
		)
	);

	add_settings_field(
		'co_phone',
		'Company Phone Number',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'The phone number for Southeast Pallet Recycling.',
			'input_type'  => 'text',
			'input_name'  => 'co_phone',
			'input_size'  => '12'
		)
	);

    register_setting( 'site_settings', 'co_address' );
    register_setting( 'site_settings', 'co_city' );
    register_setting( 'site_settings', 'co_state' );
    register_setting( 'site_settings', 'co_zipcode' );
    register_setting( 'site_settings', 'co_phone' );
});

function co_display_settings_field($args) {
    $value = get_option($args['input_name']);
    $type = $args['input_type']; 
    $size = $args['input_size']; 
    $description = $args['description']; 
    $id = $name = $args['input_name'];?>

	<input type="<?= $type ?>" name="<?= $name ?>" id="<?= $id ?>" value="<?= $value ?>" size="<?= $size ?>" />
    <p class="description"><?= $description ?></p><?php 
}

?><commit_msg>Removes spurious text.<commit_after><?php wp_template(__FILE__, true);

////////////////////////////////////////////////////////////
// functions/admin.php - Admin Customizations


// Hide the front-end admin bar when logged in
add_filter( 'show_admin_bar', function() {
    remove_action( 'wp_head', '_admin_bar_bump_cb' );
    return false;
});

// Hide wysiwyg editor for home page
add_action( 'edit_form_after_editor', function($post) {
    if( $post->ID == get_option('page_on_front') ) {
        echo '<style>#postdivrich { display: none; }</style>';
    }
});

// Customize tinymce
add_filter('tiny_mce_before_init', function($init) {
    $init['block_formats'] = 'Paragraph =p;Header 2=h2;Header 3=h3;Header 4=h4';
    $init['toolbar2'] = 'formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,undo,redo,wp_help';
    $default_colours = '
        "39b54a", "Green",
        "000000", "Black",
        "1c1c1c", "Very dark grey",
        "242424", "Dark Grey",
        "8d8d8d", "Grey",
        "d4d4d4", "Light Grey",
        "e1e1e1", "Off White",
        "ffffff", "White",
        ';
    $init['textcolor_map'] = '['.$default_colours.']';
    return $init;
});

// Setup Site Settings Menu
add_action('admin_menu', function() {
    add_options_page(
        'Site Settings',  // Page Title
        'Site Settings', // Menu Title
        'administrator', // Permissions
        'site_settings_page',  // Menu Slug
        function() { // Function used to display these settings ?>
            <h2>Specific Waste Industries General Website Settings</h2>
            <form method="post" action="options.php">
                <?php settings_fields( 'site_settings' ); ?>
                <?php do_settings_sections( 'site_settings_page' ); ?>
                <?php submit_button(); ?>
            </form><?php
        }
    );
});

// Register Site Settings Fields
add_action('admin_init', function() {

    add_settings_section(
        'co_general_section',
        'General Settings',
        null,
		'site_settings_page'
    );

	add_settings_field(
		'co_address',
		'Company Address',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'Street Address',
			'input_type'  => 'text',
			'input_name'  => 'co_address',
			'input_size'  => '50'
		)
	);

	add_settings_field(
		'co_city',
		'City',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'City',
			'input_type'  => 'text',
			'input_name'  => 'co_city',
			'input_size'  => '10'
		)
	);

	add_settings_field(
		'co_state',
		'State',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'State',
			'input_type'  => 'text',
			'input_name'  => 'co_state',
			'input_size'  => '2'
		)
	);

	add_settings_field(
		'co_zipcode',
		'Zipcode',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'Zipcode',
			'input_type'  => 'text',
			'input_name'  => 'co_zipcode',
			'input_size'  => '5'
		)
	);

	add_settings_field(
		'co_phone',
		'Company Phone Number',
		'co_display_settings_field',
		'site_settings_page',
        'co_general_section',
		array(
			'description' => 'The company phone number.',
			'input_type'  => 'text',
			'input_name'  => 'co_phone',
			'input_size'  => '12'
		)
	);

    register_setting( 'site_settings', 'co_address' );
    register_setting( 'site_settings', 'co_city' );
    register_setting( 'site_settings', 'co_state' );
    register_setting( 'site_settings', 'co_zipcode' );
    register_setting( 'site_settings', 'co_phone' );
});

function co_display_settings_field($args) {
    $value = get_option($args['input_name']);
    $type = $args['input_type']; 
    $size = $args['input_size']; 
    $description = $args['description']; 
    $id = $name = $args['input_name'];?>

	<input type="<?= $type ?>" name="<?= $name ?>" id="<?= $id ?>" value="<?= $value ?>" size="<?= $size ?>" />
    <p class="description"><?= $description ?></p><?php 
}

?>
{'fraction_non_alphanumeric': 0.1834140435835351, 'fraction_numerical': 0.010895883777239709, 'mean_word_length': 3.149171270718232, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 87, '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': '4397335', 'n_tokens_mistral': 3040, 'n_tokens_neox': 2839, 'n_words': 523}