<commit_before><?php
class RationalOptionPages {
	private $pages = array(
		// parent level
		array(
			'page_title'	=> 'Rational Options',
			'menu_title'	=> 'Rational Options',
			'capability'	=> 'manage_options',
			'menu_slug'		=> 'rational_options',
			'icon_url'		=> 'dashicons-editor-code',
			'position'		=> 61,
			'description'	=> '<p>Accepts an HTML description</p>',
			// sections & fields
			'sections'	=> array(
				array(
					'id'			=> 'sample_fields',
					'title'			=> 'Sample Fields',
					'description'	=> 'Some of the fields and settings supported by the class',
					'fields'		=> array(
						array(
							'id'	=> 'sample_text',
							'title'	=> 'Sample Text',
							'type'	=> 'text',
							'description' => 'Things like text, search, url, tel, email and password.',
							'value' => 'Default value',
						),
						array(
							'id'	=> 'sample_textarea',
							'title'	=> 'Sample Textarea',
							'type'	=> 'textarea',
							'value'	=> 'Defaults to a large, code-style block but can easily be changed with class, rows and cols.',
						),
						array(
							'id'	=> 'sample_checkbox',
							'title'	=> 'Sample Checkbox',
							'type'	=> 'checkbox',
							'description' => 'Checkboxes of course.',
						),
						array(
							'id'	=> 'sample_radio',
							'title'	=> 'Sample Radio',
							'type'	=> 'radio',
							'options' => array(
								'Radio options are similar to those for selects',
								'radio-two' => 'Sequential or associative arrays work',
							),
						),
						array(
							'id'	=> 'sample_select',
							'title'	=> 'Sample Select',
							'type'	=> 'select',
							'options' => array(
								'Radio options are similar to those for selects',
								'radio-two' => 'Sequential or associative arrays work',
							),
							'description' => 'See? Same as the radio input above.'
						),
						array(
							'id'	=> 'sample_file',
							'title'	=> 'Sample File',
							'type'	=> 'file',
							'description' => 'Included file uploads for fun.'
						),
					),
				),
			),
		),
	);
	private $options;
	private $has_file = false;

	/**
	 * Append the init and page building methods to their appropriate methods
	 */
	public function __construct() {
		add_action( 'admin_menu', array( $this, 'add_pages' ) );
		add_action( 'admin_init', array( $this, 'page_init' ) );
		
		if ( $this->in_array_r( 'file', $this->pages ) ) {
			add_action( 'admin_print_scripts', array( $this, 'admin_scripts' ) );
			add_action( 'admin_print_styles', array( $this, 'admin_styles' ) );
			$this->has_file = true;
		}
	}

	/**
	 * Intercept the class function calls to check for field and page callbacks<commit_msg>Modifications to the defaults and comments<commit_after><?php
class RationalOptionPages {
	private $pages = array(
		// parent level
		array(
			'page_title'	=> 'Rational Options',
			'menu_title'	=> 'Rational Options',
			'capability'	=> 'manage_options',
			'menu_slug'		=> 'rational_options',
			'icon_url'		=> 'dashicons-editor-code',
			'position'		=> 61,
			'description'	=> '<p>Accepts an HTML description</p>',
			// sections & fields
			'sections'	=> array(
				array(
					'id'			=> 'sample_fields',
					'title'			=> 'Sample Fields',
					'description'	=> 'Some of the fields and settings supported by the class',
					'fields'		=> array(
						array(
							'id'	=> 'sample_text',
							'title'	=> 'Sample Text',
							'type'	=> 'text',
							'description' => 'Things like text, search, url, tel, email and password.',
							'value' => 'Default value',
						),
						array(
							'id'	=> 'sample_textarea',
							'title'	=> 'Sample Textarea',
							'type'	=> 'textarea',
							'value'	=> 'Defaults to a large, code-style block but can easily be changed with class, rows and cols.',
						),
						array(
							'id'	=> 'sample_checkbox',
							'title'	=> 'Sample Checkbox',
							'type'	=> 'checkbox',
							'description' => 'Checkboxes of course.',
						),
						array(
							'id'	=> 'sample_radio',
							'title'	=> 'Sample Radio',
							'type'	=> 'radio',
							'options' => array(
								'Radio options are similar to those for selects',
								'radio-two' => 'Sequential or associative arrays work',
							),
						),
						array(
							'id'	=> 'sample_select',
							'title'	=> 'Sample Select',
							'type'	=> 'select',
							'options' => array(
								'Radio options are similar to those for selects',
								'radio-two' => 'Sequential or associative arrays work',
							),
							'description' => 'See? Same as the radio input above.'
						),
						array(
							'id'	=> 'sample_file',
							'title'	=> 'Sample File',
							'type'	=> 'file',
							'description' => 'Included file uploads for fun.'
						),
					),
				),
			),
		),
/*
	//	A new options page
		array(
			'page_title'	=> 'Page Title',
			'menu_title'	=> 'Menu Title',
			'capability'	=> 'manage_options',
			'menu_slug'		=> 'menu_slug',
			'icon_url'		=> '',
			'position'		=> 99,
			'sections'		=> array(
	//			A new section
				array(
					'id'	=> 'section_id',
					'title'	=> 'Section Title',
					'fields'		=> array(
	//					A new field
						array(
							'id'	=> 'field_id',
							'title'	=> 'Field Title',
							'type'	=> 'text',
							'description' => 'Description.',
							'value' => 'Value',
						),
					),
				),
			),
		),
*/
	);
	private $options;
	private $has_file = false;

	/**
	 * Append the init and page building methods to their appropriate methods
	 */
	public function __construct() {
		add_action( 'admin_menu', array( $this, 'add_pages' ) );
		add_action( 'admin_init', array( $this, 'page_init' ) );
		
		if ( $this->in_array_r( 'file', $this->pages ) ) {
			add_action( 'admin_print_scripts', array( $this, 'admin_scripts' ) );
			add_action( 'admin_print_styles', array( $this, 'admin_styles' ) );
			$this->has_file = true;
		}
	}

	/**
	 * Intercept the class function calls to check for field and page callbacks
{'fraction_non_alphanumeric': 0.1661886283111186, 'fraction_numerical': 0.0010123165176311793, 'mean_word_length': 2.482961222091657, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 108, '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': '1981702', 'n_tokens_mistral': 2682, 'n_tokens_neox': 1941, 'n_words': 522}