Personally I see themes being submitted to the repository as more end-user first more than anything else. That does not mean to say you should not use the &quot;Action&quot; approach over the &quot;Simple&quot; approach as both accomplish the same goals but there is a lot to say about keeping things simple, aka K.I.S.S.<br>

<br><br clear="all">Cais.<br>
<br><br><div class="gmail_quote">On Tue, Jul 26, 2011 at 10:39 AM, Josh Stauffer <span dir="ltr">&lt;<a href="mailto:joshstauffer@gmail.com">joshstauffer@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div>In my opinion, I believe the Action approach is easier for developers while the Simple approach is easier for your average end-user. The question you should ask is &quot;who are you building this theme for?&quot; Answer that and code it accordingly.</div>


<br clear="all"><font color="#888888">Josh</font><div><div></div><div class="h5"><br>
<br><br><div class="gmail_quote">On Tue, Jul 26, 2011 at 9:30 AM, Qamar Ashraf <span dir="ltr">&lt;<a href="mailto:life.object@gmail.com" target="_blank">life.object@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Thanks Chip,<div><br></div><div>I also love hooks and <b>Oenology 2.0</b> is an excellent example of hooks. But i am also thinking about end-user flexibility who have not much more idea about using them. So, i was thinking about the complexity of code before submitting to the WordPress directory. Okay, what you prefer in the following two code snippets in terms of,</div>



<div><ul><li>Simplicity for End Users who have little idea about Child Themes.</li><li>Code efficiency.</li></ul></div><div><b>1. Action Approach:</b></div><div><br></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">



<span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">&lt;?php do_action( &#39;chip_header_pre&#39; ); ?&gt;</span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px"><br>



</span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">  &lt;div id=&quot;header&quot;&gt;<br></span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">    &lt;div id=&quot;header-data&quot;&gt;<br>



</span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">      &lt;?php do_action( &#39;chip_header&#39; ); ?&gt;    <span style="white-space:pre-wrap">        </span> <br>



</span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">    &lt;/div&gt; &lt;!-- end #header-data --&gt;<br></span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">  &lt;/div&gt; &lt;!-- end #header --&gt;<br>



</span><span style="border-collapse:collapse;color:rgb(51, 51, 51);font-family:arial, sans-serif;font-size:13px">&lt;?php do_action( &#39;chip_header_post&#39; ); ?&gt;</span></blockquote>
<div><br></div><div><b>2. Simple Approach:</b></div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">



&lt;?php get_template_part( &#39;nav&#39;, &#39;primary&#39; ); ?&gt;<br>  &lt;div id=&quot;header&quot;&gt;<br>    &lt;div id=&quot;header-data&quot;&gt;<br>      &lt;?php get_template_part( &#39;header&#39;, get_chip_header_format() ); ?&gt;<br>



      &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;<br>    &lt;/div&gt; &lt;!-- end #header-data --&gt;<br>  &lt;/div&gt; &lt;!-- end #header --&gt;<br>&lt;?php get_template_part( &#39;nav&#39;, &#39;secondary&#39; ); ?&gt;</blockquote>



</div><div><br></div><div><br></div><div>You can guess better the complexity of hooks in the loop :)</div><div><br></div><div>Regards</div><div><br><br><div class="gmail_quote">On Tue, Jul 26, 2011 at 7:14 PM, Chip Bennett <span dir="ltr">&lt;<a href="mailto:chip@chipbennett.net" target="_blank">chip@chipbennett.net</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Personally, I think action/filter hooks are Teh Awesome. <a href="https://github.com/chipbennett/oenology/blob/master/functions/hooks.php" target="_blank">I also use them, quite extensively</a>.<div>



<br></div><div>But I&#39;m not really sure what you&#39;re asking?</div>
<div><br></div><div>Are they acceptable? Of course; provided they are implemented properly, per the appropriate API conventions.</div><div><br></div><div>Are they best practice? In my personal opinion, they are; I prefer them to, e.g. pluggable functions. But at least currently, the Guidelines are silent on custom hooks.</div>




<div><br></div><div>(p.s. you should prefix your hooks with theme_slug, or at the very least, make sure your hook-name prefixes are consistent with the rest of the Theme - which, IIRC, is Chip Life, or &quot;chip_life&quot; as a prefix?)</div>




<div><br></div><div>Chip<br><br><div class="gmail_quote"><div><div></div><div>On Tue, Jul 26, 2011 at 8:08 AM, Qamar Ashraf <span dir="ltr">&lt;<a href="mailto:life.object@gmail.com" target="_blank">life.object@gmail.com</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
Hello,<div><br></div><div>I am going to share my WordPress Theme development logic for an expert opinion. So it will help me and others in the WP theme development, Here is a sample code of header template,</div><div><br>




</div>
<div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
&lt;?php do_action( &#39;chip_header_pre&#39; ); ?&gt;<br>  &lt;div id=&quot;header&quot;&gt;<br>    &lt;div id=&quot;header-data&quot;&gt;<br>      &lt;?php do_action( &#39;chip_header&#39; ); ?&gt;    <span style="white-space:pre-wrap">        </span> <br>





    &lt;/div&gt; &lt;!-- end #header-data --&gt;<br>  &lt;/div&gt; &lt;!-- end #header --&gt;<br>&lt;?php do_action( &#39;chip_header_post&#39; ); ?&gt;</blockquote></div><div><br></div><div><br></div><div>- I have written different modules like, Primary Menu, Secondary Menu etc.</div>





<div>- So i can easily attach these modules to any hook with add_action(), depending on the requirement/presentation of a them/child theme. </div><div><br></div><div><b>Child Theme A Example</b></div><div><br></div><div>




add_action(&#39;chip_header_pre&#39;, &#39;chip_primary_menu_init&#39;);</div>
<div>add_action(&#39;chip_header_post&#39;, &#39;chip_secondary_menu_init&#39;);</div><div><br></div><div><div><b>Child Theme B Example</b></div><div><br></div><div><span>add_action(&#39;chip_header_pre&#39;, &#39;</span>chip_secondary_menu_init<span>&#39;);</span></div>





<div>add_action(&#39;chip_header_post&#39;, &#39;chip_primary_menu_init&#39;);</div></div><div><br></div><div>Both of above child themes will have different presentation of menus, with just a single line of code, and there may any other combination as well.</div>





<div><br></div><div><b>So what is the recommendation of experts to have this logic ?</b></div><div><br>-- <br><font color="#666666">Regards</font><div><font color="#666666">Qamar Ashraf</font></div><div><font color="#666666"><a href="http://www.tutorialchip.com" target="_blank">www.tutorialchip.com</a></font></div>





<div><font color="#666666">@lifeobject1</font></div><br>
</div>
<br></div></div>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><font color="#666666">Regards</font><div><font color="#666666">Qamar Ashraf</font></div><div><font color="#666666"><a href="http://www.tutorialchip.com" target="_blank">www.tutorialchip.com</a></font></div>



<div><font color="#666666">@lifeobject1</font></div><br>
</div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>