Topic: Request for user functions file

The inclusion of a user.css file which allows the user to add/modify Arras styles without changing the original Arras files was great. In the spirit of that, I think that it will be a great idea to add a user functions.php file which users can use to add their own actions and filters without having to change the original Arras file.

My proposal is that Arras includes an empty file called 'user_functions.php'. This file will be sourced by functions.php or launcher.php (I'll let theme developers decide which is better). This new file should be sourced at a spot where most (if not all) Arras filters and actions are available to it so users who add code there don't get "undefined" errors.

The advantages of having such a file is that: 1. user won't have to modify stock Arras code in order to add their own actions and/or filters; 2. updating to a new Arras version will not be as difficult as users will be able to save their user.css and user_functions.php files and retain most (if not all) of their changes.

What do you think?

Thumbs up

Re: Request for user functions file

Doesn't the functions.php file refer to other PHP files? So then it would be required to have a user-slideshow.php, user-tapestries.php...etc?

Re: Request for user functions file

dgodfather wrote:

Doesn't the functions.php file refer to other PHP files? So then it would be required to have a user-slideshow.php, user-tapestries.php...etc?

I don't exactly understand what your question is.

I don't think that you need a user-slideshow.php or user-tapestries.php because you can use the Arras actions and filters to modify/replace the stock functions. The same way as I don't need a user-admin.css or user-blue.css.

All I was getting at is that I would like to have a place where users can add their own action and filter functions without having to mess with stock Arras files - basically identical to user.css but for PHP code and CSS.

Thumbs up

Re: Request for user functions file

I agree that it would be nice void. My question was what if the PHP you need to modify is in a PHP file other than functions.php.

I'm a PHP noob, so my question might not even be relevant. It's just my observation with my noobish PHP skills.

Re: Request for user functions file

dgodfather wrote:

I agree that it would be nice void. My question was what if the PHP you need to modify is in a PHP file other than functions.php.

I'm a PHP noob, so my question might not even be relevant. It's just my observation with my noobish PHP skills.


Ahh, I get it. smile

The purpose for the user_functions.php file wouldn't be to edit/replace what is in the functions.php file but rather give a user-modifiable place where they [the users] can place code which extends/modifies the theme by using actions and filters. So, in a sense your concern isn't relevant because that wouldn't be the purpose of the file.

I hope this clears it up, although if you are not familiar with PHP and WordPress'es actions/filters API, it probably wouldn't make much sense.

Thumbs up

Re: Request for user functions file

I'm not familiar with that. I slide in and out as I need to. haha  smile

Re: Request for user functions file

why not use a child theme that allows to have your own css and functions file

Thumbs up

Re: Request for user functions file

mmjaeger wrote:

why not use a child theme that allows to have your own css and functions file

Because, a child theme is an overkill for a lot of the changes that users are requesting and are interested in. For example, a user requested that I tell him how to display posts with the most comments on his frontpage. With user_functions.php, it is a simple filter function as opposed having to create an entire child theme just to change that one thing.

Thumbs up

Re: Request for user functions file

Hm it sounds good .yes  ,this ia great idea..

Thumbs up