Actions and Filters

Michael Sisk edited this page Mar 18, 2013 · 14 revisions
Clone this wiki locally

The WordPress Plugin API is built around a vast array of action and filter hooks that allow plugin authors the flexibility to modify how WordPres works without having to hack it apart. They're very powerful, and Webcomic provides a plethora of action and filter hooks that can be used to modify various aspects of the plugin. This page describes the various actions and filters Webcomic provides; for information on actually hooking into an action or filter, please see the WordPress Codex.

Actions

Action hooks execute code at specific points during execution, or when specific events occur.

webcomic_transcript_form_before

Triggered before webcomic transcript form output begins.

webcomic_transcript_form_must_log_in_after

Triggered if users must be registered and logged in to transcribe and the current user is not logged in.

webcomic_transcript_form_top

Triggered just after the opening <form> tag.

webcomic_transcript_form_logged_in_after

Triggered if the current user is registered and logged in.

webcomic_transcript_form_before_fields

Triggered just before form field output begins.

webcomic_transcript_form_after_fields

Triggered just after form field output ends.

webcomic_transcript_form

Triggered just before the closing <form> tag.

webcomic_transcript_form_after

Triggered after webcomic transcript form output has ended.

webcomic_transcript_form_closed

Triggered if transcription is closed.

webcomic_ipn

Triggered prior to processing a Paypal IPN request.

webcomic_transcript_submit

Triggered prior to processing a user-submitted transcript.

webcomic_transcript_submitted

Triggered after processing a user-submitted transcript.

webcomic_loop_end

Triggered during integration just before Webcomic content is appended to the end of a WordPress loop.

webcomic_loop_start

Triggered during integration just before Webcomic content is prepended to the start of a WordPress loop.

Filters

Filter hooks modify text and other values Webcomic uses, such as template tag output. Some filters appear multiple times because they are used in multiple locations. Filters should always return a value of the type specified in the following descriptions.

string webcomic_verify_age_inline

Filters the output of the verify_webcomic_age shortcode. Defaults to a generic age verification message.

string webcomic_verify_role_inline

Filters the output of the verify_webcomic_role shortcode. Defaults to a generic role verification message.

string the_webcomic

Filters the output of the_webcomic.

integer webcomic_count

Filters the webcomic-recognized attachment count returned by webcomic_count.

array get_related_webcomics

Filters the webcomics returned by get_related_webcomics and used by the_related_webcomics.

string get_{$relative}_webcomic_join

Filters the JOIN portion of the MySQL query used to retrieve relative webcomics, one of next, previous, first, last, or random.

string get_{$relative}_webcomic_where

Filters the WHERE portion of the MySQL query used to retrieve relative webcomics, one of next, previous, first, last, or random.

string get_{$relative}_webcomic_sort

Filters the SORT portion of the MySQL query used to retrieve relative webcomics, one of next, previous, first, last, or random.

string get_{$relative}_webcomic_link

Filters the relative webcomic URL returned by get_relative_webcomic_link and used by previous_webcomic_link, next_webcomic_link, first_webcomic_link, last_webcomic_link, and random_webcomic_link.

string {$relative}_webcomic_link

Filters the output of the relative webcomic link template tags: previous_webcomic_link, next_webcomic_link, first_webcomic_link, last_webcomic_link, and random_webcomic_link.

string get_purchase_webcomic_link

Filters the URL returned by get_purchase_webcomic_link and used by purchase_webcomic_link.

string purchase_webcomic_link

Filters the output of purchase_webcomic_link.

string webcomic_collection_links

Filters the array of collection links generated by get_the_webcomic_collection_list and used by the_webcomic_collections.

string the_webcomic_collection_list

Filters the output of get_the_webcomic_collection_list used by the_webcomic_collections.

string webcomic_term_links-webcomic\d+_{$taxonomy}

Deprecated (will be removed in Webcomic 4.1). Use the more generic webcomic_term_links filter.

string webcomic_term_links

Filters the array of term links generated by get_the_webcomic_term_list and used by the_webcomic_storylines and the_webcomic_characters.

string the_webcomic_term_list

Filters the output of get_the_webcomic_term_list used by the_webcomic_storylines and the_webcomic_characters.

string get_{$relative}_webcomic_term_link

Filters the URL returned by get_relative_webcomic_term_link and used by previous_webcomic_storyline_link, next_webcomic_storyline_link, first_webcomic_storyline_link, last_webcomic_storyline_link, random_webcomic_storyline_link, previous_webcomic_character_link, next_webcomic_character_link, first_webcomic_character_link, last_webcomic_character_link, random_webcomic_character_link.

string {$relative}_webcomic_term_link

Filters the output of the relative webcomic term link template tags: previous_webcomic_storyline_link, next_webcomic_storyline_link, first_webcomic_storyline_link, last_webcomic_storyline_link, random_webcomic_storyline_link, previous_webcomic_character_link, next_webcomic_character_link, first_webcomic_character_link, last_webcomic_character_link, random_webcomic_character_link.

string webcomic_term_title

Filters the term title returned by webcomic_term_title and used by webcomic_storyline_title and webcomic_character_title.

string webcomic_term_description

Filters the term description returned by webcomic_term_description and used by webcomic_storyline_description and webcomic_character_description.

string webcomic_term_image

Filters the term image returned by webcomic_term_image and used by webcomic_storyline_cover and webcomic_character_avatar.

get_webcomic_term_crossover_link Filters

the URL returned by get_webcomic_term_crossover_link.

string webcomic_term_crossover_links

Filters the array of collection links generated by webcomic_term_crossovers and used by webcomic_storyline_crossovers and webcomic_character_crossovers.

string webcomic_term_crossovers

Filters the output of webcomic_term_crossovers used by webcomic_storyline_crossovers and webcomic_character_crossovers.

string webcomic_crossover_title

Filters the output of webcomic_crossover_title.

string webcomic_crossover_description

Filters the output of webcomic_crossover_description.

string webcomic_crossover_image

Filters the the image returned by webcomic_crossover_image and used by webcomic_crossover_poster.

string webcomic_collection_title

Filters the output of webcomic_collection_title.

string webcomic_collection_description

Filters the output of webcomic_collection_description.

string webcomic_collection_image

Filters the the image returned by webcomic_collection_image and used by webcomic_collection_poster.

string webcomic_collection_print_amount

Filters the output of webcomic_collection_print_amount.

string webcomic_collection_crossover_links

Filters the array of collection links generated by webcomic_collection_crossovers.

string webcomic_collection_crossovers

Filters the output of webcomic_collection_crossovers.

string webcomic_donation_amount

Filters the output of webcomic_donation_amount.

string webcomic_donation_fields

Filters the output of webcomic_donation_fields.

string webcomic_donation_form

Filters the output of webcomic_donation_form.

string webcomic_print_amount

Filters the output of webcomic_print_amount.

string webcomic_print_adjustment

Filters the output of webcomic_print_adjustment.

string webcomic_print_fields

Filters the output of webcomic_print_fields.

string webcomic_print_form

Filters the output of webcomic_print_form.

string get_webcomic_transcripts_link

Filters the URL returned by get_webcomic_transcripts_link and used by webcomic_transcripts_link.

string webcomic_transcripts_link

Filters the output of webcomic_transcripts_link.

array get_webcomic_transcripts

Filters the array of transcripts returned by get_webcomic_transcripts.

string the_webcomic_transcript_authors

Filters the author list returned by get_webcomic_transcript_authors and used by the_webcomic_transcript_authors.

string the_webcomic_transcript_term_list

Filters the output of get_the_webcomic_transcript_term_list used by the_webcomic_transcript_languages.

string webcomic_transcript_fields

Filters the output of webcomic_transcript_fields.

array webcomic_transcript_form_defaults

Filters the array of default arguments used by webcomic_transcript_form.

array webcomic_transcript_form_default_fields

Filters the array of default fields used by webcomic_transcript_form.

string webcomic_transcript_form_logged_in

Filters the message displayed by webcomic_transcript_form for logged in users.

string webcomic_transcript_form_field_{$field}

Filters the individual fields from the $fields argument used by webcomic_transcript_form.

string webcomic_transcript_form_field_language

Filters the webcomic transcript language field used by webcomic_transcript_form.

string webcomic_transcript_form_field_transcript

Filters the non-wysiwyg <textarea> field used by webcomic_transcript_form.

string webcomic_transcript_form_field_submit

Filters the submit button used by webcomic_transcript_form.

string webcomic_dropdown_transcript_terms

Filters the HTML returned by webcomic_dropdown_transcript_terms and used by webcomic_dropdown_transcript_languages.

string webcomic_list_transcript_terms

Filters the HTML returned by webcomic_list_transcript_terms and used by webcomic_list_transcript_languages.

string webcomic_dropdown_terms

Filters the HTML returned by webcomic_list_transcript_terms and used by webcomic_dropdown_storylines and webcomic_dropdown_characters.

string webcomic_collection_dropdown_title

Filters the collection titles used by webcomic_dropdown_collections.

string webcomic_dropdown_collections

Filters the output of webcomic_dropdown_collections.

string collection_dropdown_webcomic_title

Filters the webcomic titles used by webcomic_dropdown_collections.

string webcomic_list_terms

Filters the HTML returned by webcomic_list_terms and used by webcomic_list_storylines and webcomic_list_characters.

string webcomic_collection_list_title

Filters the collection titles used by webcomic_list_collections.

string webcomic_list_collections

Filters the output of webcomic_list_collections.

string collection_list_webcomic_title

Filters the webcomic titles used by webcomic_list_collections.

string webcomic_term_cloud

Filters the HTML returned by webcomic_term_cloud and used by webcomic_storyline_cloud and webcomic_character_cloud.

string webcomic_collection_cloud

Filters the output of webcomic_collection_cloud.

string webcomic_term_dropdown_title

Filters the term titles used by webcomic_dropdown_storylines and webcomic_dropdown_characters.

string term_dropdown_webcomic_title

Fitlers the webcomic titles used by webcomic_dropdown_storylines and webcomic_dropdown_characters.

string webcomic_term_list_title

Filters the term titles used by webcomic_list_storylines and webcomic_list_characters.

string webcomic_term_image

Filters the term images used by webcomic_list_storylines and webcomic_list_characters.

string webcomic_term_description

Filters the term titles used by webcomic_dropdown_transcript_languages.

string term_list_webcomic_title

Fitlers the webcomic titles used by webcomic_list_storylines and webcomic_list_characters.

string webcomic_transcript_term_dropdown_title

Filters the term titles used by webcomic_dropdown_transcript_languages.

string webcomic_transcript_term_list_title

Filters the term titles used by webcomic_list_transcript_languages.

integer webcomic_upload_size_limit

Filters the maximum allowed upload size for cover and avatar uploads. Defaults to the value returned by wp_max_upload_size.

integer webcomic_upload_size_limit

Filters the maximum allowed upload size for cover and avatar uploads. Defaults to the value returned by wp_max_upload_size.

array webcomic_opengraph

Filters the Open Graph data Webcomic adds to all Webcomic-related pages.

string webcomic_tweet

Filters the tweet text pushed to Twitter whenever a webcomic is published. Defaults to the collection-specific tweet format.

string webcomic_integrate_sort

Filters the sort order of webcomics on post type and taxonomy archive pages.