{"id":21931316,"url":"https://github.com/themeplate/cleaner","last_synced_at":"2026-03-01T14:03:40.763Z","repository":{"id":57068291,"uuid":"253029034","full_name":"ThemePlate/Cleaner","owner":"ThemePlate","description":"A complete markup cleaner","archived":false,"fork":false,"pushed_at":"2025-03-02T03:54:18.000Z","size":58,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T04:25:03.830Z","etag":null,"topics":["wordpress","wordpress-clean-theme"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThemePlate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-04-04T15:15:15.000Z","updated_at":"2025-03-02T03:54:11.000Z","dependencies_parsed_at":"2024-11-19T10:35:58.467Z","dependency_job_id":"34c53e89-cc8f-42c7-98d4-26ae72b2a00f","html_url":"https://github.com/ThemePlate/Cleaner","commit_stats":{"total_commits":59,"total_committers":1,"mean_commits":59.0,"dds":0.0,"last_synced_commit":"9fe68272fa6534daafc2023810b179b41c4c2262"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FCleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FCleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FCleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThemePlate%2FCleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThemePlate","download_url":"https://codeload.github.com/ThemePlate/Cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959454,"owners_count":20538628,"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","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-clean-theme"],"created_at":"2024-11-28T23:13:31.295Z","updated_at":"2026-03-01T14:03:40.694Z","avatar_url":"https://github.com/ThemePlate.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ThemePlate Cleaner\n\n## Usage\n\n```php\nadd_action( 'init', array( 'ThemePlate\\Cleaner', 'init' ) );\n\nadd_action( 'after_setup_theme', function() {\n\tadd_theme_support( 'tpc_wp_head' );\n\tadd_theme_support( 'tpc_emoji_detection' );\n\tadd_theme_support( 'tpc_query_strings' );\n\tadd_theme_support( 'tpc_dependency_tag' );\n\tadd_theme_support( 'tpc_unnecessary_class' );\n\tadd_theme_support( 'tpc_extra_styles' );\n\tadd_theme_support( 'tpc_embed_wrap' );\n\tadd_theme_support( 'tpc_nav_walker' );\n\tadd_theme_support( 'tpc_archive_views' );\n\tadd_theme_support( 'tpc_default_views' );\n\tadd_theme_support( 'tpc_footer_scripts' );\n} );\n```\n\n### Custom clean navwalker\n\n#### Simplest (need custom classes)\n\n```php\nclass Clean_Navbar extends ThemePlate\\NavWalker {\n\tpublic array $classes = array(\n\t\t'sub-menu' =\u003e 'sub-menu-list',\n\t\t'has-sub'  =\u003e 'has-children',\n\t\t'active'   =\u003e 'current-item',\n\t\t'item'     =\u003e 'menu-item',\n\t\t'depth'    =\u003e 'level-',\n\t);\n}\n```\n\n#### Bootstrap Navbar (with dropdowns)\n\n```php\nclass Boostrap_Navbar extends ThemePlate\\NavWalker {\n\tpublic array $classes = array(\n\t\t'sub-menu' =\u003e 'dropdown-menu',\n\t\t'has-sub'  =\u003e 'dropdown',\n\t\t'active'   =\u003e '',\n\t\t'item'     =\u003e 'nav-item',\n\t\t'depth'    =\u003e '',\n\t);\n\n\tpublic function attributes( $atts, $item, $args ) {\n\t\t$atts['class'] = 'nav-link';\n\n\t\tif ( $args-\u003ewalker-\u003ehas_children ) {\n\t\t\t$atts['class']         .= ' dropdown-toggle';\n\t\t\t$atts['data-bs-toggle'] = 'dropdown';\n\t\t\t$atts['aria-haspopup']  = 'true';\n\t\t}\n\n\t\tif ( isset( $item-\u003ecurrent ) \u0026\u0026 $item-\u003ecurrent ) {\n\t\t\t$atts['class'] .= ' active';\n\t\t}\n\n\t\treturn $atts;\n\t}\n}\n```\n\n#### Full control (override properties and methods)\n\n```php\nclass Custom_Walker extends ThemePlate\\NavWalker {\n\tpublic const FALLBACK = array(\n\t\t'Please add',\n\t\t'some menu',\n\t\t'items here',\n\t);\n\n\tpublic function submenu_css_class( array $classes, stdClass $args, int $depth ): array {\n\t\tif ( ! $args-\u003ewalker instanceof $this ) {\n\t\t\treturn $classes;\n\t\t}\n\n\t\t$classes[] = 'sub-' . $depth;\n\n\t\treturn $classes;\n\t}\n\n\tpublic function css_class( array $classes, WP_Post $menu_item, stdClass $args, int $depth ): array {\n\t\tif ( ! $args-\u003ewalker instanceof $this ) {\n\t\t\treturn $classes;\n\t\t}\n\n\t\tif ( '_blank' === $menu_item-\u003etarget ) {\n\t\t\t$classes[] = 'external';\n\t\t}\n\n\t\treturn $classes;\n\t}\n\n\tpublic function item_id( string $menu_id, WP_Post $menu_item, stdClass $args, int $depth ): string {\n\t\tif ( ! $args-\u003ewalker instanceof $this ) {\n\t\t\treturn $menu_id;\n\t\t}\n\n\t\tif ( 10 === $menu_item-\u003eID ) {\n\t\t\t$menu_id = 'i-ten';\n\t\t}\n\n\t\treturn $menu_id;\n\t}\n\n\tpublic function link_attributes( array $atts, WP_Post $menu_item, stdClass $args, int $depth ): array {\n\t\tif ( ! $args-\u003ewalker instanceof $this ) {\n\t\t\treturn $atts;\n\t\t}\n\n\t\tif ( in_array( 'icon', $menu_item-\u003eclasses, true ) ) {\n\t\t\t$atts['aria-hidden'] = true;\n\t\t}\n\n\t\treturn $atts;\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemeplate%2Fcleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemeplate%2Fcleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemeplate%2Fcleaner/lists"}