Function doc block should document what it does, what it might be useful for, but not who uses it. It makes sense to document that it was designed with hook X in mind but that is it.
Think of unit testing. In that context you are likely to call the function by itself without doing the whole core initialization, which means that a description tying the function to the init hook, will be at least misleading.
The style you are trying to use will also force you to change documentation while changing irrelevant code, like if you will decide to move the call to wp_loaded
instead of init
Related Posts:
- How do I Make a Theme “plugin-ready”?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- What function to hook for changes made in status and visibility of a post
- Should action callbacks start with a verb?
- WordPress custom taxonomy check box to dropdown
- Add child pages to submenu automatically
- Why enqueue styles on hook?
- How to replace settings in WordPress plugin from a theme
- how to insert content into wp_head after loop_end
- How to get the path to the current theme?
- Why does WordPress use outdated jQuery v1.12.4?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Global Objects and Public Methods
- Where do I start from
- Check for featured image in WP_Query
- How Do I Load My Action Earlier Enough?
- Does WP fire delete_post when trashed posts are automatically deleted?
- How to add a link to WordPress Plugin install Listing
- Get file headers in custom file
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Custom theme sufficient or custom plugin neccessary for this feature set?
- How to: get main plugin/theme file?
- add_theme_support using a plugin
- Hook for post permalink update
- Get returned variable from a function to add_shortcode function
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Workflow and best practice for documentation [closed]
- Can I differentiate between “Delete Post Permanently” and “Empty Trash” and do something for each accordingly?
- unable to stop loop when using wp_insert_post with publish_post hook
- WordPress Ajax callback function from plugin – OOP
- Is there any way to have Featured Text, as opposed to Featured Image?
- Find source of notice / warning / errors efficiently
- Problem with is_active_sidebar?
- StackExchange clone using WordPress?
- Sharing common functionality (functions, template parts) between plugins and themes?
- Change template dynamically
- best practice for query string values – get_query_var always empty for my value supplied in query string
- Get Current Menu Location inside Nav_Walker
- Modifying meta tags after doing ajax call in plugin
- Where to add hooks in a class
- Short code not working in boostrap modal dont no why?
- Is there a way to list all actions registered by a plugin or theme?
- Adding option to Gallery shortcode
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- How developed with version control word press site on shared host? [closed]
- How to limit number of number of categories displayed by categories widget
- PowerPress mobile media player
- When is the proper time to minify css and js with git workflow?
- I have 2 plugins using the same wp_login action hook and one is not working
- Codex Version Focus on Production or Nightly?
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- How dynamic action login_form_{action} is working
- Is it necessary to do validation again when retrieving data from database?
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- 400 Bad Request, in wordpress theme development, wp_ajax
- flush rewrite rules after plugin update?
- hook filter after the_content on a specific page
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Run command “composer install” when activating wordpress plugin
- How to find where an object first instantiatiation
- Full documentation about $args for register_rest_route?
- Ajax +wordpress onClick link redirect to new page and create html content
- Save temporary registration data
- WordPress dynamic widget by location?
- How can the_excerpt (or equivalent) be called on a category description?
- Creating posts with links from a txt file
- Change the behaviour of a button
- WP_Query order posts by category
- Configuring Xdebug with docker compose
- How to access index file in Block Themes?
- apply_filters() and call_user_func() to define and call a function outside a class
- WordPress Favicon not Working For Images/Videos/PDFs
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Redirection from a specific page for users logged in but not with membership
- Plugin Development – Call to undefined function comment_exists()
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- Custom premium registration form and profile page for a WordPress Web Application
- Font Awesome stopped showing icons, shows &# text instead [closed]
- To remove rendering of menus and header, plugin or theme?
- Can I use a hook other than ‘init’ to handle form submissions?
- Managing Custom Designed Content
- Generate activation url
- Ajax functions – no access to wp-admin.php only online
- How do I replace title with my plugin?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- Saving multiple fields as array
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Woocommerce: block user removing cart item
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- Gutenberg text field validation
- Send retrieve password notification email with custom HTML email template
- how to catch a data from a array in WordPress
- How are themes and plugins localized using the gettext GNU framework?
- Theme, Plugin or Both?
- Is there any other ways to replicating changes on live from staging without pushing from git
- Hook a search form anywhere on the site, using a custom plugin
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php