• Resolved oferwald

    (@oferwald)


    Hello Arnee,

    I would like to request that you add an additional hook to your great plugin ??

    The hook name I suggest is sm_addurl, and will be positioned at the last line on the add_url function like this:

    do_action('sm_addurl',$loc, $lastMod, $changeFreq, $priority,&$this);

    Currently – this is line 1509 of sitemap-core.php

    The idea of this hook is to allow other plugin writers that generate multiple pages per original page to be able to add their pages to the sitemap, as I am writing a translation plugin I am adding a few urls on each original url.
    sending the complete set of parameters allow more flexibility in the plugin (I for example reduced the priority for the translated pages)

    You can see the example in my plugin here:
    https://trac.transposh.org/changeset/338

    Using this plugin didn’t increase memory usage or time in any significant way, and is probably quite safe.

    Thanks in advance,
    Ofer.

    https://www.ads-software.com/extend/plugins/google-sitemap-generator/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    Thanks, thats a good suggestion! What about passing the page object (GoogleSitemapGeneratorPage) instead of the 5 parameters? It’s constructed in the AddUrl() method and could be easily extended later.

    Best regards,

    Arne

    Thread Starter oferwald

    (@oferwald)

    Hi,

    Thanks for the suggestion, couldn’t agree more ??

    The code is now just
    do_action('sm_addurl',&$page);

    The generator I get using the getInstance.

    I fixed my code, you can see it now at:
    https://trac.transposh.org/changeset/339

    Any further ideas would be appreciated.

    Thread Starter oferwald

    (@oferwald)

    Hello,

    Reminder, any chance of including this in a coming release?

    Thanks,

    Thread Starter oferwald

    (@oferwald)

    Hello Arnee,

    Care to look at this again? a oneliner that could help…

    Thanks,

    Did you guys ever agree on something? I’m looking for this feature.

    Ofer, can I just add that line to the google sitemaps plugin as you said for now?

    Thread Starter oferwald

    (@oferwald)

    Hi,

    The oneliner should work (but in php 5.3 there’s an issue that requires the removal of the &)

    I am still trying to push this in:
    https://www.ads-software.com/support/topic/plugin-google-xml-sitemaps-early-testers-wanted/page/3?replies=81#post-1764595

    But… out of my hands

    Ofer, I just added do_action(‘sm_addurl’,&$page); to the latest trunk of google sitemaps plugin (at the end of AddUrl), wiped the previous sitemaps, and re-created but didn’t find any of the /ru/ posts that are present, i.e. the sitemap is missing translated entries.

    Any ideas?

    I’m using svn trunk versions of both plugins.

    The hook was just added in the new 4.0b3 beta. Sorry, somehow I totally forgot about this topic. Thanks for bringing it up again!

    Thread Starter oferwald

    (@oferwald)

    @arne – thank you very much, tried the new beta and the integration works (after tweaks I had to do because of the change order, but that’s ok) highly appreciated, and I am finally able to mark this topic as resolved.

    #archon810 – you need to do do_action(‘sm_addurl’,$page); and change line 168 of third_party in transposh, see this: https://trac.transposh.org/changeset/557 , good luck

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Google XML Sitemaps] Request for a new hook’ is closed to new replies.