WordPress.org

Ready to get started?Download WordPress

Forums

scbFramework
scbFramework questions (3 posts)

  1. wper
    Member
    Posted 3 years ago #

    First of all, thank you for sharing scbFramework with us!

    I'm looking at the Smart Archive Reloaded plugin to understand the basic workflow with the framework and I'm wondering why did you create a register mechanism in the AdminPage class instead of just instantiating an object and using it that way?

    Does it have to do with keeping the admin functionality in a separate file? What is the philosophy?

    Also, which functions did you choose to name with a leading underscore? I see not all named that way are private and not all private functions have such a name convention. Is there a different rationale?

  2. wper
    Member
    Posted 3 years ago #

    Another quick question (I'm just gonna add these as I begin to understand more - hope you don't mind).

    Why is the 'toplevel' argument of the AdminPage is allowed to be any string? Is doesn't seem to work with anything else but 'menu'.

    Thank you.

  3. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    why did you create a register mechanism in the AdminPage class instead of just instantiating an object and using it that way?

    The registration mechanism allows third-party code to disable or replace the settings page for that plugin.

    Also, which functions did you choose to name with a leading underscore? I see not all named that way are private and not all private functions have such a name convention. Is there a different rationale?

    Methods that begin with an underscore are meant to be private, but I can't use the 'private' keyword because they are used as callbacks for various actions and filters.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic