Skip to content

Possible wp_enqueue_script() comment improvment #592

@diniciacci

Description

@diniciacci

Hello,

I found this comment:

* This function is provided for demonstration purposes only.

a bit misleading.

My point is that the comment uses "should", where it can be made more clear that an instance of that class is indeed passed. I.e. the inexperienced reader does not have to do it, it's already done even if the function is for "demostration purposes only".
Moreover it's not the run() function creating or passing the instance.

A very cheap proposal is (need english rework):

        /**
         * This function is provided for demonstration purposes only. 
         * It will add_filter() the default plugin script or sytle.
         *
         * With the current plugin structure, an instance of this class
         * is created by Plugin_Name and then passed to add_action()
         * defined in Plugin_Name_Loader.
         * 
         * Then, the run() function defined in Plugin_Name_Loader will
         * connect all the hooks you have registered with add_action()
         * in the plugin with wordpress hooks by calling add_filter()
         * on each.
         * 
         */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions