Skip to content

Commit

Permalink
Merge pull request #11 from danimalweb/dev
Browse files Browse the repository at this point in the history
v0.2
  • Loading branch information
danimalweb authored Nov 4, 2016
2 parents 458fad2 + 583ef14 commit de46897
Show file tree
Hide file tree
Showing 32 changed files with 370 additions and 661 deletions.
5 changes: 0 additions & 5 deletions .gitattributes

This file was deleted.

27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

29 changes: 15 additions & 14 deletions README.md
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');`
98 changes: 0 additions & 98 deletions bin/install-wp-tests.sh

This file was deleted.

22 changes: 0 additions & 22 deletions composer.json

This file was deleted.

47 changes: 47 additions & 0 deletions lambda-wp-clean.php
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);
}
Loading

0 comments on commit de46897

Please sign in to comment.