Git Product home page Git Product logo

Comments (5)

figureone avatar figureone commented on August 13, 2024

I'll take a look at the wordpress.org thread and get it included in the plugin. Thanks!

from insert-pages.

figureone avatar figureone commented on August 13, 2024

Thanks again! This will be included in the next release. Please note that I changed the parameters to the filter:
a97a2a2

from insert-pages.

figureone avatar figureone commented on August 13, 2024

FYI next version (3.0) includes a change to the insert_pages_wrap_content filter; the second parameter is now a WP_Post object instead of an array of WP_Post objects.
a9893fa

Let me know if this causes any problems for you.

from insert-pages.

heiglandreas avatar heiglandreas commented on August 13, 2024

I was already thinking whether there is a case where there might be more than one post in that array ;)

Thanks for pointing out! Is there a due date for the next release? I will fix my code appropriately.

Just an idea: keep calling the old filter with an array as parameter and introduce a new filter that will be called with the single WP_Post as parameter. That way people will be able to adapt their code successively and when you at a later point remove the "old" filter the old code doesn't get called anymore but nothing breaks codewise due to the changed parameter.

I think that's the way I would introduce this change ;)

from insert-pages.

figureone avatar figureone commented on August 13, 2024

Thanks for the tips, I should have thought this through better before implementing :)

I think I'm going to proceed with changing the filter and apologize for breaking backwards compatibility. Version 3.0 with the change should be out some time today.

If we see a need for the plugin returning multiple pages in the future, I think I'd like to introduce a filter that modifies the WP_Query lookup (so you can throw more than just a slug or id into the page parameter).

Future changes won't break existing hooks, so I'll definitely be more careful about backwards compatibility.

from insert-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.