Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Filter Hooks

Thorsten Frommen edited this page Jul 1, 2015 · 3 revisions

Below you can find all currently available, not deprecated filter hooks, in alphabetical order.

mlp_allowed_post_types

Filter the allowed post types.

Parameters:

  • string[] $allowed_post_types Allowed post type names.
  • Mlp_Translation_Metabox $meta_box Translation meta box object.

Return: string[]

mlp_dashboard_widget_access

Filter the capability required to view the dashboard widget.

Parameters:

  • string $capability Capability required to view the dashboard widget.

Return: string

mlp_default_search_engine_visibility

Filter the default value for the search engine visibility when adding a new site.

Parameters:

  • bool $visible Should the new site be visible by default?

Return: bool

mlp_do_redirect

Filter whether the user should be redirected.

Parameters:

  • bool $do_redirect Redirect or not?

Return: bool

mlp_dont_show_module_{$slug}

Filter the visibility of the module in the features table.

Parameters:

  • bool $invisible Should the module be hidden?

Return: bool

mlp_external_save_method

Filter whether to use an external save method instead of the built-in method.

Parameters:

  • bool $external_save_method Use an external save method?

Return: bool

mlp_get_translations_arguments

Filter the translation arguments.

Parameters:

  • array $arguments Translation arguments.

Return: array

mlp_hreflang_html

Filter the output of the hreflang links in the HTML head.

Parameters:

  • string $html Markup generated by MultilingualPress.
  • string $language Language code (e.g., 'en-US').
  • string $url Target URL.

Return: string

mlp_hreflang_http_header

Filter the output of the hreflang links in the HTTP header.

Parameters:

  • string $header Header generated by MultilingualPress.
  • string $language Language code (e.g., 'en-US').
  • string $url Target URL.

Return: string

mlp_language_api

Get the Language API object.

Parameters:

  • Mlp_Language_Api_Interface $language_api Language API object.

Return: Mlp_Language_Api_Interface

mlp_linked_element_link

Filter the remote URL of the linked element.

Parameters:

  • string $remote_url URL of the remote post.
  • int $target_site_id ID of the target site.
  • int $target_content_id ID of the target post.
  • Mlp_Translation_Interface $translation Translation object. NULL, if there is no translation.

Return: string

mlp_mutually_exclusive_taxonomies

Filter mutually exclusive taxonomies.

Parameters:

  • string[] $taxonomies Mutually exclusive taxonomy names.

Return: string[]

mlp_post_translator_activation_checkbox

Filter the post translator activation checkbox callback.

Parameters:

  • array|string $callback Callback name or class-method array.

Return: array|string

mlp_pre_insert_post

Filter the post data before saving the post.

Parameters:

  • array $post_data Post data.
  • array $save_context Context of the to-be-saved post.

Return: array

mlp_pre_insert_post_meta

Filter post meta data before saving.

Parameters:

  • array $post_meta Post meta data.
  • array $save_context Context of the to-be-saved post.

Return: array

mlp_pre_save_post

Filter the post data before saving the post.

Parameters:

  • array $post_data Post data.
  • array $save_context Context of the to-be-saved post.

Return: array

mlp_pre_save_post_meta

Filter the to-be-synchronized post meta fields.

Parameters:

  • array $post_meta Post meta fields.
  • array $save_context Context of the to-be-saved post.

Return: array

mlp_quicklinks_html

Filter the quicklinks HTML.

Parameters:

  • string $html HTML output.
  • string $type Quicklinks type, 'links' or 'form'.
  • array $$translated Array of translated posts.
  • string $selections Selections, 'option' or 'a' elements.
  • string $position Quicklinks position.

Return: string

mlp_redirect_url

Filter the redirect URL. You might add support for other types than singular posts and home here. If you return an empty string, the redirect will not happen. The result will be validated with esc_url().

Parameters:

  • string $url Redirect URL.
  • array $match Redirect match.
    • int $priority Language priority.
    • string $url Remote URL.
    • string $language Language name.
    • int $site_id Remote blog ID.
  • int $current_blog_id Current blog ID.

Return: string

mlp_show_translation_completed_checkbox

Filter the visibility of the 'Translation completed' checkbox.

Parameters:

  • bool $show_checkbox Show the checkbox?
  • array $context Post context.
    • int $post_id Post ID.
    • bool $is_translated Is the post translated?

Return: bool

mlp_tables_to_duplicate

Filter the to-be-duplicated tables.

Parameters:

  • string[] $tables Table names.
  • int[] $context Duplication context.
    • int $source_blog_id Source blog ID.
    • int $new_blog_id Target blog ID.

Return: string[]

mlp_translate_this_post_checkbox

Filter the default value of the 'Translate this post' checkbox.

Parameters:

  • bool $translate Should 'Translate this post' be checked by default?

Return: bool

mlp_translation_meta_box_view_callbacks

Filter the meta box view callbacks.

Parameters:

  • array $callbacks Array of callback names or class-method arrays.
  • WP_Post $post Post object.
  • int $blog_id Blog ID.

Return: array

mlp_translations

Filter the translations before they are used.

Parameters:

  • array $translations Translations.
  • array $arguments Translation arguments.

Return: array