Skip to content

Commit de46897

Browse files
authored
Merge pull request #11 from danimalweb/dev
v0.2
2 parents 458fad2 + 583ef14 commit de46897

32 files changed

+370
-661
lines changed

.gitattributes

-5
This file was deleted.

.travis.yml

-27
This file was deleted.

README.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
1-
[![Build Status](https://travis-ci.org/danimalweb/wp-clean.svg)](https://travis-ci.org/danimalweb/wp-clean)
2-
3-
# wp-clean
1+
# lambda-wp-clean
42
WordPress plugin to clean up unused functionality and extra bloat.
53

64
# Modules #
75

86
* **Cleaner Markup**<br>
9-
`add_theme_support('WP_Clean-clean-up');`
7+
`add_theme_support('wp-clean-clean-up');`
108

119
* **Disable Attachement Pages**<br>
12-
`add_theme_support('WP_Clean-disable-attachment-pages');`
10+
`add_theme_support('wp-clean-disable-attachment-pages');`
1311

1412
* **Disable Author Pages**<br>
15-
`add_theme_support('WP_Clean-disable-author-pages');`
13+
`add_theme_support('wp-clean-disable-author-pages');`
1614

1715
* **Disable Comments**<br>
18-
`add_theme_support('WP_Clean-disable-comments');`
16+
`add_theme_support('wp-clean-disable-comments');`
1917

2018
* **Disable Emojicons**<br>
21-
`add_theme_support('WP_Clean-disable-emojicons');`
19+
`add_theme_support('wp-clean-disable-emojicons');`
2220

2321
* **Disable RSS Feeds**<br>
24-
`add_theme_support('WP_Clean-disable-feed');`
22+
`add_theme_support('wp-clean-disable-feed');`
23+
24+
* **Remove JSON API**<br>
25+
`add_theme_support('wp-clean-disable-json-api');`
2526

2627
* **Disable Posts**<br>
2728
The built in posts that come with the default install.<br>
28-
`add_theme_support('WP_Clean-disable-posts');`
29+
`add_theme_support('wp-clean-disable-posts');`
2930

3031
* **Disable Search**<br>
31-
`add_theme_support('WP_Clean-disable-search');`
32+
`add_theme_support('wp-clean-disable-search');`
3233

3334
* **Disable Trackbacks**<br>
34-
`add_theme_support('WP_Clean-disable-trackbacks');`
35+
`add_theme_support('wp-clean-disable-trackbacks');`
3536

3637
* **No redirect to fuzzy match on 404 error**<br>
37-
`add_theme_support('WP_Clean-no-redirect-on-404');`
38+
`add_theme_support('wp-clean-no-redirect-on-404');`
3839

3940
* **Remove Dashboard Widgets**<br>
40-
`add_theme_support('WP_Clean-remove-dashboard-widgets');`
41+
`add_theme_support('wp-clean-remove-dashboard-widgets');`

bin/install-wp-tests.sh

-98
This file was deleted.

composer.json

-22
This file was deleted.

lambda-wp-clean.php

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Plugin Name: Lambda WP Clean
4+
* Plugin URI: https://github.com/danimalweb/wp-clean
5+
* Description: WordPress plugin to clean up unused functionality and extra bloat.
6+
* Author: Daniel Hewes
7+
* Version: 0.2
8+
* Author URI: http://lambdacreatives.com/
9+
*/
10+
11+
12+
/**
13+
* Module include based on add_theme_support value
14+
*/
15+
add_action('after_setup_theme', function() {
16+
foreach (glob(__DIR__ . '/modules/*.php') as $file) {
17+
if (current_theme_supports('wp-clean-' . basename($file, '.php'))) {
18+
require_once $file;
19+
}
20+
}
21+
});
22+
23+
24+
/**
25+
* Hooks a single callback to multiple tags
26+
*/
27+
function add_filters($tags, $function, $priority = 10, $accepted_args = 1) {
28+
foreach ((array) $tags as $tag) {
29+
add_filter($tag, $function, $priority, $accepted_args);
30+
}
31+
}
32+
33+
34+
/**
35+
* Add multiple actions to a closure
36+
*
37+
* @param $tags
38+
* @param $function_to_add
39+
* @param int $priority
40+
* @param int $accepted_args
41+
*
42+
* @return bool true
43+
*/
44+
function add_actions($tags, $function_to_add, $priority = 10, $accepted_args = 1) {
45+
//add_action() is just a wrapper around add_filter(), so we do the same
46+
return add_filters($tags, $function_to_add, $priority, $accepted_args);
47+
}

0 commit comments

Comments
 (0)