Contents

Hooks reference - Plugixa FAQ

Everything below is in the free build. Prefix is plugixa_faq_ throughout.

Lifecycle

Hook Type Fires
plugixa_faq_loaded action After the plugin’s files are loaded
plugixa_faq_init action After the plugin initialises
plugixa_faq_activated action On activation, after tables are created
plugixa_faq_deactivated action On deactivation
plugixa_faq_enqueue_scripts action When front-end assets are enqueued
plugixa_faq_admin_submenus action Where a submenu can be registered

Answers

Hook Type Fires
plugixa_faq_before_create_faq action Before an answer is inserted
plugixa_faq_after_create_faq action After insert, with the new id
plugixa_faq_before_update_faq action Before an update, with the id and data
plugixa_faq_after_update_faq action After an update
plugixa_faq_before_delete_faq action Before a delete
plugixa_faq_after_delete_faq action After a delete
plugixa_faq_before_bulk_delete_faqs action Before a bulk delete, with the ids
plugixa_faq_after_bulk_delete_faqs action After a bulk delete
plugixa_faq_after_reorder_faqs action After a drag-and-drop reorder
plugixa_faq_faq_data filter The data array, before validation and save

Categories

plugixa_faq_before_create_category, _after_create_category, _before_update_category, _after_update_category, _before_delete_category, _after_delete_category and _after_reorder_categories mirror the answer actions. plugixa_faq_category_data is the equivalent filter.

Rendering

Hook Type Changes
plugixa_faq_shortcode_atts filter The attributes, after defaults are merged
plugixa_faq_shortcode_output filter The finished HTML
plugixa_faq_render_item filter One answer’s markup, before output
plugixa_faq_rendered_faq_item filter One answer’s markup, after output
plugixa_faq_css_vars filter The scoped custom properties
plugixa_faq_before_render action Before a placement renders
plugixa_faq_after_render action After it renders

Templates

Hook Type Changes
plugixa_faq_template_path filter Which file is loaded
plugixa_faq_template_vars filter The variables passed to it
plugixa_faq_before_template action Before a template renders
plugixa_faq_after_template action After it renders

Templates can also be overridden without a hook: copy a file from the plugin’s templates/frontend/ into your-theme/plugixa-faq/ and yours is used.

Registration seams

These are how the premium build adds features, and how yours can.

Filter Extends
plugixa_faq_available_layouts The list of layouts
plugixa_faq_layout_config One layout’s configuration
plugixa_faq_layout_prepare_items How a layout groups or orders its items
plugixa_faq_layout_allows_grouping Whether a layout supports category grouping
plugixa_faq_content_source_enum The list of content sources
plugixa_faq_content_source How a source fetches its items
plugixa_faq_source_categories The categories a source offers
plugixa_faq_view_config_settings The settings a view carries

Adding a layout is the clearest example:

add_filter( 'plugixa_faq_available_layouts', function ( array $layouts ) {
    $layouts[] = 'cards';
    return $layouts;
} );

Then supply faq-item-cards.php in your theme’s plugixa-faq/ folder.

Settings, submission and integrations

Hook Type Changes
plugixa_faq_settings_defaults filter The default settings array
plugixa_faq_sanitize_settings filter Sanitisation of saved settings
plugixa_faq_validate_settings filter Validation errors
plugixa_faq_before_save_settings action Before settings are written
plugixa_faq_after_save_settings action After they are written
plugixa_faq_submission_permission filter Who may submit a question
plugixa_faq_trusted_proxy_headers filter Which headers carry the real client IP
plugixa_faq_localize_script_data filter The data passed to the front-end script
plugixa_faq_elementor_widget_controls action Extra controls on the Elementor widget

Feedback (_before_save_feedback, _after_save_feedback, _before_delete_feedback, _after_delete_feedback), the AI generator (_before_ai_generate, _after_ai_generate) and the WooCommerce product tab (_product_tab_title, _product_tab_priority, _product_tab_content) fire only when those premium features are present.

What to do next

The REST API for reading and writing from outside PHP.

Quick Links