WordPress Actions

Actions let you print markup at fixed points of the gallery output, or react to what the plugin does. Every action name is prefixed vpf_. Hook them with add_action and declare the number of arguments you use.

add_action( 'vpf_before_each_item', function ( $args ) {
    echo '<span class="my-badge">New</span>';
}, 10, 1 );
ActionArguments
vpf_before_get_output$options
vpf_after_get_output$options, $style_options
vpf_before_wrapper_start, vpf_after_wrapper_start, vpf_before_wrapper_end, vpf_after_wrapper_end$options, $style_options
vpf_before_items_wrapper_start, vpf_after_items_wrapper_start, vpf_before_items_wrapper_end, vpf_after_items_wrapper_end$options, $style_options
vpf_layout_elements$options, $element, $position
vpf_before_each_item, vpf_each_item_start, vpf_each_item_end, vpf_after_each_item$args
vpf_each_item_inline_meta$args
vpf_each_item_meta_author_before and vpf_each_item_meta_author_after, and the same pair for _categories_, _comments_, _date_, _reading_time_ and _views_$args

Controls

ActionArguments
vpf_before_register_controls, vpf_after_register_controlsnone
vpf_registered_control$name, $args

Assets

ActionArguments
vpf_before_assets_register, vpf_after_assets_registernone
vpf_before_assets_enqueue, vpf_after_assets_enqueue$options

Other

ActionArguments
vpf_parse_blocks$blocks, $location, $is_reusable, $is_inner_blocks
vpf_preview_template, vpf_before_preview_output, vpf_after_preview_outputnone

Pro

ActionWhere
vpf_before_ajax_block_render_output, vpf_after_ajax_block_render_outputAJAX cache page
vpf_social_sync_completed, vpf_social_sync_error, vpf_social_item_creation_failed, vpf_social_item_queue_complete, vpf_social_existing_item_synced, vpf_social_media_error, vpf_social_storage_error, vpf_social_sanitize_settingsSocial feeds
Was this page helpful?