# plugin wordpress hooks

updated (2024-02-23) for version 0.9.0

This plugin uses a large amount of wordpress hooks to inject code att various places in the wordpress flow.

In general the plugin first setups the hooks att plugin initiation in accordance with settings and request data, 
Then the hooks locks down items on the webb page during wp and wp theme execution.

This documentation describes the hooks in order of execution and what they do.

## hooks in order of executed

### In standard flow of execution

plugins_loaded : load_plugins_textdomain
add the plugin textdomain

init : handle_requests_redirects
process the request for the plugin and handels the login/logout process

template_include : Template_Redirect_Lock::redirect_page_if_locked
Replaces the entire page with a template if the page is locked

### On executing the theme (this order is theme deppendant this is the expected order):

#### pre loop
wp_enqueue_scripts : enqueue_scripts
enqueues plugin scripts

script_loader_tag : add_script_type
admin_bar_menu: logger
loop_start : Loops::loop_start

#### in loop
the_post : add_read_more_element
the_posts : Loops_lock::filter_the_posts
the_posts : Single_Post_lock::filter_the_posts
the_title : replace_title_if_locked

#### on specific elements
home_url : add_cookies_not_allowed_query_arg
post_link : add_cookies_not_allowed_query_arg
page_link : add_cookies_not_allowed_query_arg
attachment_link : add_cookies_not_allowed_query_arg
post_type_link : add_cookies_not_allowed_query_arg

### only in admin:
admin_menu : admin_menu
admin_init : admin_init
admin_notices : admin_notices
plugin_action_links_$EXODOX_PLUGIN_PATH : plugin_action_links

### only in rest:
rest_api_init : exodox_rest_api_init
rest_authentication_errors : handle_open_rest_authentication

### only in content feed:
the_content_feed : Feeds::hide_content_in_feed

### on redirect:
allowed_redirect_hosts : add_exodox_host

### on logout:
wp_logout : exodox_clear_cookies

Hooks involved in the templates are not included in this document, but you can assume all template hooks will be triggered when the template is printed

