prepare_items(); ?>


%1$s

', sprintf( /* translators: %s: Link to settings. */ \esc_html__( 'The hooks capture module is disabled. To enable it go to: %s', '0-day-analytics' ), '' . \esc_html__( 'settings', '0-day-analytics' ) . '' ) ); ?>

', \esc_attr( $page ) ); printf( '', \esc_attr( $paged ) ); echo '
'; $hooks_management->search_box( \__( 'Search', '0-day-analytics' ), 'hooks-management-find' ); echo '
'; $hooks_management->display(); ?>




' . \esc_html__( 'this page', '0-day-analytics' ) . '' ); ?>

'', 'type' => 'string', 'extraction_code' => '', ), ); } foreach ( $parameters as $index => $param ) { ?>

$param_name, 'type' => $param_type, 'extraction_code' => $param_extraction_code, ); } } } if ( empty( $hook_name ) ) { \wp_die( \esc_html__( 'Hook name is required.', '0-day-analytics' ) ); } $data = array( 'hook_name' => $hook_name, 'hook_label' => $hook_label, 'hook_type' => $hook_type, 'priority' => $priority, 'category' => $category, 'group_id' => $group_id, 'enabled' => $enabled, 'capture_args' => $capture_args, 'capture_output' => $capture_output, 'description' => $description, 'hook_parameters' => ! empty( $hook_parameters ) ? \wp_json_encode( $hook_parameters ) : '', 'date_modified' => \microtime( true ), ); if ( $id ) { // Update existing hook. Hooks_Management_Entity::update( $id, $data ); } else { // Insert new hook. $data['date_added'] = \microtime( true ); Hooks_Management_Entity::insert( $data ); } Hooks_Management_Entity::clear_hook_labels_cache(); // Clear cache and reload hooks. Hooks_Capture::clear_cache(); \do_action( 'advan_hooks_management_updated' ); \wp_safe_redirect( \add_query_arg( array( 'page' => Hooks_Management_List::HOOKS_MANAGEMENT_MENU_SLUG, 'saved' => 1, ), \admin_url( 'admin.php' ) ) ); exit; } /** * Toggle hook enabled status. * * @return void * * @since 4.5.0 */ public static function toggle_hook() { if ( ! \current_user_can( 'manage_options' ) ) { \wp_die( \esc_html__( 'You do not have permission to manage hooks.', '0-day-analytics' ) ); } $id = isset( $_REQUEST['id'] ) ? \absint( $_REQUEST['id'] ) : 0; if ( ! \wp_verify_nonce( isset( $_REQUEST['_wpnonce'] ) ? $_REQUEST['_wpnonce'] : '', 'toggle_hook_' . $id ) ) { \wp_die( \esc_html__( 'Security check failed.', '0-day-analytics' ) ); } if ( $id ) { Hooks_Management_Entity::toggle_enabled( $id ); Hooks_Capture::clear_cache(); \do_action( 'advan_hooks_management_updated' ); } \wp_safe_redirect( \wp_get_referer() ); exit; } /** * Delete hook. * * @return void * * @since 4.5.0 */ private static function delete_hook() { if ( ! \current_user_can( 'manage_options' ) ) { \wp_die( \esc_html__( 'You do not have permission to manage hooks.', '0-day-analytics' ) ); } $id = isset( $_REQUEST['id'] ) ? \absint( $_REQUEST['id'] ) : 0; if ( ! \wp_verify_nonce( isset( $_REQUEST['_wpnonce'] ) ? $_REQUEST['_wpnonce'] : '', 'delete_hook_' . $id ) ) { \wp_die( \esc_html__( 'Security check failed.', '0-day-analytics' ) ); } if ( $id ) { Hooks_Management_Entity::delete_by_id( $id ); Hooks_Capture::clear_cache(); \do_action( 'advan_hooks_management_updated' ); } \wp_safe_redirect( \add_query_arg( array( 'page' => Hooks_Management_List::HOOKS_MANAGEMENT_MENU_SLUG, 'deleted' => 1, ), \admin_url( 'admin.php' ) ) ); exit; } } }