-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from danimalweb/dev
v0.2
- Loading branch information
Showing
32 changed files
with
370 additions
and
661 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,41 @@ | ||
[![Build Status](https://travis-ci.org/danimalweb/wp-clean.svg)](https://travis-ci.org/danimalweb/wp-clean) | ||
|
||
# wp-clean | ||
# lambda-wp-clean | ||
WordPress plugin to clean up unused functionality and extra bloat. | ||
|
||
# Modules # | ||
|
||
* **Cleaner Markup**<br> | ||
`add_theme_support('WP_Clean-clean-up');` | ||
`add_theme_support('wp-clean-clean-up');` | ||
|
||
* **Disable Attachement Pages**<br> | ||
`add_theme_support('WP_Clean-disable-attachment-pages');` | ||
`add_theme_support('wp-clean-disable-attachment-pages');` | ||
|
||
* **Disable Author Pages**<br> | ||
`add_theme_support('WP_Clean-disable-author-pages');` | ||
`add_theme_support('wp-clean-disable-author-pages');` | ||
|
||
* **Disable Comments**<br> | ||
`add_theme_support('WP_Clean-disable-comments');` | ||
`add_theme_support('wp-clean-disable-comments');` | ||
|
||
* **Disable Emojicons**<br> | ||
`add_theme_support('WP_Clean-disable-emojicons');` | ||
`add_theme_support('wp-clean-disable-emojicons');` | ||
|
||
* **Disable RSS Feeds**<br> | ||
`add_theme_support('WP_Clean-disable-feed');` | ||
`add_theme_support('wp-clean-disable-feed');` | ||
|
||
* **Remove JSON API**<br> | ||
`add_theme_support('wp-clean-disable-json-api');` | ||
|
||
* **Disable Posts**<br> | ||
The built in posts that come with the default install.<br> | ||
`add_theme_support('WP_Clean-disable-posts');` | ||
`add_theme_support('wp-clean-disable-posts');` | ||
|
||
* **Disable Search**<br> | ||
`add_theme_support('WP_Clean-disable-search');` | ||
`add_theme_support('wp-clean-disable-search');` | ||
|
||
* **Disable Trackbacks**<br> | ||
`add_theme_support('WP_Clean-disable-trackbacks');` | ||
`add_theme_support('wp-clean-disable-trackbacks');` | ||
|
||
* **No redirect to fuzzy match on 404 error**<br> | ||
`add_theme_support('WP_Clean-no-redirect-on-404');` | ||
`add_theme_support('wp-clean-no-redirect-on-404');` | ||
|
||
* **Remove Dashboard Widgets**<br> | ||
`add_theme_support('WP_Clean-remove-dashboard-widgets');` | ||
`add_theme_support('wp-clean-remove-dashboard-widgets');` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Lambda WP Clean | ||
* Plugin URI: https://github.com/danimalweb/wp-clean | ||
* Description: WordPress plugin to clean up unused functionality and extra bloat. | ||
* Author: Daniel Hewes | ||
* Version: 0.2 | ||
* Author URI: http://lambdacreatives.com/ | ||
*/ | ||
|
||
|
||
/** | ||
* Module include based on add_theme_support value | ||
*/ | ||
add_action('after_setup_theme', function() { | ||
foreach (glob(__DIR__ . '/modules/*.php') as $file) { | ||
if (current_theme_supports('wp-clean-' . basename($file, '.php'))) { | ||
require_once $file; | ||
} | ||
} | ||
}); | ||
|
||
|
||
/** | ||
* Hooks a single callback to multiple tags | ||
*/ | ||
function add_filters($tags, $function, $priority = 10, $accepted_args = 1) { | ||
foreach ((array) $tags as $tag) { | ||
add_filter($tag, $function, $priority, $accepted_args); | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Add multiple actions to a closure | ||
* | ||
* @param $tags | ||
* @param $function_to_add | ||
* @param int $priority | ||
* @param int $accepted_args | ||
* | ||
* @return bool true | ||
*/ | ||
function add_actions($tags, $function_to_add, $priority = 10, $accepted_args = 1) { | ||
//add_action() is just a wrapper around add_filter(), so we do the same | ||
return add_filters($tags, $function_to_add, $priority, $accepted_args); | ||
} |
Oops, something went wrong.