Site logo

[Resolved] What is required for the hook generate_add_sites in Site Library module?

Home Forums Support [Resolved] What is required for the hook generate_add_sites in Site Library module?

Home Forums Support What is required for the hook generate_add_sites in Site Library module?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1841318
    Thiago Senna

    Hi,

    I was studying site-library module source code and I saw that now we have a hook named generate_add_sites. Very easy to understand how to add new sites using this filter. But not very easy to find exactly what data I need within the directory and plugins array keys.

    If I understood correctly within the directory we must add a URL having inside at least two files:

    options.json (maybe an exported generatepress configuration file)
    content.xml (maybe an exported website using the default WordPress export feature)

    Am I correct? Does exists something I need to know to properly setup the filter and have a nice experience importing sites like when importing from your official sites library?

    #1841704
    Elvin
    Staff
    Customer Support

    Hi there,

    Am I correct? Does exists something I need to know to properly setup the filter and have a nice experience importing sites like when importing from your official sites library?

    I’m not exactly sure what the question is.

    As far as importing site library templates is concerned, the current UI should be enough.

    It’s simply:

    you click import > your site sends a download request from GP servers > GP servers send the files and plugin installation instructions > GPP plugin adds what was requested.

    Any particular reason why you need a filter?

    #1842118
    Thiago Senna

    Hi Elvin,

    the reason I need the filter is ’cause maybe I’d like to host my own site libraries. I just want to make sure if all I need is the exported content.xml and options.json files. Are there other exported files who should be provided that I’m no aware of?

    #1843628
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You’re correct, you at least need the options.json file and content.xml file.

    You can also add a screenshot.png file for the screenshot, and a widgets.wie file exported using this plugin: https://wordpress.org/plugins/widget-importer-exporter/

    That’s it!

    Let us know if you have any other questions 🙂

    #1844216
    Thiago Senna

    Hi,

    thanks very much for the help 🙂

    #1844529
    Tom
    Lead Developer
    Lead Developer

    No problem!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.