mcfilmmakers wrote:I'm going to have to play more with what you've provided to really see what the code does since I can't tel simply by looking at it. This is where a wiki would be helpful: to explain what each of those variables actually contains, in this case, what $original contains and how it is structured.
The suffusion site, while being a great source to find actions and filters, does not contain any resources for functions. There is no possible way to have guessed how to prepare suffusion_admin_modify_option_list, or how to replace any other function for that matter.
Suffusion is the output of a hobby for me - it isn't something that pays the bills, rather it is something where I invest an obscene amount of time and energy on both, development and support, and a couple of stalwarts (Colin and Drake) pour in hours and hours of their own time on support. A Wiki etc. would be fine if I was charging $50 or more from every user; given that Thesis, the prima donna of paid themes (and woefully short of features in comparison to Suffusion), charges $87 for a single use, $50 per user would seem like the stuff of legend. Charging would also help keep down the support requests quite a lot, and would free up time for things like a better showcase, better documentation etc. But I don't charge, and that is where the story ends.
Filters and actions aren't native to Suffusion: they are core WP features. That is why I don't have expansive literature on how to use them and whatever literature WP provides is more than sufficient. Functions aren't native to WP: they are the tenets of programming in any language. That is why I don't have any "resources" for functions. That is also why I don't have any compendium of functions: each user has a different requirement for what kind of functions they need, and I help on an adhoc basis. WP, a project with hundreds of developers funded by several VCs, itself doesn't have a full list of its action and filter hooks with documentation, so expecting Suffusion, a free theme to hand it to you on a platter is a tad unrealistic. Hooks are considered to be advanced functionality, so the assumption is implicit that if you are playing with hooks you are willing to dig around a bit.
Take a look at this: http://adambrown.info/p/wp_hooks
. It is a complete collection of WP hooks. Pick any hook
from there, and you will see that the ONLY way to understand what arguments a hook takes is ... to view the source code. The only way to figure out the structure of an argument is to look at the code preceding and succeeding it.
Fundamentally there are the following calls to set up actions and filters:
- Code: Select all
add_action('hook_name', 'function_name', 10, 3); // 10 and 3 are the function priority and the number of arguments respectively. See http://codex.wordpress.org/Function_Reference/add_action
add_filter('hook_name', 'function_name', 10, 3); // 10 and 3 are the function priority and the number of arguments respectively. See http://codex.wordpress.org/Function_Reference/add_filter
... And the following to execute the added actions and filters:
- Code: Select all
do_action('hook_name', $argument_1, $argument_2, $argument_3); // You pass as many arguments as you have defined in the add_action call. See http://codex.wordpress.org/Function_Reference/do_action
apply_filters('hook_name', $argument_1, $argument_2, $argument_3); // You pass as many arguments as you have defined in the add_filter call. See http://codex.wordpress.org/Function_Reference/apply_filters
Just one thing to note in the above: if you don't have any filters, whatever you have in $argument_1 is returned. So basically your $original variable is what you would like your value to be if there are no changes to it. All this is standard stuff in no way unique to Suffusion, and how the entire WP platform operates.
One gentle nudge: please consider forum rule #4 while you post.