Hi Rick, 

Using hooks (filters/actions) is not restricted to plugins. So I'm not so 
much recommending the use of plugins as I am recommending adding actions or 
filters to your functions.php file. Most often they are just a few lines of 
code so it's pretty efficient. 

Filters modify output. For example, if my client wants an excerpt to end 
with a "read more" link instead of WordPress's default "[...]" I can add 
this code to filter the "more" part of the excerpt. WordPress passes me the 
default "more" code as a parameter; I can either return it as is, modify 
it, or as in this case, completely replace it: 

function my_excerpt_more( $more ) {
    return ' <a href="'. get_permalink() . '" class="read-more">read 
more</a>';
}
add_filter( 'excerpt_more', 'my_excerpt_more' );


Actions allow you to make something happen within WordPress's flow. For 
example, if I want to register navigation menus: 

function my_add_nav () {
    register_nav_menus(
        array(
            'main_menu' => 'Main Menu',
            'site_menu' => 'Site Menu',
        )
    );
}
add_action('after_setup_theme', 'my_add_nav');


The best thing is that in both cases, I don't need to change any code, core 
or otherwise, when WordPress comes out with a new version. 

Hope this helps! 
Donna

On Thursday, July 17, 2014 3:13:59 PM UTC-7, Rick Gordon wrote:
>
> To at least start to answer my own question: 
> http://tommcfarlin.com/functions-php-vs-plugin-who-wins/
>
>
>   Rick Gordon <javascript:>
>  July 17, 2014 2:36 PM
>  Thanks, Donna and all.
>
> As I can't get into all the info on creating a plugin at this moment (and 
> if this being OT to BBEdit), can you comment on the efficacy of plugin 
> hooks vs. modifying functions.php?
>
> Thanks.
>
> Rick Gordon
>  
>
>
> ___________________________________________
> RICK GORDON
> EMERALD VALLEY GRAPHICS AND CONSULTING
> ___________________________________________
> WWW: http://www.shelterpub.com 
>  

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.

Reply via email to