Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Daniel Bettles

    (@danbettles)

    Hi pugsby

    Sorry for the ridiculous delay in getting back to you. I’d have expected to get updates. Anyways.

    What version of PHP were you using? Portico works only on PHP 5.3+, as mentioned on the plugin’s homepage. If you’d like to use it with a version of PHP 5 older than PHP 5.3 then you could try https://github.com/danbettles/Portico, a backport I quickly put together for a friend.

    Regards,
    Dan

    Hello

    I had a similar problem recently. In my child theme, based on Twenty Eleven, I wanted to completely replace the default set of header images with my own, which meant finding a way to get some code to run after the parent theme.

    I achieved what I wanted by adding an action to the “after_setup_theme” hook and — here’s the key — passing a value for add_action‘s 3rd, “priority” parameter. You may need — or want — to experiment, or trace your code somehow, to get the priority right, but it’s likely you’ll get away with just passing an arbitrary, large number.

    Here’s the sort of think you’re looking for:

    add_action( 'after_setup_theme', function() {
        //Do something
    }, 42 );
    Plugin Author Daniel Bettles

    (@danbettles)

    Oh, and sorry for taking so long to get back to you – I’ve been a bit under the weather.

    Plugin Author Daniel Bettles

    (@danbettles)

    Hey, Smurkas

    Thanks for your feedback.

    I wrote the plugin in PHP 5.3 quite simply because that’s what I use. Everything I write in PHP – with very few exceptions – is for version 5.3. I am fond of the new features, particularly namespaces, which give us a much more elegant way of organising code – naturally – so there’s no good reason for me to use anything else.

    I wrote Portico to help me out on a personal project – again, based on PHP 5.3 – and open-sourced it because I thought there may be others who would find it useful.

    I agree that I may be limiting my audience, but working with an older version of PHP from day-one, when 5.3 has been gold for 18 months or so, doesn’t make a lot of sense to me – and that’s discounting the fact that I like using the features of PHP 5.3. I could well be wrong, but I think now is the time people start looking more closely at PHP 5.3, because hosts are starting to roll-out PHP 5.3 to users of shared hosting – which should rapidly increase its use.

    That said, however, if I get a lot of requests from prospective users, developers working with 5.2, then maybe I’ll consider down-grading the code. (That still sounds a bit bonkers to me, though: rather than upgrading to PHP 5.3, we down-grade code. Anyways.)

    Perhaps you could publish a patch for PHP 5.2 users, since you’ve done all the work.

    Thanks again

Viewing 4 replies - 1 through 4 (of 4 total)