Docs /

Templating functions & developer hooks

Shortcodes, template tags and the filters and actions developers can use to customise where and how VideographyWP renders video.

Shortcodes

  • [cvwp_video_position] — place this in the post content to mark exactly where the video should render.
  • [cvwp_video_button text="Play video"] — output a button that opens the attached video.

Useful filters

  • cvwp-gallery-video-output — filter the HTML of the video added to the WooCommerce gallery.
  • cvwp_disabled_video_positions — remove gallery positions from the settings.
  • cvwp_enqueue_woo_compatibility_script — enable or disable the WooCommerce gallery compatibility script.
  • cvwp_allow_video_embed — decide, in code, whether a given video should embed.
  • cvwp_video_embed_html — filter the final embed HTML.
  • cvwp_embed_css_class — add CSS classes to the embed wrapper.
  • cvwp-add-video-source — register a custom video provider beyond YouTube/Vimeo/Dailymotion.

Useful actions

  • cvwp_save_post_options — fires when a post’s video options are saved.
  • cvwp-remote-image-processed — fires after a remote thumbnail has been imported.
  • cvwp_video_settings_metabox — add your own fields to the video settings box.

Example

Render the video wherever you like in a template by dropping the position shortcode into the content, or add classes to every embed:

add_filter( 'cvwp_embed_css_class', function ( $classes ) {
    $classes[] = 'my-theme-video';
    return $classes;
} );

Full details live in the plugin developer documentation.

Related