{"id":15503732,"url":"https://github.com/arcath/theme-options","last_synced_at":"2026-05-14T13:36:08.492Z","repository":{"id":62486630,"uuid":"86059918","full_name":"Arcath/theme-options","owner":"Arcath","description":"Theme Customizer Options made easy","archived":false,"fork":false,"pushed_at":"2023-02-08T09:59:42.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T08:33:36.732Z","etag":null,"topics":["wordpress","wordpress-theme"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arcath.png","metadata":{"files":{"readme":"Readme.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-24T11:14:55.000Z","updated_at":"2023-02-08T09:58:54.000Z","dependencies_parsed_at":"2024-10-02T09:14:37.034Z","dependency_job_id":"fc5f53c0-08a5-43da-8c38-062ee31d2886","html_url":"https://github.com/Arcath/theme-options","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"bcef850c6539b9f254ef8f58569c8881b524d4bc"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Arcath/theme-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arcath%2Ftheme-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arcath%2Ftheme-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arcath%2Ftheme-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arcath%2Ftheme-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arcath","download_url":"https://codeload.github.com/Arcath/theme-options/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arcath%2Ftheme-options/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281425545,"owners_count":26499031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wordpress","wordpress-theme"],"created_at":"2024-10-02T09:14:35.239Z","updated_at":"2025-10-28T10:43:17.893Z","avatar_url":"https://github.com/Arcath.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Theme Options\n\nTheme Options Made Easy\n\n# Install\n\nEither install from composer `arcath/theme-options` or place `theme-options.php` in your theme and require it.\n\n# Usage\n\nCreate a new ThemeOptions instance\n\n```php\n$themeOptions = new Arcath\\ThemeOptions('slug');\n```\n\nIn the `init` action define all your fields e.g.\n\n```php\nfunction slug_custom_fields(){\n  global $themeOptions;\n\n  $themeOptions-\u003eaddThemeOptionCustomControl('logo_light',\n    array(\n      'type' =\u003e 'option',\n      'default' =\u003e 0\n    ),\n    array(\n      'section' =\u003e 'images',\n      'label' =\u003e __('Light Logo', 'slug'),\n      'description' =\u003e __('Light Logo used on darker backgrounds', 'glug'),\n    ),\n    'WP_Customize_Image_Control'\n  );\n\n  $themeOptions-\u003eaddThemeOption('email',\n    array(\n      'capability' =\u003e 'edit_theme_options',\n      'type'       =\u003e 'option',\n      'default'    =\u003e 'foo@bar.com',\n    ),\n    array(\n      'label' =\u003e 'Email',\n      'section' =\u003e 'text',\n      'description' =\u003e __('Your Email')\n    )\n  );\n}\n\nadd_action('init', 'slug_custom_fields');\n```\n\nIn `customize_register` create your sections/panels and apply the theme options.\n\n```php\nfunction slug_apply_custom_fields($wp_customize){\n  global $themeOptions;\n\n  $wp_customize-\u003eadd_panel('global', array(\n    'priority' =\u003e 1,\n    'capability'     =\u003e 'edit_theme_options',\n    'theme_supports' =\u003e '',\n    'title'          =\u003e __('Global Options', 'slug'),\n    'description'    =\u003e __('Global options that affect every page.', 'edit2017'),\n  ));\n\n  $wp_customize-\u003eadd_section(\n    'images',\n    array(\n      'title' =\u003e 'Images',\n      'description' =\u003e 'Images used throughout the Theme',\n      'capability' =\u003e 'edit_theme_options',\n      'panel' =\u003e 'global'\n    )\n  );\n\n  $wp_customize-\u003eadd_section(\n    'text',\n    array(\n      'title' =\u003e 'Text',\n      'description' =\u003e 'Text Fields',\n      'capability' =\u003e 'edit_theme_options',\n      'panel' =\u003e 'global'\n    )\n  );\n}\n\nadd_action('customize_register', 'slug_apply_custom_fields');\n```\n\nThen in your Theme you can pull any option using:\n\n```php\n\u003c?php\nglobal $themeOptions;\necho($themeOptions-\u003ethemeOption('email'));\n?\u003e\n```\n\nTheme Options handles returning the default if it has not been set in the post meta etc...\n\nEvery option is passed through a filter before being returned. This allows you to change defaults per page template etc...\n\n```php\n\u003c?php\n// Template Name: RED\nglobal $themeOptions;\n\nadd_filter('theme_slug_color', function($color){\n  // Over ride option to red on this page\n  return \"#f00\";\n})\n\necho($themeOptions-\u003ethemeOption('color'));\n?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcath%2Ftheme-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farcath%2Ftheme-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcath%2Ftheme-options/lists"}