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 customize password reset message page on success if no error in password reset
- Widget HTML Display Problem
- Add a new confirmation page before saving
- How to create a backend for a custom theme?
- Codex Version Focus on Production or Nightly?
- wp_nonce_field displaying twice
- Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
- use of do_action() without any functions attached
- How dynamic action login_form_{action} is working
- What happens when two or more plugins use the same hook?
- Plugin is not generating title tags on any pages or posts
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- Does admin_print_scripts-$hook_suffix work for nested paths to individual files?
- Is it necessary to do validation again when retrieving data from database?
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Can’t change the style of a submit input type? [closed]
- How to get all queries’s results after they have executed?
- Make a plugin page out of influence of the theme’s style
- Update Data parameter of a wp_localize_script() call
- Custom entity search and display
- WP Plugin Running before jQuery
- Template directory in plugin
- Plugin uninstall function is not working
- Bug: Post needs to be updated twice when adding action for save_post hook
- get_the_tags with separator control?
- How to only load css for used blocks on frontend
- 400 Bad Request, in wordpress theme development, wp_ajax
- flush rewrite rules after plugin update?
- When does save_post hook fire on post save/update
- Plugin does not add action
- Remove an action by extending class and replacing it
- After plugin activation hook
- How to replace default comments with custom HTML?
- Odd map_meta_cap $args on post edit — sometimes integer, sometimes string
- Trying to get class to instantiate ONCE (or, “why do I keep punching myself in the head?”)
- How can I create a custom plugin that allows anonymous users to signup without registering?
- hook filter after the_content on a specific page
- Bind a function with its own argument to show something dynamically after every content
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Is there an admin hook that will let me read GET variable before it’s too late to set the header Location
- my own SVN for a plugin/theme
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- What’s the hook for filtering every texts of site?
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- Hook add_attachment error
- Why would you use esc_attr() on internal functions?
- Invalid hook call on save, not edit when using swiper slider
- Proper way to use useSelect
- Call to undefined function is_home() or any conditional tags
- Associate multiple email addresses with the same user account, so they can log in with either
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Run command “composer install” when activating wordpress plugin
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Update variable value via add_filter
- How to find where an object first instantiatiation
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Add a check box in Menu Settings
- Custom filter not working
- hook update_option/updated_option empty $old_value and $value
- Full documentation about $args for register_rest_route?
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- modify show UI of a registered taxonomy
- Using function from enqueued .js file in theme in plugin?
- Configure WordPress to Generate Scheme-less Relative URLs
- Hide one specific woocoomerce product
- Does WordPress default CSS have Grids?
- Using HTML links within translatable string
- How to find list of all functions bind to a particular hook from my plugin?
- How to resize WordPress images on upload to specific height and width without cropping it
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Create fixed static pages
- How to get terms for taxonomy
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Ajax +wordpress onClick link redirect to new page and create html content
- Save temporary registration data
- Redirect returning users to a certain page?
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- Restrict certain actions to plugin-specific admin menu pages only
- WordPress Page Reload Takes forever during theme development
- Adjust query on single
- Setting a post’s category
- rewrite_rules problem
- Using password protection to load different page elements?