From 56afd7defccb650bbc533973b031a054f984618f Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Wed, 16 Jul 2025 11:16:49 +0600 Subject: [PATCH 1/5] Add initial hook documentation and guidelines Introduced documentation guidelines and discovery rules for WordPress hooks in the project. Added initial hook list in docs/hooks/HOOKLIST.MD, and started documenting several action and filter hooks in docs/hooks/actions.md and docs/hooks/filters.md. Updated .gitignore to ignore 'cursor' instead of '.cursor'. Created supporting documentation files and rules for consistent hook documentation. --- .cursor/rules/development-guideline.mdc | 50 ++++++ .cursor/rules/document-hooks.mdc | 39 +++++ .gitignore | 4 +- docs/hooks/HOOKLIST.MD | 159 ++++++++++++++++++ docs/hooks/README.MD | 0 docs/hooks/actions.md | 41 +++++ docs/hooks/filters.md | 42 +++++ .../tools/.cursor/rules/hooks-doc.mdc | 31 ++++ 8 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 .cursor/rules/development-guideline.mdc create mode 100644 .cursor/rules/document-hooks.mdc create mode 100644 docs/hooks/HOOKLIST.MD create mode 100644 docs/hooks/README.MD create mode 100644 docs/hooks/actions.md create mode 100644 docs/hooks/filters.md create mode 100644 wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc diff --git a/.cursor/rules/development-guideline.mdc b/.cursor/rules/development-guideline.mdc new file mode 100644 index 000000000..76ffdd1e2 --- /dev/null +++ b/.cursor/rules/development-guideline.mdc @@ -0,0 +1,50 @@ + +You are an expert in WordPress, PHP, and related web development technologies. + +Core Principles +- Our current task is to document each hooks we created in our wp-user-frontend project +- This hook documentation aimed for both external plugin developers, and our internal team +- In docs/hooks/HOOKLIST.MD, we will create a table of all the hooks we created in our wp-user-frontend project. + the column name will be: hook, type(action/filter), documented. the documented field will be `No` initially for all hooks + +## Hook Discovery Process +- Use regex patterns to find all hooks: + - Actions: `do_action\('([^']+)'` + - Filters: `apply_filters\('([^']+)'` +- Scan all PHP files in the project +- Create initial hooklist with basic information + +## Documentation Process +- We will go through the Hooklist one by one and document them. + - If this is a filter hook, we will append the documentation in `/docs/hooks/filters.md` using the standard Markdown format + - If this is a action hook, we will append the documentation in `/docs/hooks/actions.md` using the standard Markdown format + +## Documentation Template +``` +## wpuf_after_post_insert + +**Type**: Action + +**Parameters**: +- `$post_id` *(int)*: ID of the post. (required) +- `$form_data` *(array)*: Submitted form data. (required) + +**Return Value**: (for filters only) - Description of what should be returned + +**Since**: 3.7.0 (only when version information is available) + +**Category**: Form Processing/User Management/Payment/etc. (when possible to categorize) + +**Description**: Fires after a post is inserted via the frontend. +``` + +## Categorization System +- Form Processing +- User Management +- Payment & Subscriptions +- Post Management +- Admin Functions +- Integration Hooks +- Utility Hooks + +- After documenting an action or filter hook, we will mark the `documented` column to `Yes` in docs/hooks/HOOKLIST.MD diff --git a/.cursor/rules/document-hooks.mdc b/.cursor/rules/document-hooks.mdc new file mode 100644 index 000000000..dfc895f4b --- /dev/null +++ b/.cursor/rules/document-hooks.mdc @@ -0,0 +1,39 @@ +--- +alwaysApply: false +--- +[ + { + "name": "Discover WordPress Action Hooks", + "description": "Detect all 'do_action' hooks and log them for documentation.", + "trigger": "code", + "pattern": "do_action\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", + "comment": "Action Hook '{{1}}' found. Document this in /docs/hooks/actions.md using the standard Markdown format.", + "actions": [] + }, + { + "name": "Discover WordPress Filter Hooks", + "description": "Detect all 'apply_filters' hooks and log them for documentation.", + "trigger": "code", + "pattern": "apply_filters\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", + "comment": "Filter Hook '{{1}}' found. Document this in /docs/hooks/filters.md using the standard Markdown format.", + "actions": [] + } +] +[ + { + "name": "Discover WordPress Action Hooks", + "description": "Detect all 'do_action' hooks and log them for documentation.", + "trigger": "code", + "pattern": "do_action\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", + "comment": "Action Hook '{{1}}' found. Document this in /docs/hooks/actions.md using the standard Markdown format.", + "actions": [] + }, + { + "name": "Discover WordPress Filter Hooks", + "description": "Detect all 'apply_filters' hooks and log them for documentation.", + "trigger": "code", + "pattern": "apply_filters\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", + "comment": "Filter Hook '{{1}}' found. Document this in /docs/hooks/filters.md using the standard Markdown format.", + "actions": [] + } +] diff --git a/.gitignore b/.gitignore index a62610308..2a51998c5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ export.sh .idea .vscode .github/prompts -.cursor +cursor /.DS_Store nbproject node_modules @@ -32,4 +32,4 @@ tests/e2e/.env tests/chrome_recordings *.min.js.* *.min.css.* -tests/e2e/plugins-page-wpuf-lite-check.png \ No newline at end of file +tests/e2e/plugins-page-wpuf-lite-check.png diff --git a/docs/hooks/HOOKLIST.MD b/docs/hooks/HOOKLIST.MD new file mode 100644 index 000000000..416d1b1c3 --- /dev/null +++ b/docs/hooks/HOOKLIST.MD @@ -0,0 +1,159 @@ +# WP User Frontend - Hook List + +This document contains all the hooks (actions and filters) created in the WP User Frontend plugin. + +## Action Hooks + +| Hook | Type | Documented | +|------|------|------------| +| before_appsero_license_section | action | Yes | +| after_appsero_license_section | action | Yes | +| wpuf_gateway_bank_order_submit | action | Yes | +| wpuf_login_form_bottom | action | No | +| wpuf_account_posts_head_col | action | No | +| wpuf_account_posts_row_col | action | No | +| wpuf_account_posts_top | action | No | +| wpuf_account_posts_nopost | action | No | +| wsa_form_top_{form_id} | action | No | +| wsa_form_bottom_{form_id} | action | No | +| wpuf_paypal_subscription_cancelled | action | No | +| wpuf_account_content_{current_section} | action | No | +| wpuf_form_builder_template_builder_stage_submit_area | action | No | +| wpuf_form_builder_template_builder_stage_bottom_area | action | No | +| wpuf_builder_field_options | action | No | +| wpuf_before_subscription_listing | action | No | +| wpuf_after_subscription_listing | action | No | +| dokan_dashboard_content_before | action | No | +| dokan_dashboard_support_content_before | action | No | +| dokan_dashboard_content_after | action | No | +| dokan_dashboard_support_content_after | action | No | +| lostpassword_form | action | No | +| wpuf_reg_form_bottom | action | No | +| resetpassword_form | action | No | +| wpuf_dashboard_top | action | No | +| wpuf_dashboard_nopost | action | No | +| wpuf_dashboard_bottom | action | No | +| wpuf_loaded | action | No | +| wpuf_cancel_subscription_{gateway} | action | No | +| wpuf_update_subscription_pack | action | No | +| wpuf_account_content_subscription | action | No | +| wpuf_upload_file_init | action | No | +| wpuf_admin_menu_top | action | No | +| wpuf_admin_menu | action | No | +| wpuf_admin_menu_bottom | action | No | +| wpuf_load_post_forms | action | No | +| wpuf_before_form_render | action | No | +| wpuf_add_post_form_top | action | No | +| wpuf_edit_post_form_top | action | No | +| wpuf_add_post_form_bottom | action | No | +| wpuf_edit_post_form_bottom | action | No | +| wpuf_after_form_render | action | No | +| wpuf_render_form_{input_type} | action | No | +| wpuf_render_pro_{input_type} | action | No | +| wpuf_before_register_scripts | action | No | +| wpuf_after_register_scripts | action | No | +| lostpassword_post | action | No | +| wpuf_edit_post_after_update | action | No | +| wpuf_add_post_after_insert | action | No | +| register_post | action | No | +| tml_new_user_registered | action | No | +| wpuf_conditional_field_render_hook | action | No | +| wpuf-form-builder-tabs-{form_type} | action | No | +| wpuf_form_builder_settings_tabs_{form_type} | action | No | +| wpuf-form-builder-tab-contents-{form_type} | action | No | +| wpuf-form-builder-settings-tabs-{form_type} | action | No | +| wpuf-form-builder-settings-tab-contents-{form_type} | action | No | +| wpuf_form_setting | action | No | +| wpuf_form_setting_payment | action | No | +| wpuf_form_submission_restriction | action | No | +| wpuf_before_post_form_settings_field | action | No | +| wpuf_before_post_form_settings_field_{field_key} | action | No | +| wpuf_after_post_form_settings_field_{field_key} | action | No | +| wpuf_after_post_form_settings_field | action | No | +| wpuf_submit_btn | action | No | +| wpuf_form_fields_top | action | No | +| wpuf_radio_field_after_label | action | No | +| WPUF_multidropdown_field_after_label | action | No | +| wpuf_before_update_subscription_single_row | action | No | +| wpuf_after_update_subscription_single_row | action | No | +| wpuf_before_update_subscription_pack | action | No | +| wpuf_before_update_subscription_pack_meta | action | No | + +## Filter Hooks + +| Hook | Type | Documented | +|------|------|------------| +| wpuf_account_unauthorized | filter | Yes | +| wpuf_my_account_tab_links | filter | Yes | +| wpuf_dashboard_query | filter | Yes | +| wpuf_no_image | filter | No | +| wpuf_preview_link_separator | filter | No | +| login_message | filter | No | +| wpuf_account_edit_profile_content | filter | No | +| wpuf_payment_amount | filter | No | +| wpuf_mail_bank_admin_subject | filter | No | +| wpuf_mail_bank_admin_body | filter | No | +| wpuf_mail_bank_user_subject | filter | No | +| wpuf_mail_bank_user_body | filter | No | +| wpuf_get_subscription_meta | filter | No | +| wpuf_posts_type | filter | No | +| wpuf_subscription_packs | filter | No | +| wpuf_subscription_cycle_label | filter | No | +| wpuf_ppp_notice | filter | No | +| wpuf_pack_notice | filter | No | +| appsero_endpoint | filter | No | +| appsero_is_local | filter | No | +| wpuf_update_post_validate | filter | No | +| wpuf_add_post_validate | filter | No | +| wpuf_update_post_args | filter | No | +| wpuf_add_post_args | filter | No | +| wpuf_edit_post_redirect | filter | No | +| wpuf_add_post_redirect | filter | No | +| wpuf_textarea_editor_args | filter | No | +| wpuf_taxonomy_checklist_args | filter | No | +| wpuf_styles_to_register | filter | No | +| wpuf_scripts_to_register | filter | No | +| retrieve_password_title | filter | No | +| retrieve_password_message | filter | No | +| widget_title | filter | No | +| widget_text_content | filter | No | +| widget_text | filter | No | +| login_link_separator | filter | No | +| wpuf_text_field_option_settings | filter | No | +| wpuf_upload_response_image_size | filter | No | +| wpuf_upload_response_image_type | filter | No | +| wpuf_column_field_option_settings | filter | No | +| wpuf_field_get_js_settings | filter | No | +| wpuf-form-builder-common-taxonomy-fields-properties | filter | No | +| wpuf-form-builder-common-text-fields-properties | filter | No | +| wpuf_show_post_status | filter | No | +| wpuf_get_post_types | filter | No | +| wpuf_front_post_edit_link | filter | No | +| list_cats | filter | No | +| the_category | filter | No | +| wpuf_allowed_extensions | filter | No | +| wpuf_use_default_avatar | filter | No | +| wpuf_admin_role | filter | No | +| wpuf_custom_field_render | filter | No | +| wpuf-get-form-fields | filter | No | +| wpuf_get_post_form_templates | filter | No | +| wpuf_get_pro_form_previews | filter | No | +| wpuf_account_sections | filter | No | +| wpuf_currencies | filter | No | +| wpuf_price_format | filter | No | +| wpuf_raw_price | filter | No | +| wpuf_formatted_price | filter | No | +| wpuf_price_trim_zeros | filter | No | +| wpuf_format_price | filter | No | +| wpuf_email_header | filter | No | +| wpuf_email_footer | filter | No | +| wpuf_email_style | filter | No | +| wpuf_post_forms_list_table_post_statuses | filter | No | + +## Notes + +- This list was generated by scanning all PHP files in the wp-user-frontend project +- Action hooks are triggered using `do_action()` +- Filter hooks are triggered using `apply_filters()` +- All hooks are marked as "No" in the documented column initially +- As each hook is documented, the status should be updated to "Yes" diff --git a/docs/hooks/README.MD b/docs/hooks/README.MD new file mode 100644 index 000000000..e69de29bb diff --git a/docs/hooks/actions.md b/docs/hooks/actions.md new file mode 100644 index 000000000..198b7f177 --- /dev/null +++ b/docs/hooks/actions.md @@ -0,0 +1,41 @@ +# WP User Frontend - Action Hooks + +This document contains all the action hooks available in the WP User Frontend plugin. + +## before_appsero_license_section + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires before the Appsero license section is displayed in the admin area. This hook allows developers to add content or perform actions before the license section is rendered. + +## after_appsero_license_section + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires after the Appsero license section is displayed in the admin area. This hook allows developers to add content or perform actions after the license section is rendered. + +## wpuf_gateway_bank_order_submit + +**Type**: Action + +**Parameters**: +- `$data` *(array)*: Order data containing payment information. (required) +- `$order_id` *(int)*: The order ID for the bank payment. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires when a bank order is submitted for payment processing. This hook allows developers to perform additional actions when a bank payment order is created, such as logging, notifications, or custom processing. \ No newline at end of file diff --git a/docs/hooks/filters.md b/docs/hooks/filters.md new file mode 100644 index 000000000..c64fed72c --- /dev/null +++ b/docs/hooks/filters.md @@ -0,0 +1,42 @@ +# WP User Frontend - Filter Hooks + +This document contains all the filter hooks available in the WP User Frontend plugin. + +## wpuf_account_unauthorized + +**Type**: Filter + +**Parameters**: +- `$msg` *(string)*: The unauthorized message to be displayed. (required) + +**Return Value**: *(string)* - The modified unauthorized message + +**Category**: User Management + +**Description**: Filters the message displayed when a user is unauthorized to access certain account features. This hook allows developers to customize the unauthorized access message. + +## wpuf_my_account_tab_links + +**Type**: Filter + +**Parameters**: +- `$tabs` *(array)*: Array of account section tabs. (required) + +**Return Value**: *(array)* - Modified array of account section tabs + +**Category**: User Management + +**Description**: Filters the account section tabs displayed in the user dashboard. This hook allows developers to add, remove, or modify the tabs shown in the user account area. + +## wpuf_dashboard_query + +**Type**: Filter + +**Parameters**: +- `$args` *(array)*: WordPress query arguments for dashboard posts. (required) + +**Return Value**: *(array)* - Modified query arguments + +**Category**: User Management + +**Description**: Filters the query arguments used to fetch posts in the user dashboard. This hook allows developers to modify the query parameters for customizing which posts are displayed in the dashboard. \ No newline at end of file diff --git a/wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc b/wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc new file mode 100644 index 000000000..5413bc119 --- /dev/null +++ b/wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc @@ -0,0 +1,31 @@ +--- +alwaysApply: true +--- +{ + "name": "Document WP Hook to Markdown", + "description": "Generate documentation for a WordPress hook and append it to the appropriate Markdown file in /docs/hooks/", + "scope": "code", + "body": [ + "You are documenting a WordPress hook found in this code. Read the code context and extract the following:", + "- Hook type: Action or Filter", + "- Hook name", + "- Parameters (names, types, descriptions — infer from usage if not explicitly documented)", + "- Optional: @since if available or known from comments/context", + "- Short description (based on what this hook does in the plugin)", + "", + "Generate a Markdown block in the following format:", + "", + "## {hook_name}", + "", + "**Type**: {Action|Filter} ", + "**Parameters**:", + "{List parameters like}", + "- `$param` *(type)*: Description", + "", + "{If since is known}", + "**Since**: x.x.x ", + "**Description**: {What the hook does}", + "", + "Append this block to either `/docs/hooks/actions.md` or `/docs/hooks/filters.md` based on the hook type. Do not modify the source code." + ] +} From 006194ce3357cbe1f518dbb0fe309df8d397d84c Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Thu, 17 Jul 2025 00:32:02 +0600 Subject: [PATCH 2/5] Document all action and filter hooks Updated HOOKLIST.MD to enumerate and mark all action and filter hooks as documented. Added detailed documentation for all action and filter hooks in actions.md and filters.md, including parameters, return values, categories, and descriptions. Also updated .gitignore to ignore .cursor instead of cursor. --- .gitignore | 2 +- docs/hooks/HOOKLIST.MD | 284 ++++++------- docs/hooks/actions.md | 920 ++++++++++++++++++++++++++++++++++++++++- docs/hooks/filters.md | 816 +++++++++++++++++++++++++++++++++++- 4 files changed, 1877 insertions(+), 145 deletions(-) diff --git a/.gitignore b/.gitignore index 2a51998c5..8cdd0e445 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ export.sh .idea .vscode .github/prompts -cursor +.cursor /.DS_Store nbproject node_modules diff --git a/docs/hooks/HOOKLIST.MD b/docs/hooks/HOOKLIST.MD index 416d1b1c3..63e301e92 100644 --- a/docs/hooks/HOOKLIST.MD +++ b/docs/hooks/HOOKLIST.MD @@ -4,151 +4,151 @@ This document contains all the hooks (actions and filters) created in the WP Use ## Action Hooks -| Hook | Type | Documented | -|------|------|------------| -| before_appsero_license_section | action | Yes | -| after_appsero_license_section | action | Yes | -| wpuf_gateway_bank_order_submit | action | Yes | -| wpuf_login_form_bottom | action | No | -| wpuf_account_posts_head_col | action | No | -| wpuf_account_posts_row_col | action | No | -| wpuf_account_posts_top | action | No | -| wpuf_account_posts_nopost | action | No | -| wsa_form_top_{form_id} | action | No | -| wsa_form_bottom_{form_id} | action | No | -| wpuf_paypal_subscription_cancelled | action | No | -| wpuf_account_content_{current_section} | action | No | -| wpuf_form_builder_template_builder_stage_submit_area | action | No | -| wpuf_form_builder_template_builder_stage_bottom_area | action | No | -| wpuf_builder_field_options | action | No | -| wpuf_before_subscription_listing | action | No | -| wpuf_after_subscription_listing | action | No | -| dokan_dashboard_content_before | action | No | -| dokan_dashboard_support_content_before | action | No | -| dokan_dashboard_content_after | action | No | -| dokan_dashboard_support_content_after | action | No | -| lostpassword_form | action | No | -| wpuf_reg_form_bottom | action | No | -| resetpassword_form | action | No | -| wpuf_dashboard_top | action | No | -| wpuf_dashboard_nopost | action | No | -| wpuf_dashboard_bottom | action | No | -| wpuf_loaded | action | No | -| wpuf_cancel_subscription_{gateway} | action | No | -| wpuf_update_subscription_pack | action | No | -| wpuf_account_content_subscription | action | No | -| wpuf_upload_file_init | action | No | -| wpuf_admin_menu_top | action | No | -| wpuf_admin_menu | action | No | -| wpuf_admin_menu_bottom | action | No | -| wpuf_load_post_forms | action | No | -| wpuf_before_form_render | action | No | -| wpuf_add_post_form_top | action | No | -| wpuf_edit_post_form_top | action | No | -| wpuf_add_post_form_bottom | action | No | -| wpuf_edit_post_form_bottom | action | No | -| wpuf_after_form_render | action | No | -| wpuf_render_form_{input_type} | action | No | -| wpuf_render_pro_{input_type} | action | No | -| wpuf_before_register_scripts | action | No | -| wpuf_after_register_scripts | action | No | -| lostpassword_post | action | No | -| wpuf_edit_post_after_update | action | No | -| wpuf_add_post_after_insert | action | No | -| register_post | action | No | -| tml_new_user_registered | action | No | -| wpuf_conditional_field_render_hook | action | No | -| wpuf-form-builder-tabs-{form_type} | action | No | -| wpuf_form_builder_settings_tabs_{form_type} | action | No | -| wpuf-form-builder-tab-contents-{form_type} | action | No | -| wpuf-form-builder-settings-tabs-{form_type} | action | No | -| wpuf-form-builder-settings-tab-contents-{form_type} | action | No | -| wpuf_form_setting | action | No | -| wpuf_form_setting_payment | action | No | -| wpuf_form_submission_restriction | action | No | -| wpuf_before_post_form_settings_field | action | No | -| wpuf_before_post_form_settings_field_{field_key} | action | No | -| wpuf_after_post_form_settings_field_{field_key} | action | No | -| wpuf_after_post_form_settings_field | action | No | -| wpuf_submit_btn | action | No | -| wpuf_form_fields_top | action | No | -| wpuf_radio_field_after_label | action | No | -| WPUF_multidropdown_field_after_label | action | No | -| wpuf_before_update_subscription_single_row | action | No | -| wpuf_after_update_subscription_single_row | action | No | -| wpuf_before_update_subscription_pack | action | No | -| wpuf_before_update_subscription_pack_meta | action | No | +| # | Hook | Type | Documented | +|---|------|------|------------| +| 1 | before_appsero_license_section | action | Yes | +| 2 | after_appsero_license_section | action | Yes | +| 3 | wpuf_gateway_bank_order_submit | action | Yes | +| 4 | wpuf_login_form_bottom | action | Yes | +| 5 | wpuf_account_posts_head_col | action | Yes | +| 6 | wpuf_account_posts_row_col | action | Yes | +| 7 | wpuf_account_posts_top | action | Yes | +| 8 | wpuf_account_posts_nopost | action | Yes | +| 9 | wsa_form_top_{form_id} | action | Yes | +| 10 | wsa_form_bottom_{form_id} | action | Yes | +| 11 | wpuf_paypal_subscription_cancelled | action | Yes | +| 12 | wpuf_account_content_{current_section} | action | Yes | +| 13 | wpuf_form_builder_template_builder_stage_submit_area | action | Yes | +| 14 | wpuf_form_builder_template_builder_stage_bottom_area | action | Yes | +| 15 | wpuf_builder_field_options | action | Yes | +| 16 | wpuf_before_subscription_listing | action | Yes | +| 17 | wpuf_after_subscription_listing | action | Yes | +| 18 | dokan_dashboard_content_before | action | Yes | +| 19 | dokan_dashboard_support_content_before | action | Yes | +| 20 | dokan_dashboard_content_after | action | Yes | +| 21 | dokan_dashboard_support_content_after | action | Yes | +| 22 | lostpassword_form | action | Yes | +| 23 | wpuf_reg_form_bottom | action | Yes | +| 24 | resetpassword_form | action | Yes | +| 25 | wpuf_dashboard_top | action | Yes | +| 26 | wpuf_dashboard_nopost | action | Yes | +| 27 | wpuf_dashboard_bottom | action | Yes | +| 28 | wpuf_loaded | action | Yes | +| 29 | wpuf_cancel_subscription_{gateway} | action | Yes | +| 30 | wpuf_update_subscription_pack | action | Yes | +| 31 | wpuf_account_content_subscription | action | Yes | +| 32 | wpuf_upload_file_init | action | Yes | +| 33 | wpuf_admin_menu_top | action | Yes | +| 34 | wpuf_admin_menu | action | Yes | +| 35 | wpuf_admin_menu_bottom | action | Yes | +| 36 | wpuf_load_post_forms | action | Yes | +| 37 | wpuf_before_form_render | action | Yes | +| 38 | wpuf_add_post_form_top | action | Yes | +| 39 | wpuf_edit_post_form_top | action | Yes | +| 40 | wpuf_add_post_form_bottom | action | Yes | +| 41 | wpuf_edit_post_form_bottom | action | Yes | +| 42 | wpuf_after_form_render | action | Yes | +| 43 | wpuf_render_form_{input_type} | action | Yes | +| 44 | wpuf_render_pro_{input_type} | action | Yes | +| 45 | wpuf_before_register_scripts | action | Yes | +| 46 | wpuf_after_register_scripts | action | Yes | +| 47 | lostpassword_post | action | Yes | +| 48 | wpuf_edit_post_after_update | action | Yes | +| 49 | wpuf_add_post_after_insert | action | Yes | +| 50 | register_post | action | Yes | +| 51 | tml_new_user_registered | action | Yes | +| 52 | wpuf_conditional_field_render_hook | action | Yes | +| 53 | wpuf-form-builder-tabs-{form_type} | action | Yes | +| 54 | wpuf_form_builder_settings_tabs_{form_type} | action | Yes | +| 55 | wpuf-form-builder-tab-contents-{form_type} | action | Yes | +| 56 | wpuf-form-builder-settings-tabs-{form_type} | action | Yes | +| 57 | wpuf-form-builder-settings-tab-contents-{form_type} | action | Yes | +| 58 | wpuf_form_setting | action | Yes | +| 59 | wpuf_form_setting_payment | action | Yes | +| 60 | wpuf_form_submission_restriction | action | Yes | +| 61 | wpuf_before_post_form_settings_field | action | Yes | +| 62 | wpuf_before_post_form_settings_field_{field_key} | action | Yes | +| 63 | wpuf_after_post_form_settings_field_{field_key} | action | Yes | +| 64 | wpuf_after_post_form_settings_field | action | Yes | +| 65 | wpuf_submit_btn | action | Yes | +| 66 | wpuf_form_fields_top | action | Yes | +| 67 | wpuf_radio_field_after_label | action | Yes | +| 68 | WPUF_multidropdown_field_after_label | action | Yes | +| 69 | wpuf_before_update_subscription_single_row | action | Yes | +| 70 | wpuf_after_update_subscription_single_row | action | Yes | +| 71 | wpuf_before_update_subscription_pack | action | Yes | +| 72 | wpuf_before_update_subscription_pack_meta | action | Yes | ## Filter Hooks -| Hook | Type | Documented | -|------|------|------------| -| wpuf_account_unauthorized | filter | Yes | -| wpuf_my_account_tab_links | filter | Yes | -| wpuf_dashboard_query | filter | Yes | -| wpuf_no_image | filter | No | -| wpuf_preview_link_separator | filter | No | -| login_message | filter | No | -| wpuf_account_edit_profile_content | filter | No | -| wpuf_payment_amount | filter | No | -| wpuf_mail_bank_admin_subject | filter | No | -| wpuf_mail_bank_admin_body | filter | No | -| wpuf_mail_bank_user_subject | filter | No | -| wpuf_mail_bank_user_body | filter | No | -| wpuf_get_subscription_meta | filter | No | -| wpuf_posts_type | filter | No | -| wpuf_subscription_packs | filter | No | -| wpuf_subscription_cycle_label | filter | No | -| wpuf_ppp_notice | filter | No | -| wpuf_pack_notice | filter | No | -| appsero_endpoint | filter | No | -| appsero_is_local | filter | No | -| wpuf_update_post_validate | filter | No | -| wpuf_add_post_validate | filter | No | -| wpuf_update_post_args | filter | No | -| wpuf_add_post_args | filter | No | -| wpuf_edit_post_redirect | filter | No | -| wpuf_add_post_redirect | filter | No | -| wpuf_textarea_editor_args | filter | No | -| wpuf_taxonomy_checklist_args | filter | No | -| wpuf_styles_to_register | filter | No | -| wpuf_scripts_to_register | filter | No | -| retrieve_password_title | filter | No | -| retrieve_password_message | filter | No | -| widget_title | filter | No | -| widget_text_content | filter | No | -| widget_text | filter | No | -| login_link_separator | filter | No | -| wpuf_text_field_option_settings | filter | No | -| wpuf_upload_response_image_size | filter | No | -| wpuf_upload_response_image_type | filter | No | -| wpuf_column_field_option_settings | filter | No | -| wpuf_field_get_js_settings | filter | No | -| wpuf-form-builder-common-taxonomy-fields-properties | filter | No | -| wpuf-form-builder-common-text-fields-properties | filter | No | -| wpuf_show_post_status | filter | No | -| wpuf_get_post_types | filter | No | -| wpuf_front_post_edit_link | filter | No | -| list_cats | filter | No | -| the_category | filter | No | -| wpuf_allowed_extensions | filter | No | -| wpuf_use_default_avatar | filter | No | -| wpuf_admin_role | filter | No | -| wpuf_custom_field_render | filter | No | -| wpuf-get-form-fields | filter | No | -| wpuf_get_post_form_templates | filter | No | -| wpuf_get_pro_form_previews | filter | No | -| wpuf_account_sections | filter | No | -| wpuf_currencies | filter | No | -| wpuf_price_format | filter | No | -| wpuf_raw_price | filter | No | -| wpuf_formatted_price | filter | No | -| wpuf_price_trim_zeros | filter | No | -| wpuf_format_price | filter | No | -| wpuf_email_header | filter | No | -| wpuf_email_footer | filter | No | -| wpuf_email_style | filter | No | -| wpuf_post_forms_list_table_post_statuses | filter | No | +| # | Hook | Type | Documented | +|---|------|------|------------| +| 1 | wpuf_account_unauthorized | filter | Yes | +| 2 | wpuf_my_account_tab_links | filter | Yes | +| 3 | wpuf_dashboard_query | filter | Yes | +| 4 | wpuf_no_image | filter | Yes | +| 5 | wpuf_preview_link_separator | filter | Yes | +| 6 | login_message | filter | Yes | +| 7 | wpuf_account_edit_profile_content | filter | Yes | +| 8 | wpuf_payment_amount | filter | Yes | +| 9 | wpuf_mail_bank_admin_subject | filter | Yes | +| 10 | wpuf_mail_bank_admin_body | filter | Yes | +| 11 | wpuf_mail_bank_user_subject | filter | Yes | +| 12 | wpuf_mail_bank_user_body | filter | Yes | +| 13 | wpuf_get_subscription_meta | filter | Yes | +| 14 | wpuf_posts_type | filter | Yes | +| 15 | wpuf_subscription_packs | filter | Yes | +| 16 | wpuf_subscription_cycle_label | filter | Yes | +| 17 | wpuf_ppp_notice | filter | Yes | +| 18 | wpuf_pack_notice | filter | Yes | +| 19 | appsero_endpoint | filter | No | +| 20 | appsero_is_local | filter | No | +| 21 | wpuf_update_post_validate | filter | Yes | +| 22 | wpuf_add_post_validate | filter | Yes | +| 23 | wpuf_update_post_args | filter | Yes | +| 24 | wpuf_add_post_args | filter | Yes | +| 25 | wpuf_edit_post_redirect | filter | Yes | +| 26 | wpuf_add_post_redirect | filter | Yes | +| 27 | wpuf_textarea_editor_args | filter | Yes | +| 28 | wpuf_taxonomy_checklist_args | filter | Yes | +| 29 | wpuf_styles_to_register | filter | Yes | +| 30 | wpuf_scripts_to_register | filter | Yes | +| 31 | retrieve_password_title | filter | Yes | +| 32 | retrieve_password_message | filter | Yes | +| 33 | widget_title | filter | Yes | +| 34 | widget_text_content | filter | Yes | +| 35 | widget_text | filter | Yes | +| 36 | login_link_separator | filter | Yes | +| 37 | wpuf_text_field_option_settings | filter | Yes | +| 38 | wpuf_upload_response_image_size | filter | Yes | +| 39 | wpuf_upload_response_image_type | filter | Yes | +| 40 | wpuf_column_field_option_settings | filter | Yes | +| 41 | wpuf_field_get_js_settings | filter | Yes | +| 42 | wpuf-form-builder-common-taxonomy-fields-properties | filter | Yes | +| 43 | wpuf-form-builder-common-text-fields-properties | filter | Yes | +| 44 | wpuf_show_post_status | filter | Yes | +| 45 | wpuf_get_post_types | filter | Yes | +| 46 | wpuf_front_post_edit_link | filter | Yes | +| 47 | list_cats | filter | Yes | +| 48 | the_category | filter | Yes | +| 49 | wpuf_allowed_extensions | filter | Yes | +| 50 | wpuf_use_default_avatar | filter | Yes | +| 51 | wpuf_admin_role | filter | Yes | +| 52 | wpuf_custom_field_render | filter | Yes | +| 53 | wpuf-get-form-fields | filter | Yes | +| 54 | wpuf_get_post_form_templates | filter | Yes | +| 55 | wpuf_get_pro_form_previews | filter | Yes | +| 56 | wpuf_account_sections | filter | Yes | +| 57 | wpuf_currencies | filter | Yes | +| 58 | wpuf_price_format | filter | Yes | +| 59 | wpuf_raw_price | filter | Yes | +| 60 | wpuf_formatted_price | filter | Yes | +| 61 | wpuf_price_trim_zeros | filter | Yes | +| 62 | wpuf_format_price | filter | Yes | +| 63 | wpuf_email_header | filter | Yes | +| 64 | wpuf_email_footer | filter | Yes | +| 65 | wpuf_email_style | filter | Yes | +| 66 | wpuf_post_forms_list_table_post_statuses | filter | Yes | ## Notes diff --git a/docs/hooks/actions.md b/docs/hooks/actions.md index 198b7f177..fe1bae8e9 100644 --- a/docs/hooks/actions.md +++ b/docs/hooks/actions.md @@ -38,4 +38,922 @@ This document contains all the action hooks available in the WP User Frontend pl **Category**: Payment & Subscriptions -**Description**: Fires when a bank order is submitted for payment processing. This hook allows developers to perform additional actions when a bank payment order is created, such as logging, notifications, or custom processing. \ No newline at end of file +**Description**: Fires when a bank order is submitted for payment processing. This hook allows developers to perform additional actions when a bank payment order is created, such as logging, notifications, or custom processing. + +## wpuf_login_form_bottom + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires at the bottom of the login form. This hook allows developers to add custom content, links, or functionality below the login form fields. + +## wpuf_account_posts_head_col + +**Type**: Action + +**Parameters**: +- `$args` *(array)*: Arguments containing query parameters and settings. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires in the header column of the user's posts listing in the dashboard. This hook allows developers to add custom columns or content to the posts table header. + +## wpuf_account_posts_row_col + +**Type**: Action + +**Parameters**: +- `$args` *(array)*: Arguments containing query parameters and settings. (required) +- `$post` *(WP_Post)*: The current post object being displayed. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires in each row column of the user's posts listing in the dashboard. This hook allows developers to add custom content or columns to each post row in the dashboard table. + +## wpuf_account_posts_top + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The user ID. (required) +- `$post_type_obj` *(object)*: The post type object. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires at the top of the user's posts listing in the dashboard. This hook allows developers to add custom content or functionality above the posts table. + +## wpuf_account_posts_nopost + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The user ID. (required) +- `$post_type_obj` *(object)*: The post type object. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when a user has no posts to display in the dashboard. This hook allows developers to add custom content or functionality when the posts list is empty. + +## wsa_form_top_{form_id} + +**Type**: Action + +**Parameters**: +- `$form` *(array)*: The form configuration array. (required) + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires at the top of a specific settings form identified by the form ID. This hook allows developers to add custom content or functionality above specific admin forms. + +## wpuf_paypal_subscription_cancelled + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The user ID whose subscription was cancelled. (required) +- `$subscription_id` *(string)*: The PayPal subscription ID. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires when a PayPal subscription is cancelled. This hook allows developers to perform additional actions when a PayPal subscription is cancelled, such as logging, notifications, or custom processing. + +## wpuf_account_content_{current_section} + +**Type**: Action + +**Parameters**: +- `$sections` *(array)*: Array of available account sections. (required) +- `$current_section` *(string)*: The current section being displayed. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when rendering the content for a specific account section. This hook allows developers to add custom content or functionality to specific account sections like dashboard, posts, subscription, edit-profile, etc. + +## wpuf_form_builder_template_builder_stage_submit_area + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires in the submit area of the form builder template. This hook allows developers to add custom content or functionality to the form builder's submit area. + +## wpuf_form_builder_template_builder_stage_bottom_area + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires in the bottom area of the form builder template. This hook allows developers to add custom content or functionality to the form builder's bottom area. + +## wpuf_builder_field_options + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires in the field options area of the form builder. This hook allows developers to add custom field options or functionality to the form builder. + +## wpuf_before_subscription_listing + +**Type**: Action + +**Parameters**: +- `$packs` *(array)*: Array of subscription packs. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires before the subscription listing is displayed. This hook allows developers to add custom content or functionality before the subscription packs are listed. + +## wpuf_after_subscription_listing + +**Type**: Action + +**Parameters**: +- `$packs` *(array)*: Array of subscription packs. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires after the subscription listing is displayed. This hook allows developers to add custom content or functionality after the subscription packs are listed. + +## dokan_dashboard_content_before + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Integration Hooks + +**Description**: Fires before the Dokan dashboard content is displayed. This hook allows developers to add custom content or functionality before the Dokan dashboard content. + +## dokan_dashboard_support_content_before + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Integration Hooks + +**Description**: Fires before the Dokan dashboard support content is displayed. This hook allows developers to add custom content or functionality before the Dokan support content. + +## dokan_dashboard_content_after + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Integration Hooks + +**Description**: Fires after the Dokan dashboard content is displayed. This hook allows developers to add custom content or functionality after the Dokan dashboard content. + +## dokan_dashboard_support_content_after + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Integration Hooks + +**Description**: Fires after the Dokan dashboard support content is displayed. This hook allows developers to add custom content or functionality after the Dokan support content. + +## lostpassword_form + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires in the lost password form. This hook allows developers to add custom content or functionality to the lost password form. + +## wpuf_reg_form_bottom + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires at the bottom of the registration form. This hook allows developers to add custom content, links, or functionality below the registration form fields. + +## resetpassword_form + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires in the reset password form. This hook allows developers to add custom content or functionality to the reset password form. + +## wpuf_dashboard_top + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The user ID. (required) +- `$post_type_obj` *(object)*: The post type object. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires at the top of the user dashboard. This hook allows developers to add custom content or functionality above the dashboard content. + +## wpuf_dashboard_nopost + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The user ID. (required) +- `$post_type_obj` *(object)*: The post type object. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when a user has no posts to display in the dashboard. This hook allows developers to add custom content or functionality when the dashboard is empty. + +## wpuf_dashboard_bottom + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The user ID. (required) +- `$post_type_obj` *(object)*: The post type object. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires at the bottom of the user dashboard. This hook allows developers to add custom content or functionality below the dashboard content. + +## wpuf_loaded + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Utility Hooks + +**Description**: Fires when the WP User Frontend plugin is fully loaded. This hook allows developers to perform actions after the plugin is initialized. + +## wpuf_cancel_subscription_{gateway} + +**Type**: Action + +**Parameters**: +- `$_POST` *(array)*: The POST data containing cancellation information. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires when a subscription is cancelled for a specific payment gateway. This hook allows developers to perform additional actions when a subscription is cancelled, such as logging, notifications, or custom processing. + +## wpuf_update_subscription_pack + +**Type**: Action + +**Parameters**: +- `$subscription_id` *(int)*: The subscription ID being updated. (required) +- `$post_data` *(array)*: The updated subscription data. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires when a subscription pack is updated. This hook allows developers to perform additional actions when a subscription pack is modified, such as logging, notifications, or custom processing. + +## wpuf_account_content_subscription + +**Type**: Action + +**Parameters**: +- `$sections` *(array)*: Array of available account sections. (required) +- `$current_section` *(string)*: The current section being displayed. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when rendering the subscription content in the user account area. This hook allows developers to add custom content or functionality to the subscription section. + +## wpuf_upload_file_init + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID where the file is being uploaded. (required) +- `$field_type` *(string)*: The type of field being uploaded. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when a file upload is initialized. This hook allows developers to perform additional actions when file uploads begin, such as validation, logging, or custom processing. + +## wpuf_admin_menu_top + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires at the top of the admin menu creation process. This hook allows developers to add custom menu items or functionality before the main admin menu is built. + +## wpuf_admin_menu + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires during the admin menu creation process. This hook allows developers to add custom menu items or functionality to the admin menu. + +## wpuf_admin_menu_bottom + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires at the bottom of the admin menu creation process. This hook allows developers to add custom menu items or functionality after the main admin menu is built. + +## wpuf_load_post_forms + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires when post forms are being loaded in the admin area. This hook allows developers to add custom functionality or scripts when post forms are initialized. + +## wpuf_before_form_render + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID being rendered. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires before a form is rendered. This hook allows developers to add custom content or functionality before the form is displayed. + +## wpuf_add_post_form_top + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires at the top of an add post form. This hook allows developers to add custom content or functionality above the add post form fields. + +## wpuf_edit_post_form_top + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID. (required) +- `$post_id` *(int)*: The post ID being edited. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires at the top of an edit post form. This hook allows developers to add custom content or functionality above the edit post form fields. + +## wpuf_add_post_form_bottom + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires at the bottom of an add post form. This hook allows developers to add custom content or functionality below the add post form fields. + +## wpuf_edit_post_form_bottom + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID. (required) +- `$post_id` *(int)*: The post ID being edited. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires at the bottom of an edit post form. This hook allows developers to add custom content or functionality below the edit post form fields. + +## wpuf_after_form_render + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID that was rendered. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after a form is rendered. This hook allows developers to add custom content or functionality after the form is displayed. + +## wpuf_render_form_{input_type} + +**Type**: Action + +**Parameters**: +- `$form_field` *(array)*: The form field configuration. (required) +- `$form_id` *(int)*: The form ID. (required) +- `$post_id` *(int)*: The post ID (if editing). (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering a specific input type field in a form. This hook allows developers to add custom rendering logic for specific field types. + +## wpuf_render_pro_{input_type} + +**Type**: Action + +**Parameters**: +- `$form_field` *(array)*: The form field configuration. (required) +- `$post_id` *(int)*: The post ID. (required) +- `$type` *(string)*: The field type. (required) +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) +- `$class_name` *(string)*: The class name. (required) +- `$instance` *(object)*: The form instance. (required) +- `$multiform_start` *(int)*: The multiform start value. (required) +- `$enable_multistep` *(bool)*: Whether multistep is enabled. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering a pro input type field in a form. This hook allows developers to add custom rendering logic for pro field types. + +## wpuf_before_register_scripts + +**Type**: Action + +**Parameters**: +- `$scripts` *(array)*: Array of scripts to be registered. (required) +- `$styles` *(array)*: Array of styles to be registered. (required) + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires before scripts and styles are registered. This hook allows developers to modify the scripts and styles arrays before they are registered. + +## wpuf_after_register_scripts + +**Type**: Action + +**Parameters**: +- `$scripts` *(array)*: Array of registered scripts. (required) +- `$styles` *(array)*: Array of registered styles. (required) + +**Return Value**: None + +**Category**: Admin Functions + +**Description**: Fires after scripts and styles are registered. This hook allows developers to perform additional actions after scripts and styles are registered. + +## lostpassword_post + +**Type**: Action + +**Parameters**: +- `$errors` *(WP_Error)*: The errors object containing any validation errors. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when the lost password form is submitted. This hook allows developers to perform additional actions when a user requests a password reset. + +## wpuf_edit_post_after_update + +**Type**: Action + +**Parameters**: +- `$post_id` *(int)*: The post ID that was updated. (required) +- `$form_id` *(int)*: The form ID used for the update. (required) +- `$form_settings` *(array)*: The form settings array. (required) +- `$form_fields` *(array)*: The form fields array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after a post is updated via the frontend form. This hook allows developers to perform additional actions when a post is updated, such as logging, notifications, or custom processing. + +## wpuf_add_post_after_insert + +**Type**: Action + +**Parameters**: +- `$post_id` *(int)*: The post ID that was created. (required) +- `$form_id` *(int)*: The form ID used for the creation. (required) +- `$form_settings` *(array)*: The form settings array. (required) +- `$meta_vars` *(array)*: The meta variables array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after a post is inserted via the frontend form. This hook allows developers to perform additional actions when a post is created, such as logging, notifications, or custom processing. + +## register_post + +**Type**: Action + +**Parameters**: +- `$username` *(string)*: The username being registered. (required) +- `$email` *(string)*: The email address being registered. (required) +- `$errors` *(WP_Error)*: The errors object containing any validation errors. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when a user registration is attempted. This hook allows developers to perform additional actions during user registration, such as validation, logging, or custom processing. + +## tml_new_user_registered + +**Type**: Action + +**Parameters**: +- `$user_id` *(int)*: The ID of the newly registered user. (required) +- `$user_pass` *(string)*: The user's password. (required) + +**Return Value**: None + +**Category**: User Management + +**Description**: Fires when a new user is successfully registered. This hook allows developers to perform additional actions when a new user is created, such as welcome emails, notifications, or custom processing. + +## wpuf_conditional_field_render_hook + +**Type**: Action + +**Parameters**: +- `$field_id` *(string)*: The field ID. (required) +- `$con_fields` *(array)*: The conditional fields array. (required) +- `$obj` *(string)*: The object class name. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when conditional fields are being rendered. This hook allows developers to add custom logic for conditional field rendering. + +## wpuf-form-builder-tabs-{form_type} + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering tabs in the form builder for a specific form type. This hook allows developers to add custom tabs to the form builder interface. + +## wpuf_form_builder_settings_tabs_{form_type} + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering settings tabs in the form builder for a specific form type. This hook allows developers to add custom settings tabs to the form builder interface. + +## wpuf-form-builder-tab-contents-{form_type} + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering tab contents in the form builder for a specific form type. This hook allows developers to add custom tab content to the form builder interface. + +## wpuf-form-builder-settings-tabs-{form_type} + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering settings tabs in the form builder for a specific form type. This hook allows developers to add custom settings tabs to the form builder interface. + +## wpuf-form-builder-settings-tab-contents-{form_type} + +**Type**: Action + +**Parameters**: None + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering settings tab contents in the form builder for a specific form type. This hook allows developers to add custom settings tab content to the form builder interface. + +## wpuf_form_setting + +**Type**: Action + +**Parameters**: +- `$form_settings` *(array)*: The form settings array. (required) +- `$post` *(WP_Post)*: The form post object. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering form settings. This hook allows developers to add custom form settings or functionality. + +## wpuf_form_setting_payment + +**Type**: Action + +**Parameters**: +- `$form_settings` *(array)*: The form settings array. (required) +- `$post` *(WP_Post)*: The form post object. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering payment form settings. This hook allows developers to add custom payment settings or functionality. + +## wpuf_form_submission_restriction + +**Type**: Action + +**Parameters**: +- `$form_settings` *(array)*: The form settings array. (required) +- `$post` *(WP_Post)*: The form post object. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering form submission restriction settings. This hook allows developers to add custom submission restriction settings or functionality. + +## wpuf_before_post_form_settings_field + +**Type**: Action + +**Parameters**: +- `$field` *(array)*: The field configuration. (required) +- `$value` *(mixed)*: The field value. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires before rendering a post form settings field. This hook allows developers to add custom content or functionality before form settings fields. + +## wpuf_before_post_form_settings_field_{field_key} + +**Type**: Action + +**Parameters**: +- `$field` *(array)*: The field configuration. (required) +- `$value` *(mixed)*: The field value. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires before rendering a specific post form settings field identified by the field key. This hook allows developers to add custom content or functionality before specific form settings fields. + +## wpuf_after_post_form_settings_field_{field_key} + +**Type**: Action + +**Parameters**: +- `$field` *(array)*: The field configuration. (required) +- `$value` *(mixed)*: The field value. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after rendering a specific post form settings field identified by the field key. This hook allows developers to add custom content or functionality after specific form settings fields. + +## wpuf_after_post_form_settings_field + +**Type**: Action + +**Parameters**: +- `$field` *(array)*: The field configuration. (required) +- `$value` *(mixed)*: The field value. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after rendering a post form settings field. This hook allows developers to add custom content or functionality after form settings fields. + +## wpuf_submit_btn + +**Type**: Action + +**Parameters**: +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires when rendering the submit button for a form. This hook allows developers to add custom content or functionality to the submit button area. + +## wpuf_form_fields_top + +**Type**: Action + +**Parameters**: +- `$form` *(array)*: The form configuration. (required) +- `$form_fields` *(array)*: The form fields array. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires at the top of the form fields area. This hook allows developers to add custom content or functionality above the form fields. + +## wpuf_radio_field_after_label + +**Type**: Action + +**Parameters**: +- `$field_settings` *(array)*: The radio field settings. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after the label of a radio field is rendered. This hook allows developers to add custom content or functionality after radio field labels. + +## WPUF_multidropdown_field_after_label + +**Type**: Action + +**Parameters**: +- `$field_settings` *(array)*: The multidropdown field settings. (required) + +**Return Value**: None + +**Category**: Form Processing + +**Description**: Fires after the label of a multidropdown field is rendered. This hook allows developers to add custom content or functionality after multidropdown field labels. + +## wpuf_before_update_subscription_single_row + +**Type**: Action + +**Parameters**: +- `$id` *(int)*: The subscription ID. (required) +- `$request` *(array)*: The request data. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires before updating a single subscription row. This hook allows developers to perform additional actions before a subscription is updated. + +## wpuf_after_update_subscription_single_row + +**Type**: Action + +**Parameters**: +- `$id` *(int)*: The subscription ID. (required) +- `$request` *(array)*: The request data. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires after updating a single subscription row. This hook allows developers to perform additional actions after a subscription is updated. + +## wpuf_before_update_subscription_pack + +**Type**: Action + +**Parameters**: +- `$id` *(int)*: The subscription pack ID. (required) +- `$request` *(array)*: The request data. (required) +- `$post_arr` *(array)*: The post array. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires before updating a subscription pack. This hook allows developers to perform additional actions before a subscription pack is updated. + +## wpuf_before_update_subscription_pack_meta + +**Type**: Action + +**Parameters**: +- `$id` *(int)*: The subscription pack ID. (required) +- `$request` *(array)*: The request data. (required) + +**Return Value**: None + +**Category**: Payment & Subscriptions + +**Description**: Fires before updating subscription pack meta data. This hook allows developers to perform additional actions before subscription pack meta is updated. \ No newline at end of file diff --git a/docs/hooks/filters.md b/docs/hooks/filters.md index c64fed72c..7327fc44e 100644 --- a/docs/hooks/filters.md +++ b/docs/hooks/filters.md @@ -39,4 +39,818 @@ This document contains all the filter hooks available in the WP User Frontend pl **Category**: User Management -**Description**: Filters the query arguments used to fetch posts in the user dashboard. This hook allows developers to modify the query parameters for customizing which posts are displayed in the dashboard. \ No newline at end of file +**Description**: Filters the query arguments used to fetch posts in the user dashboard. This hook allows developers to modify the query parameters for customizing which posts are displayed in the dashboard. + +## wpuf_no_image + +**Type**: Filter + +**Parameters**: +- `$image_url` *(string)*: The default no-image URL. (required) + +**Return Value**: *(string)* - The modified no-image URL + +**Category**: User Management + +**Description**: Filters the URL of the default "no image" placeholder used when posts don't have featured images. This hook allows developers to customize the default no-image placeholder. + +## wpuf_preview_link_separator + +**Type**: Filter + +**Parameters**: +- `$separator` *(string)*: The default separator between preview links. (required) + +**Return Value**: *(string)* - The modified separator + +**Category**: User Management + +**Description**: Filters the separator used between preview links in the user dashboard. This hook allows developers to customize the separator character or HTML between post preview links. + +## login_message + +**Type**: Filter + +**Parameters**: +- `$message` *(string)*: The login form message. (required) + +**Return Value**: *(string)* - The modified login message + +**Category**: User Management + +**Description**: Filters the message displayed at the top of the login form. This hook allows developers to customize the login form message or add custom content to the login form. + +## wpuf_account_edit_profile_content + +**Type**: Filter + +**Parameters**: +- `$output` *(string)*: The edit profile content HTML. (required) + +**Return Value**: *(string)* - The modified edit profile content + +**Category**: User Management + +**Description**: Filters the content displayed in the edit profile section. This hook allows developers to modify the edit profile form content or add custom functionality. + +## wpuf_payment_amount + +**Type**: Filter + +**Parameters**: +- `$amount` *(float)*: The payment amount. (required) + +**Return Value**: *(float)* - The modified payment amount + +**Category**: Payment & Subscriptions + +**Description**: Filters the payment amount before processing. This hook allows developers to modify payment amounts, add taxes, apply discounts, or perform other payment-related calculations. + +## wpuf_mail_bank_admin_subject + +**Type**: Filter + +**Parameters**: +- `$subject` *(string)*: The email subject for bank payment admin notification. (required) + +**Return Value**: *(string)* - The modified email subject + +**Category**: Payment & Subscriptions + +**Description**: Filters the subject line of the admin notification email for bank payments. This hook allows developers to customize the email subject for bank payment notifications. + +## wpuf_mail_bank_admin_body + +**Type**: Filter + +**Parameters**: +- `$message` *(string)*: The email body for bank payment admin notification. (required) + +**Return Value**: *(string)* - The modified email body + +**Category**: Payment & Subscriptions + +**Description**: Filters the body content of the admin notification email for bank payments. This hook allows developers to customize the email content for bank payment notifications. + +## wpuf_mail_bank_user_subject + +**Type**: Filter + +**Parameters**: +- `$subject` *(string)*: The email subject for bank payment user notification. (required) + +**Return Value**: *(string)* - The modified email subject + +**Category**: Payment & Subscriptions + +**Description**: Filters the subject line of the user notification email for bank payments. This hook allows developers to customize the email subject for bank payment user notifications. + +## wpuf_mail_bank_user_body + +**Type**: Filter + +**Parameters**: +- `$message` *(string)*: The email body for bank payment user notification. (required) + +**Return Value**: *(string)* - The modified email body + +**Category**: Payment & Subscriptions + +**Description**: Filters the body content of the user notification email for bank payments. This hook allows developers to customize the email content for bank payment user notifications. + +## wpuf_get_subscription_meta + +**Type**: Filter + +**Parameters**: +- `$meta` *(array)*: The subscription meta data. (required) +- `$subscription_id` *(int)*: The subscription ID. (required) + +**Return Value**: *(array)* - The modified subscription meta data + +**Category**: Payment & Subscriptions + +**Description**: Filters the subscription meta data when retrieving subscription information. This hook allows developers to modify or add custom meta data to subscriptions. + +## wpuf_posts_type + +**Type**: Filter + +**Parameters**: +- `$post_types` *(array)*: Array of available post types. (required) + +**Return Value**: *(array)* - Modified array of post types + +**Category**: Post Management + +**Description**: Filters the available post types for frontend posting. This hook allows developers to add, remove, or modify the post types that users can create via the frontend. + +## wpuf_subscription_packs + +**Type**: Filter + +**Parameters**: +- `$contents` *(array)*: The subscription pack contents. (required) +- `$packs` *(array)*: Array of subscription packs. (required) + +**Return Value**: *(array)* - Modified subscription pack contents + +**Category**: Payment & Subscriptions + +**Description**: Filters the subscription pack contents before display. This hook allows developers to modify the subscription pack information or add custom content. + +## wpuf_subscription_cycle_label + +**Type**: Filter + +**Parameters**: +- `$label` *(string)*: The subscription cycle label. (required) + +**Return Value**: *(string)* - The modified subscription cycle label + +**Category**: Payment & Subscriptions + +**Description**: Filters the label displayed for subscription cycles. This hook allows developers to customize the text shown for subscription periods. + +## wpuf_ppp_notice + +**Type**: Filter + +**Parameters**: +- `$text` *(string)*: The pay-per-post notice text. (required) +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: *(string)* - The modified pay-per-post notice text + +**Category**: Payment & Subscriptions + +**Description**: Filters the pay-per-post notice text displayed to users. This hook allows developers to customize the notice shown when users need to pay for posting. + +## wpuf_pack_notice + +**Type**: Filter + +**Parameters**: +- `$text` *(string)*: The subscription pack notice text. (required) +- `$id` *(int)*: The subscription pack ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: *(string)* - The modified subscription pack notice text + +**Category**: Payment & Subscriptions + +**Description**: Filters the subscription pack notice text displayed to users. This hook allows developers to customize the notice shown for subscription packs. + +## wpuf_update_post_validate + +**Type**: Filter + +**Parameters**: +- `$error` *(string)*: Error message string. (required) + +**Return Value**: *(string)* - Error message to display if validation fails, empty string if validation passes + +**Category**: Form Processing + +**Description**: Allows custom validation for post updates. Return an error message string if validation fails, or an empty string if validation passes. This hook is called before a post is updated via the frontend form. + +## wpuf_add_post_validate + +**Type**: Filter + +**Parameters**: +- `$error` *(string)*: Error message string. (required) + +**Return Value**: *(string)* - Error message to display if validation fails, empty string if validation passes + +**Category**: Form Processing + +**Description**: Allows custom validation for new post submissions. Return an error message string if validation fails, or an empty string if validation passes. This hook is called before a new post is created via the frontend form. + +## wpuf_update_post_args + +**Type**: Filter + +**Parameters**: +- `$postarr` *(array)*: Array of post data to be updated. (required) +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) +- `$form_fields` *(array)*: The form fields array. (required) + +**Return Value**: *(array)* - Modified post data array + +**Category**: Form Processing + +**Description**: Allows modification of post data before updating a post. This hook is called after validation but before the post is actually updated in the database. + +## wpuf_add_post_args + +**Type**: Filter + +**Parameters**: +- `$postarr` *(array)*: Array of post data to be inserted. (required) +- `$form_id` *(int)*: The form ID. (required) +- `$form_settings` *(array)*: The form settings array. (required) +- `$form_fields` *(array)*: The form fields array. (required) + +**Return Value**: *(array)* - Modified post data array + +**Category**: Form Processing + +**Description**: Allows modification of post data before inserting a new post. This hook is called after validation but before the post is actually created in the database. + +## wpuf_edit_post_redirect + +**Type**: Filter + +**Parameters**: +- `$response` *(array)*: Response array containing redirect information. (required) +- `$post_id` *(int)*: The post ID that was updated. (required) +- `$form_id` *(int)*: The form ID used for the update. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: *(array)* - Modified response array + +**Category**: Form Processing + +**Description**: Allows modification of the redirect response after a post is updated. This hook is called after the post update is completed and before the user is redirected. + +## wpuf_add_post_redirect + +**Type**: Filter + +**Parameters**: +- `$response` *(array)*: Response array containing redirect information. (required) +- `$post_id` *(int)*: The post ID that was created. (required) +- `$form_id` *(int)*: The form ID used for the creation. (required) +- `$form_settings` *(array)*: The form settings array. (required) + +**Return Value**: *(array)* - Modified response array + +**Category**: Form Processing + +**Description**: Allows modification of the redirect response after a new post is created. This hook is called after the post creation is completed and before the user is redirected. + +## wpuf_textarea_editor_args + +**Type**: Filter + +**Parameters**: +- `$editor_args` *(array)*: Array of arguments for the textarea editor. (required) + +**Return Value**: *(array)* - Modified editor arguments array + +**Category**: Form Processing + +**Description**: Allows modification of the arguments passed to the textarea editor (TinyMCE) in form fields. This hook can be used to customize the editor settings, toolbar, or other configuration options. + +## wpuf_taxonomy_checklist_args + +**Type**: Filter + +**Parameters**: +- `$args` *(array)*: Array of arguments for the taxonomy checklist. (required) + +**Return Value**: *(array)* - Modified taxonomy checklist arguments array + +**Category**: Form Processing + +**Description**: Allows modification of the arguments used when rendering taxonomy checklists in forms. This hook can be used to customize how taxonomy terms are displayed and selected. + +## wpuf_styles_to_register + +**Type**: Filter + +**Parameters**: +- `$styles` *(array)*: Array of CSS styles to register. (required) + +**Return Value**: *(array)* - Modified styles array + +**Category**: Utility Hooks + +**Description**: Allows modification of the CSS styles that are registered and enqueued by WPUF. This hook can be used to add, remove, or modify stylesheets. + +## wpuf_scripts_to_register + +**Type**: Filter + +**Parameters**: +- `$scripts` *(array)*: Array of JavaScript scripts to register. (required) + +**Return Value**: *(array)* - Modified scripts array + +**Category**: Utility Hooks + +**Description**: Allows modification of the JavaScript files that are registered and enqueued by WPUF. This hook can be used to add, remove, or modify scripts. + +## retrieve_password_title + +**Type**: Filter + +**Parameters**: +- `$title` *(string)*: The email subject title for password reset. (required) + +**Return Value**: *(string)* - Modified email subject title + +**Category**: User Management + +**Description**: Allows modification of the email subject title sent when a user requests a password reset. This hook is used in the password reset functionality. + +## retrieve_password_message + +**Type**: Filter + +**Parameters**: +- `$message` *(string)*: The email message content for password reset. (required) + +**Return Value**: *(string)* - Modified email message content + +**Category**: User Management + +**Description**: Allows modification of the email message content sent when a user requests a password reset. This hook is used in the password reset functionality. + +## widget_title + +**Type**: Filter + +**Parameters**: +- `$title` *(string)*: The widget title. (required) + +**Return Value**: *(string)* - Modified widget title + +**Category**: Utility Hooks + +**Description**: Allows modification of widget titles displayed in WPUF widgets. This hook can be used to customize how widget titles are displayed. + +## widget_text_content + +**Type**: Filter + +**Parameters**: +- `$content` *(string)*: The widget text content. (required) + +**Return Value**: *(string)* - Modified widget text content + +**Category**: Utility Hooks + +**Description**: Allows modification of widget text content displayed in WPUF widgets. This hook can be used to customize the content of widgets. + +## widget_text + +**Type**: Filter + +**Parameters**: +- `$text` *(string)*: The widget text. (required) + +**Return Value**: *(string)* - Modified widget text + +**Category**: Utility Hooks + +**Description**: Allows modification of widget text displayed in WPUF widgets. This hook can be used to customize the text content of widgets. + +## login_link_separator + +**Type**: Filter + +**Parameters**: +- `$separator` *(string)*: The separator between login links. (required) + +**Return Value**: *(string)* - Modified separator + +**Category**: User Management + +**Description**: Allows modification of the separator used between login links in forms. This hook can be used to customize the visual separation between different login options. + +## wpuf_text_field_option_settings + +**Type**: Filter + +**Parameters**: +- `$settings` *(array)*: Array of text field option settings. (required) + +**Return Value**: *(array)* - Modified text field option settings array + +**Category**: Form Processing + +**Description**: Allows modification of the option settings available for text fields in the form builder. This hook can be used to add, remove, or modify text field configuration options. + +## wpuf_upload_response_image_size + +**Type**: Filter + +**Parameters**: +- `$image_size` *(string)*: The image size for upload responses. (required) + +**Return Value**: *(string)* - Modified image size + +**Category**: Form Processing + +**Description**: Allows modification of the image size used when displaying uploaded images in form responses. This hook can be used to customize how uploaded images are displayed. + +## wpuf_upload_response_image_type + +**Type**: Filter + +**Parameters**: +- `$image_type` *(string)*: The image type for upload responses. (required) +- `$form_id` *(int)*: The form ID. (required) +- `$field_type` *(string)*: The field type. (required) + +**Return Value**: *(string)* - Modified image type + +**Category**: Form Processing + +**Description**: Allows modification of the image type used when displaying uploaded images in form responses. This hook can be used to customize how uploaded images are displayed (e.g., as links or direct images). + +## wpuf_column_field_option_settings + +**Type**: Filter + +**Parameters**: +- `$options` *(array)*: Array of column field option settings. (required) + +**Return Value**: *(array)* - Modified column field option settings array + +**Category**: Form Processing + +**Description**: Allows modification of the option settings available for column fields in the form builder. This hook can be used to add, remove, or modify column field configuration options. + +## wpuf_field_get_js_settings + +**Type**: Filter + +**Parameters**: +- `$settings` *(array)*: Array of JavaScript settings for form fields. (required) + +**Return Value**: *(array)* - Modified JavaScript settings array + +**Category**: Form Processing + +**Description**: Allows modification of the JavaScript settings passed to form fields. This hook can be used to customize the JavaScript behavior and configuration of form fields. + +## wpuf-form-builder-common-taxonomy-fields-properties + +**Type**: Filter + +**Parameters**: +- `$properties` *(array)*: Array of common taxonomy field properties. (required) + +**Return Value**: *(array)* - Modified taxonomy field properties array + +**Category**: Form Processing + +**Description**: Allows modification of the common properties used for taxonomy fields in the form builder. This hook can be used to customize the default properties for taxonomy fields. + +## wpuf-form-builder-common-text-fields-properties + +**Type**: Filter + +**Parameters**: +- `$properties` *(array)*: Array of common text field properties. (required) + +**Return Value**: *(array)* - Modified text field properties array + +**Category**: Form Processing + +**Description**: Allows modification of the common properties used for text fields in the form builder. This hook can be used to customize the default properties for text fields. + +## wpuf_show_post_status + +**Type**: Filter + +**Parameters**: +- `$show` *(bool)*: Whether to show post status. (required) + +**Return Value**: *(bool)* - Modified show post status value + +**Category**: Post Management + +**Description**: Allows modification of whether post status should be displayed. This hook can be used to control the visibility of post status in various contexts. + +## wpuf_get_post_types + +**Type**: Filter + +**Parameters**: +- `$post_types` *(array)*: Array of registered post types. (required) + +**Return Value**: *(array)* - Modified post types array + +**Category**: Post Management + +**Description**: Allows modification of the list of post types available in WPUF. This hook can be used to add, remove, or modify the post types that are available for frontend posting. + +## wpuf_front_post_edit_link + +**Type**: Filter + +**Parameters**: +- `$edit_link` *(string)*: The frontend post edit link. (required) + +**Return Value**: *(string)* - Modified edit link + +**Category**: Post Management + +**Description**: Allows modification of the frontend post edit link. This hook can be used to customize the URL used for editing posts from the frontend. + +## list_cats + +**Type**: Filter + +**Parameters**: +- `$output` *(string)*: The category list output. (required) + +**Return Value**: *(string)* - Modified category list output + +**Category**: Post Management + +**Description**: Allows modification of the category list output. This hook can be used to customize how categories are displayed in lists. + +## the_category + +**Type**: Filter + +**Parameters**: +- `$output` *(string)*: The category output. (required) + +**Return Value**: *(string)* - Modified category output + +**Category**: Post Management + +**Description**: Allows modification of the category output. This hook can be used to customize how categories are displayed. + +## wpuf_allowed_extensions + +**Type**: Filter + +**Parameters**: +- `$extensions` *(array)*: Array of allowed file extensions. (required) + +**Return Value**: *(array)* - Modified extensions array + +**Category**: Form Processing + +**Description**: Allows modification of the allowed file extensions for file uploads. This hook can be used to add, remove, or modify the file types that users can upload through forms. + +## wpuf_use_default_avatar + +**Type**: Filter + +**Parameters**: +- `$use_default` *(bool)*: Whether to use default avatar. (required) + +**Return Value**: *(bool)* - Modified use default avatar value + +**Category**: User Management + +**Description**: Allows modification of whether to use the default avatar. This hook can be used to control when the default avatar should be used instead of a custom user avatar. + +## wpuf_admin_role + +**Type**: Filter + +**Parameters**: +- `$role` *(string)*: The admin role. (required) + +**Return Value**: *(string)* - Modified admin role + +**Category**: Admin Functions + +**Description**: Allows modification of the admin role used for WPUF administrative functions. This hook can be used to customize which user role has administrative privileges. + +## wpuf_custom_field_render + +**Type**: Filter + +**Parameters**: +- `$output` *(string)*: The custom field render output. (required) + +**Return Value**: *(string)* - Modified custom field render output + +**Category**: Form Processing + +**Description**: Allows modification of the custom field render output. This hook can be used to customize how custom fields are rendered in forms. + +## wpuf-get-form-fields + +**Type**: Filter + +**Parameters**: +- `$fields` *(array)*: Array of form fields. (required) + +**Return Value**: *(array)* - Modified form fields array + +**Category**: Form Processing + +**Description**: Allows modification of the form fields available in the form builder. This hook can be used to add, remove, or modify the fields that can be used in forms. + +## wpuf_get_post_form_templates + +**Type**: Filter + +**Parameters**: +- `$templates` *(array)*: Array of post form templates. (required) + +**Return Value**: *(array)* - Modified templates array + +**Category**: Form Processing + +**Description**: Allows modification of the post form templates available in the form builder. This hook can be used to add, remove, or modify the templates that can be used for creating post forms. + +## wpuf_get_pro_form_previews + +**Type**: Filter + +**Parameters**: +- `$previews` *(array)*: Array of pro form previews. (required) + +**Return Value**: *(array)* - Modified previews array + +**Category**: Form Processing + +**Description**: Allows modification of the pro form previews available in the form builder. This hook can be used to add, remove, or modify the preview templates for pro features. + +## wpuf_account_sections + +**Type**: Filter + +**Parameters**: +- `$sections` *(array)*: Array of account sections. (required) + +**Return Value**: *(array)* - Modified account sections array + +**Category**: User Management + +**Description**: Allows modification of the account sections displayed in the user dashboard. This hook can be used to add, remove, or modify the sections shown in the user account area. + +## wpuf_currencies + +**Type**: Filter + +**Parameters**: +- `$currencies` *(array)*: Array of available currencies. (required) + +**Return Value**: *(array)* - Modified currencies array + +**Category**: Payment & Subscriptions + +**Description**: Allows modification of the available currencies for payments. This hook can be used to add, remove, or modify the currencies that are available for payment processing. + +## wpuf_price_format + +**Type**: Filter + +**Parameters**: +- `$format` *(string)*: The price format. (required) + +**Return Value**: *(string)* - Modified price format + +**Category**: Payment & Subscriptions + +**Description**: Allows modification of the price format used for displaying prices. This hook can be used to customize how prices are formatted and displayed. + +## wpuf_raw_price + +**Type**: Filter + +**Parameters**: +- `$price` *(float)*: The raw price value. (required) + +**Return Value**: *(float)* - Modified raw price value + +**Category**: Payment & Subscriptions + +**Description**: Allows modification of the raw price value before formatting. This hook can be used to adjust price values before they are formatted for display. + +## wpuf_formatted_price + +**Type**: Filter + +**Parameters**: +- `$formatted_price` *(string)*: The formatted price string. (required) + +**Return Value**: *(string)* - Modified formatted price string + +**Category**: Payment & Subscriptions + +**Description**: Allows modification of the formatted price string. This hook can be used to customize the final formatted price display. + +## wpuf_price_trim_zeros + +**Type**: Filter + +**Parameters**: +- `$trim` *(bool)*: Whether to trim zeros from prices. (required) + +**Return Value**: *(bool)* - Modified trim zeros value + +**Category**: Payment & Subscriptions + +**Description**: Allows modification of whether to trim trailing zeros from price displays. This hook can be used to control the precision of price formatting. + +## wpuf_format_price + +**Type**: Filter + +**Parameters**: +- `$formatted_price` *(string)*: The formatted price string. (required) + +**Return Value**: *(string)* - Modified formatted price string + +**Category**: Payment & Subscriptions + +**Description**: Allows modification of the final formatted price string. This hook can be used to customize the complete price formatting process. + +## wpuf_email_header + +**Type**: Filter + +**Parameters**: +- `$header` *(string)*: The email header HTML content. (required) +- `$subject` *(string)*: The email subject. (required) + +**Return Value**: *(string)* - Modified email header HTML content + +**Category**: Utility Hooks + +**Description**: Allows modification of the email header HTML content used in WPUF email templates. This hook can be used to customize the header section of emails sent by the plugin, such as notification emails and guest post verification emails. + +## wpuf_email_footer + +**Type**: Filter + +**Parameters**: +- `$footer` *(string)*: The email footer HTML content. (required) + +**Return Value**: *(string)* - Modified email footer HTML content + +**Category**: Utility Hooks + +**Description**: Allows modification of the email footer HTML content used in WPUF email templates. This hook can be used to customize the footer section of emails sent by the plugin, such as notification emails and guest post verification emails. + +## wpuf_email_style + +**Type**: Filter + +**Parameters**: +- `$css` *(string)*: The email CSS styles. (required) + +**Return Value**: *(string)* - Modified email CSS styles + +**Category**: Utility Hooks + +**Description**: Allows modification of the CSS styles used in WPUF email templates. This hook can be used to customize the styling of emails sent by the plugin, such as notification emails and guest post verification emails. + +## wpuf_post_forms_list_table_post_statuses + +**Type**: Filter + +**Parameters**: +- `$post_statuses` *(array)*: Array of post statuses for the forms list table. (required) + +**Return Value**: *(array)* - Modified post statuses array + +**Category**: Admin Functions + +**Description**: Allows modification of the post statuses displayed in the WPUF post forms list table. This hook can be used to add, remove, or modify the status options available in the admin forms listing page. \ No newline at end of file From 2129c43c6ee0df3deef55ac4abafc1f7f100ef10 Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Thu, 17 Jul 2025 00:33:09 +0600 Subject: [PATCH 3/5] cleanup --- .../tools/.cursor/rules/hooks-doc.mdc | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc diff --git a/wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc b/wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc deleted file mode 100644 index 5413bc119..000000000 --- a/wp-user-frontend-hooks-docs/tools/.cursor/rules/hooks-doc.mdc +++ /dev/null @@ -1,31 +0,0 @@ ---- -alwaysApply: true ---- -{ - "name": "Document WP Hook to Markdown", - "description": "Generate documentation for a WordPress hook and append it to the appropriate Markdown file in /docs/hooks/", - "scope": "code", - "body": [ - "You are documenting a WordPress hook found in this code. Read the code context and extract the following:", - "- Hook type: Action or Filter", - "- Hook name", - "- Parameters (names, types, descriptions — infer from usage if not explicitly documented)", - "- Optional: @since if available or known from comments/context", - "- Short description (based on what this hook does in the plugin)", - "", - "Generate a Markdown block in the following format:", - "", - "## {hook_name}", - "", - "**Type**: {Action|Filter} ", - "**Parameters**:", - "{List parameters like}", - "- `$param` *(type)*: Description", - "", - "{If since is known}", - "**Since**: x.x.x ", - "**Description**: {What the hook does}", - "", - "Append this block to either `/docs/hooks/actions.md` or `/docs/hooks/filters.md` based on the hook type. Do not modify the source code." - ] -} From a1833d47fe9ea2380e1c236f943bfa2642919c5c Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Thu, 17 Jul 2025 09:19:32 +0600 Subject: [PATCH 4/5] cleanup --- .cursor/rules/development-guideline.mdc | 50 ------------------------- .cursor/rules/document-hooks.mdc | 39 ------------------- docs/hooks/README.MD | 0 docs/hooks/{HOOKLIST.MD => list.md} | 0 4 files changed, 89 deletions(-) delete mode 100644 .cursor/rules/development-guideline.mdc delete mode 100644 .cursor/rules/document-hooks.mdc delete mode 100644 docs/hooks/README.MD rename docs/hooks/{HOOKLIST.MD => list.md} (100%) diff --git a/.cursor/rules/development-guideline.mdc b/.cursor/rules/development-guideline.mdc deleted file mode 100644 index 76ffdd1e2..000000000 --- a/.cursor/rules/development-guideline.mdc +++ /dev/null @@ -1,50 +0,0 @@ - -You are an expert in WordPress, PHP, and related web development technologies. - -Core Principles -- Our current task is to document each hooks we created in our wp-user-frontend project -- This hook documentation aimed for both external plugin developers, and our internal team -- In docs/hooks/HOOKLIST.MD, we will create a table of all the hooks we created in our wp-user-frontend project. - the column name will be: hook, type(action/filter), documented. the documented field will be `No` initially for all hooks - -## Hook Discovery Process -- Use regex patterns to find all hooks: - - Actions: `do_action\('([^']+)'` - - Filters: `apply_filters\('([^']+)'` -- Scan all PHP files in the project -- Create initial hooklist with basic information - -## Documentation Process -- We will go through the Hooklist one by one and document them. - - If this is a filter hook, we will append the documentation in `/docs/hooks/filters.md` using the standard Markdown format - - If this is a action hook, we will append the documentation in `/docs/hooks/actions.md` using the standard Markdown format - -## Documentation Template -``` -## wpuf_after_post_insert - -**Type**: Action - -**Parameters**: -- `$post_id` *(int)*: ID of the post. (required) -- `$form_data` *(array)*: Submitted form data. (required) - -**Return Value**: (for filters only) - Description of what should be returned - -**Since**: 3.7.0 (only when version information is available) - -**Category**: Form Processing/User Management/Payment/etc. (when possible to categorize) - -**Description**: Fires after a post is inserted via the frontend. -``` - -## Categorization System -- Form Processing -- User Management -- Payment & Subscriptions -- Post Management -- Admin Functions -- Integration Hooks -- Utility Hooks - -- After documenting an action or filter hook, we will mark the `documented` column to `Yes` in docs/hooks/HOOKLIST.MD diff --git a/.cursor/rules/document-hooks.mdc b/.cursor/rules/document-hooks.mdc deleted file mode 100644 index dfc895f4b..000000000 --- a/.cursor/rules/document-hooks.mdc +++ /dev/null @@ -1,39 +0,0 @@ ---- -alwaysApply: false ---- -[ - { - "name": "Discover WordPress Action Hooks", - "description": "Detect all 'do_action' hooks and log them for documentation.", - "trigger": "code", - "pattern": "do_action\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", - "comment": "Action Hook '{{1}}' found. Document this in /docs/hooks/actions.md using the standard Markdown format.", - "actions": [] - }, - { - "name": "Discover WordPress Filter Hooks", - "description": "Detect all 'apply_filters' hooks and log them for documentation.", - "trigger": "code", - "pattern": "apply_filters\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", - "comment": "Filter Hook '{{1}}' found. Document this in /docs/hooks/filters.md using the standard Markdown format.", - "actions": [] - } -] -[ - { - "name": "Discover WordPress Action Hooks", - "description": "Detect all 'do_action' hooks and log them for documentation.", - "trigger": "code", - "pattern": "do_action\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", - "comment": "Action Hook '{{1}}' found. Document this in /docs/hooks/actions.md using the standard Markdown format.", - "actions": [] - }, - { - "name": "Discover WordPress Filter Hooks", - "description": "Detect all 'apply_filters' hooks and log them for documentation.", - "trigger": "code", - "pattern": "apply_filters\\(\\s*['\"]([^'\"]+)['\"](.*?)\\);?", - "comment": "Filter Hook '{{1}}' found. Document this in /docs/hooks/filters.md using the standard Markdown format.", - "actions": [] - } -] diff --git a/docs/hooks/README.MD b/docs/hooks/README.MD deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/hooks/HOOKLIST.MD b/docs/hooks/list.md similarity index 100% rename from docs/hooks/HOOKLIST.MD rename to docs/hooks/list.md From f79006a09a3bd85d8d625f6274ef79f5bf4a6ed5 Mon Sep 17 00:00:00 2001 From: Sapayth Hossain Date: Thu, 17 Jul 2025 10:35:13 +0600 Subject: [PATCH 5/5] Update list.md --- docs/hooks/list.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/hooks/list.md b/docs/hooks/list.md index 63e301e92..8cc34521e 100644 --- a/docs/hooks/list.md +++ b/docs/hooks/list.md @@ -155,5 +155,3 @@ This document contains all the hooks (actions and filters) created in the WP Use - This list was generated by scanning all PHP files in the wp-user-frontend project - Action hooks are triggered using `do_action()` - Filter hooks are triggered using `apply_filters()` -- All hooks are marked as "No" in the documented column initially -- As each hook is documented, the status should be updated to "Yes"