12 Responses

  1. Rudd
    Rudd January 8, 2013 at 6:39 pm |

    Thoughts?

    Just awesome. Never thought of this before.

    Reply
  2. toscho
    toscho January 8, 2013 at 8:27 pm |

    The actions loop_start and loop_end are probably safer for this. Don’t think a priority of 0 is a guarantee: negative numbers are allowed, and they will win.

    Shortcodes for use in theme templates.

    There is one exception: Inside of PHP shortcodes are almost always useless. echo do_shortcode('[shortcode_1]'); is a common and expensive mistake, when people forget they can call the shortcode callback just by its name.

    Reply
  3. Thiago Senna
    Thiago Senna January 8, 2013 at 8:52 pm |

    Hi,

    I don’t like the idea to hack this kind of thing. As developer I’d like to use shortcodes as my ‘dev tools’ when creating themes (if necessary). It’s a beautiful approach to execute a function within a string content.

    I really prefer to be free when creating shortcodes besides thinking about hacks to avoid bad uses of the shortcode.

    Reply
  4. Drew Jaynes
    Drew Jaynes January 9, 2013 at 1:18 am |

    I’m curious whether this is purely a semantic argument about theme vs plugin functionality.

    Is it the idea that themes shouldn’t influence content only the display of said content? If so, that’s something I can get behind. If not, it seems like such an odd argument to make — no shortcodes in post content — since that’s exactly what shortcodes are for.

    I’d also be curious to hear your stance on what shortcodes’ exit strategy should be, especially when people’s post_content is littered with leftover shortcodes. Personally, I’m kind of a fan of re-adding the shortcode and giving it an empty output.

    Reply
  5. Sarakuj
    Sarakuj January 11, 2013 at 2:43 pm |

    iam amazed how you cover that and described in a clean way, thank you

    Reply
  6. roni rah
    roni rah January 15, 2013 at 1:12 pm |

    Useful! Specially thanks for the shortcodes.

    Reply
  7. Maria watson
    Maria watson January 19, 2013 at 1:15 pm |

    Nice article to cover short codes in word press.. I have been using word press for blogging but never thought of this thing..This looks like more of a techie feedback..would love to follow this blog for more details on Wordpress..

    Reply
  8. Valentin
    Valentin January 26, 2013 at 8:08 am |

    Just awesome, thanks for the tips !

    Reply
  9. Jason Miller
    Jason Miller January 27, 2013 at 8:08 am |

    This is good, solid advice and explained very concisely. Thank you sir

    Reply
  10. Kajolcute
    Kajolcute February 2, 2013 at 2:58 am |

    It’s good ! Useful! Specially thanks for the shortcodes.

    Reply

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.