Skip to content

Commit 7f2be3f

Browse files
committed
docs: added code comment to the top of functions and filters files to note which one should be used for custom scripts. Plus auto formatting.
1 parent a077473 commit 7f2be3f

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

app/filters.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
/**
44
* Theme filters.
5+
*
6+
* Use this to add or remove theme functionality.
7+
*
8+
*! Treat this as the new functions.php file
9+
*
10+
* To use a named function use __NAMESPACE__ . '\\function_name' syntax in the filter/action.
511
*/
612

713
namespace App;
@@ -21,8 +27,8 @@
2127
*/
2228
add_filter('default_content', function ($content) {
2329
$content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam venenatis arcu odio, et facilisis nibh venenatis ut. Vestibulum viverra lacus vitae lacus gravida laoreet ac at purus.
24-
30+
2531
Maecenas arcu odio, suscipit id posuere vel, consequat eu orci. Nullam dictum placerat dolor, eu eleifend lacus ullamcorper ut.";
26-
32+
2733
return $content;
2834
});

functions.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<?php
22

3+
/**
4+
* Functions file
5+
*
6+
*! Please do not add any new functions to this file.
7+
* Use the app/filters.php file instead.
8+
*! Treat the filters.php file as the new functions file.
9+
*/
10+
311
/*
412
|--------------------------------------------------------------------------
513
| Register The Auto Loader
@@ -35,7 +43,7 @@
3543
'',
3644
[
3745
'link_url' => 'https://roots.io/acorn/docs/installation/',
38-
'link_text' => __('Acorn Docs: Installation', 'sage'),
46+
'link_text' => __('Acorn Docs: Installation', 'sage')
3947
]
4048
);
4149
}
@@ -53,7 +61,7 @@
5361
| is registered alongside Sage.
5462
|
5563
*/
56-
$required_files = ['admin', 'filters', 'helpers', 'setup'];
64+
$required_files = ['admin', 'filters', 'helpers', 'setup', 'disable_wp_rubbish'];
5765

5866
collect($required_files)
5967
->each(

0 commit comments

Comments
 (0)