{"id":481,"date":"2023-02-28T20:54:28","date_gmt":"2023-02-28T20:54:28","guid":{"rendered":"http:\/\/msls.co\/?page_id=481"},"modified":"2025-09-13T09:56:31","modified_gmt":"2025-09-13T09:56:31","slug":"hook-reference","status":"publish","type":"page","link":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/","title":{"rendered":"Hook Referenze"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The&nbsp;<strong>Multisite Language Switcher<\/strong>&nbsp;provides some filters and actions,&nbsp;which are very useful for programmers who want to interact with the plugin from their functions and classes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>And again: Always back up your files and database prior to working on your site, better safe than sorry.<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>Read first the&nbsp;<a href=\"https:\/\/codex.wordpress.org\/Plugin_API#Hooks.2C_Actions_and_Filters\">introduction<\/a>&nbsp;provided by the WordPress community if you don&#8217;t know what hooks are.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">msls_admin_icon_get_edit_new<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to change the link of the admin icon in case there is no object connected then this filter is for you.&nbsp;The default is that the link points to the&nbsp;&#8218;create new page&#8216;&nbsp;of this object type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $path\n * @return string\n *\/\nfunction my_msls_admin_icon_get_edit_new( $path ) {\n    return add_query_arg( array( 'abc' =&gt; 'xyz' ), $path );\n}\nadd_filter( 'msls_admin_icon_get_edit_new', 'my_msls_admin_icon_get_edit_new' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would add the parameter &#8218;abc&#8216; with the value &#8218;xyz&#8216; to the url path.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_admin_advanced_section<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add input fields to the advanced section of the plugin settings&nbsp;(<a href=\"#msls-admin-main-section\">code example<\/a>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_admin_language_section<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add input fields to the language section of the plugin settings&nbsp;(<a href=\"#msls-admin-main-section\">code example<\/a>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"msls-admin-main-section\">msls_admin_main_section<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to add custom input fields to the existing sections in the settings of the plugin then you can use one of these actions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $page\n * @param string $section\n *\/\nfunction my_msls_admin_main_section( $page, $section ) {\n    add_settings_field(\n        'custom_field',\n        __( 'Custom Field' ),\n        'custom_field',\n        $page,\n        $section\n    );\n}\nadd_action(\n    'msls_admin_main_section',\n    'my_msls_admin_main_section',\n    10,\n    2\n);\n\nfunction custom_field() {\n    printf( \n        '&lt;input id=\"custom_field\" name=\"msls&#091;custom_field]\" value=\"%s\" size=\"30\"\/&gt;',\n        esc_attr( MslsOptions::instance()-&gt;custom_field )\n    );\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would add an input field &#8218;custom field&#8216; to the main-section of the settings-page.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_admin_register<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to add a completely customized settings section to the configuration-pages of the Multisite Language Switcher then you can use this action.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $page\n *\/\nfunction my_msls_admin_register( $page ) {\n    add_settings_section( 'custom_section', __( 'Custom Settings' ), 'custom_section', $page );\n    add_settings_field( 'custom_field', __( 'Custom Field' ), 'custom_field', $page, 'custom_section' );\n}\nadd_action( 'msls_admin_register', 'my_msls_admin_register' );\n\nfunction custom_section() { }\n\nfunction custom_field() {\n    printf(\n        '&lt;input id=\"custom_field\" name=\"msls&#091;custom_field]\" value=\"%s\" size=\"30\"\/&gt;',\n        esc_attr( MslsOptions::instance()-&gt;custom_field )\n    );\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would add a section with the id &#8218;custom section&#8216; and an input field &#8218;custom field&#8216; to the settings-page of the plugin.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_admin_validate<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can use this filter if you want to add some custom validation for an input field in the configuration page of the plugin.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $arr\n * @return array\n *\/\nfunction my_msls_admin_validate( $arr ) {\n    $arr&#091;'abc'] = ( isset( $arr&#091;'abc'] ) ? $arr&#091;'abc'] : 'xyz' ); \n}\nadd_filter( 'msls_admin_validate', 'my_msls_admin_validate' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This can be useful if you have added your own input fields to this page using an action hook like &#8218;msls_admin_register&#8216;.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_blog_collection_construct<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can easily manipulate the blog collection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $blogs\n * @return array\n *\/\nfunction my_msls_blog_collection_construct( $blogs ) {\n    if ( isset( $blogs&#091;1] ) ) {\n        unset( $blogs&#091;1] );\n    }\n    return $blogs;\n}\nadd_filter( 'msls_blog_collection_construct', 'my_msls_blog_collection_construct' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would exclude the blog with the ID 1 from the collection.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_blog_collection_description<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The description string of every blog is not fixed.&nbsp;You can override it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param int $blog_id\n * @param string|bool $description\n * @return string|bool\n *\/\nfunction my_msls_blog_collection_description( $blog_id, $description = false ) {\n    $arr = array( 1 =&gt; 'abc', 2 =&gt; 'xyz' );\n    if ( isset( $arr&#091; $blog_id ] ) ) {\n        $description = $arr&#091; $blog_id ];\n    }\n    return $description;\n}\nadd_filter( 'msls_blog_collection_description', 'my_msls_blog_collection_description', 10, 2 );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would give the blog with the ID 1 the description &#8218;abc&#8216; and the blog with the ID 2 the name &#8218;xyz.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_filter_string<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can override the string for the output of the translation hint.&nbsp;<em>$output<\/em>&nbsp;contains the original string and&nbsp;<em>$links<\/em>&nbsp;is an array of generated links to the available translations.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $output\n * @param array $links\n * @return string\n *\/\nfunction my_msls_filter_string( $output, $links ) {\n    if ( empty( $links ) ) {\n        $output = '';\n    }\n    else {\n        $output = sprintf(\n            '&lt;p&gt;%s&lt;\/p&gt;&lt;ul&gt;&lt;li&gt;%s&lt;\/li&gt;&lt;\/ul&gt;',\n            __( 'Available Translations' ),\n            implode( '&lt;\/li&gt;&lt;li&gt;', $links )\n        );\n    }\n    return $output;\n}\nadd_filter( 'msls_filter_string', 'my_msls_filter_string', 10, 2 );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>You can use the following code if you want to remove this filter completely:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>remove_action( 'the_content', 'msls_content_filter' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">msls_get_users<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin has a html-select for the reference user which can be the source of slow queries in case of bigger user-tables.&nbsp;You can limit the query like in&nbsp;<a href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_user_query\/prepare_query\/\">WP_User_Query<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $args\n * @return array\n *\/\nfunction my_msls_get_users( $args ) {\n    $args&#091;'role'] = 'administrator';\n}\nadd_filter( 'msls_get_users', 'my_msls_get_users' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This will return only users with the role &#8222;administrator&#8220;.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_head_hreflang<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin creates automatically&nbsp;<a href=\"https:\/\/support.google.com\/webmasters\/answer\/189077?hl=en\">hreflang annotations<\/a>&nbsp;in the head of the generated HTML using the code of the language only&nbsp;(eg.&nbsp;en,&nbsp;de,&nbsp;fr).&nbsp;You can easily override this value:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $language\n * @return string\n *\/\nfunction my_msls_head_hreflang( $language ) {\n    if ( 'en' == $language ) {\n        $language = 'en-gb';\n    }\n    return $language;\n}\nadd_filter( 'msls_head_hreflang', 'my_msls_head_hreflang' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>You can use the following code if you want to remove these tags completely:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>remove_action( 'wp_head', &#091; \\lloc\\Msls\\MslsPlugin::class, 'print_alternate_links' ] );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">msls_link_create<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">There is also a way to manipulate the inner HTML in the generated links.&nbsp;Just create your own MslsLink class.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param int $display\n * @return MslsLink\n *\/\nfunction my_msls_link_create( $display ) {\n    class MyMslsLink extends \\lloc\\Msls\\MslsLink {\n        protected $format_string = '&lt;img src=\"{src}\" alt=\"{alt}\"\/&gt; &lt;span&gt;{txt}&lt;\/span&gt;';\n    }\n    return new MyMslsLink;\n}\nadd_filter( 'msls_link_create', 'my_msls_link_create' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This adds label tags to the descriptional text after the flag icon.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_main_save<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With this action you can call a completely customized save-routine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param int $object_id\n * @param string $class\n *\/\nfunction my_msls_main_save( $object_id, $class ) {\n    \/\/ Your code here\n}\nadd_action( 'msls_main_save', 'my_msls_main_save' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Use this action only if you exactly know what you do!<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_meta_box_render_input_button<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can change or hide the button of the meta box in the edit-screen with this filter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $input_button\n *\/\nfunction my_hide_input_button( $input_button ) {\n    return '&lt;!-- ' . $input_button . ' --&gt;';\n}\nadd_filter( 'msls_meta_box_render_input_button', 'my_hide_input_button' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This wraps the code of the submit-button into HTML comments.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"msls-meta-box-suggest-args\">msls_meta_box_suggest_args<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $args\n * @return array\n *\/\nfunction my_msls_meta_box_suggest_args( $args ) {\n    $args&#091;'posts_per_page'] = 5;\n    return $args;\n}\nadd_filter( 'msls_meta_box_suggest_args', 'my_msls_meta_box_suggest_args' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Maybe you will find it useful to be able to override the&nbsp;<a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/WP_Query\">WP_Query<\/a>&nbsp;<em>$args<\/em>&nbsp;for the auto-complete search-field in the meta box which you can see in the edit-screen of the various post-types or taxonomies of your WordPress site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would limit the output of the results to a maximum of 5 posts.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_post_tag_suggest_args<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Read on here:&nbsp;<a href=\"#msls-meta-box-suggest-args\">msls_meta_box_suggest_args<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_meta_box_render_select_hierarchical<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is only valid for hierarchical post types that use the HTML select&nbsp;(and&nbsp;<em>not<\/em>&nbsp;the new autocomplete inputs)in the meta box.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $args\n * @return array\n *\/\nfunction my_msls_meta_box_render_select_hierarchical( $args ) {\n    $args&#091;'post_status'] = array( 'publish', 'draft', 'future', 'pending' );\n    return $args;\n}\nadd_filter( 'msls_meta_box_render_select_hierarchical', 'my_msls_meta_box_render_select_hierarchical' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This adds various post_stati to the array&nbsp;<em>$args<\/em>&nbsp;for&nbsp;_wp\\_dropdown\\_pages even if this function does not expect this.&nbsp;But inside the function is a call to&nbsp;<em>get_pages<\/em>&nbsp;that can use this param.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"msls-meta-box-suggest-post\">msls_meta_box_suggest_post<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can even manipulate the&nbsp;<a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/WP_Post\">WP_Post<\/a>&#8211;&nbsp;or Term-objects in the result-set created in&nbsp;&#8218;msls\\_meta\\_box\\_suggest\\_args&#8216;&nbsp;or&nbsp;&#8218;msls\\_post\\_tag\\_suggest\\_args&#8216;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param \\WP_Post $post\n * @return \\WP_Post\n *\/\nfunction my_msls_meta_box_suggest_post( $post ) {\n    $post-&gt;post_title .= ' (' . $post-&gt;ID . ')';\n    return $post;\n}\nadd_filter( 'msls_meta_box_suggest_post', 'my_msls_meta_box_suggest_post' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would add the post_id to the title of the posts in the autocomplete-field of the meta box.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_post_tag_suggest_term<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Read on here:&nbsp;<a href=\"#msls-meta-box-suggest-post\">msls_meta_box_suggest_post<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_options_get_available_languages<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can create a custom function to filter the available languages used in the language section of the plugin-settings.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $languages\n * @return string\n *\/\nfunction my_msls_options_get_available_languages( languages ) {\n    if ( ! isset( $languages&#091;'en_GB'] ) ) {\n        $languages&#091;'en_GB'] = 'British English';\n    }\n    return $languages;\n}\nadd_filter( 'msls_options_get_available_languages', 'my_msls_options_get_available_languages' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Even if it is still not fully tested, it seems to be a smart way to add a language without the language files installed. In this case it would solve the issue with the American flag and the Union Jack.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_options_get_flag_url<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can set the path to the flag-icons in the admin settings of the plugin but you can also override the path with a filter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $url\n * @return string\n *\/\nfunction my_msls_options_get_flag_url( $url ) {\n    return get_stylesheet_directory_uri() . '\/images\/';\n}\nadd_filter( 'msls_options_get_flag_url', 'my_msls_options_get_flag_url' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This &#8217;sets&#8216; the path to the flag icons to the directory &#8218;images&#8216; in the active theme.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_options_get_permalink<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I decided to add a filter to the implementation of get_permalink in the plugin so that I can offer a workaround for the issues with the possibility to localize the slugs of custom post types.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $postlink\n * @param string $language\n * @return string\n *\/\nfunction my_msls_options_get_permalink( $url, $language ) {\n    if ( 'de_DE' == $language ) {\n        $url = str_replace( '\/products\/', '\/produkte\/', $url );\n    }\n    return $url;\n}\nadd_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This replaces the &#8218;products&#8216;-part in the URL with &#8218;produkte&#8216; if $language is &#8218;de_DE&#8216;.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_output_get<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can use this filter if you want to change the format of the generated links to the translations in your blog.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $url\n * @param lloc\\Msls\\MslsLink $link\n * @param bool current\n * @return string\n *\/\nfunction my_msls_output_get( $url, $link, $current ) {\n    return sprintf(\n        '&lt;a href=\"%s\" title=\"%s\"%s&gt;%s&lt;\/a&gt;',\n        $url,\n        $link-&gt;txt,\n        ( $current ? ' class=\"current\"' : '' ),\n        $link\n    );\n}\nadd_filter( 'msls_output_get', 'my_msls_output_get', 10, 3 );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would transform the absolute URL in a relative one and would add the css-class &#8218;current&#8216; to the link of the current blog.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_output_get_tags<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can configure the output-tags in the admin settings of the plugin but you can also override these with a filter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param array $tags\n * @return array\n *\/\nfunction my_msls_output_get_tags( $tags ) {\n    return array(\n        'before_item'   =&gt; '&lt;li&gt;',\n        'after_item'    =&gt; '&lt;\/li&gt;',\n        'before_output' =&gt; '&lt;ul&gt;',\n        'after_output'  =&gt; '&lt;\/ul&gt;',\n    );\n}\nadd_filter( 'msls_output_get_tags', 'my_msls_output_get_tags' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would override completely the configuration without looking for existing values.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">msls_output_no_translation_found<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The translation hint in posts will have no output when no translation was found.&nbsp;You can change this behaviour<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $text\n * @return array\n *\/\nfunction my_msls_output_no_translation_found( $text ) {       \n    return __( 'There is no translation for this content!' );\n}\nadd_filter( 'msls_output_no_translation_found', 'my_msls_output_no_translation_found' );\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">msls_widget_alternative_content<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The widget will output&nbsp;&#8222;No available translations found&#8220;&nbsp;if you set&nbsp;&#8222;Show only links with a translation&#8220;&nbsp;in the plugin options and if there is no translation available.&nbsp;You can override the output-string:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * @param string $text\n * @return array\n *\/\nfunction my_msls_widget_alternative_content( $text ) {       \n    return '';\n}\nadd_filter( 'msls_widget_alternative_content', 'my_msls_widget_alternative_content' );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This would be helpful if you want to show an empty string.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;Multisite Language Switcher&nbsp;provides some filters and actions,&nbsp;which are very useful for programmers who want to interact with the plugin from their functions and classes. And again: Always back up your files and database prior to working on your site, better safe than sorry. Read first the&nbsp;introduction&nbsp;provided by the WordPress community if you don&#8217;t know what &hellip; <a href=\"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eHook Referenze\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":357,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-481","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hook Referenze - Multisite Language Switcher<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hook Referenze - Multisite Language Switcher\" \/>\n<meta property=\"og:description\" content=\"The&nbsp;Multisite Language Switcher&nbsp;provides some filters and actions,&nbsp;which are very useful for programmers who want to interact with the plugin from their functions and classes. And again: Always back up your files and database prior to working on your site, better safe than sorry. Read first the&nbsp;introduction&nbsp;provided by the WordPress community if you don&#8217;t know what &hellip; \u201eHook Referenze\u201c weiterlesen\" \/>\n<meta property=\"og:url\" content=\"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/\" \/>\n<meta property=\"og:site_name\" content=\"Multisite Language Switcher\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/realloc\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-13T09:56:31+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@realloc\" \/>\n<meta name=\"twitter:label1\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data1\" content=\"6\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/developer-docs\\\/hook-reference\\\/\",\"url\":\"https:\\\/\\\/msls.co\\\/de\\\/developer-docs\\\/hook-reference\\\/\",\"name\":\"Hook Referenze - Multisite Language Switcher\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/#website\"},\"datePublished\":\"2023-02-28T20:54:28+00:00\",\"dateModified\":\"2025-09-13T09:56:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/developer-docs\\\/hook-reference\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/msls.co\\\/de\\\/developer-docs\\\/hook-reference\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/developer-docs\\\/hook-reference\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/msls.co\\\/de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Entwickler Dokumentation\",\"item\":\"https:\\\/\\\/msls.co\\\/de\\\/developer-docs\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Hook Referenze\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/#website\",\"url\":\"https:\\\/\\\/msls.co\\\/de\\\/\",\"name\":\"Multisite Language Switcher\",\"description\":\"WordPress Multilingual \u2013 Simple, powerful and easy to use\",\"publisher\":{\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/msls.co\\\/de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/#organization\",\"name\":\"Multisite Language Switcher\",\"url\":\"https:\\\/\\\/msls.co\\\/de\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/msls.co\\\/de\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/sites\\\/13\\\/2023\\\/03\\\/cropped-icon.png\",\"contentUrl\":\"https:\\\/\\\/msls.co\\\/de\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/sites\\\/13\\\/2023\\\/03\\\/cropped-icon.png\",\"width\":512,\"height\":512,\"caption\":\"Multisite Language Switcher\"},\"image\":{\"@id\":\"https:\\\/\\\/msls.co\\\/de\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/realloc\",\"https:\\\/\\\/x.com\\\/realloc\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hook Referenze - Multisite Language Switcher","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/","og_locale":"de_DE","og_type":"article","og_title":"Hook Referenze - Multisite Language Switcher","og_description":"The&nbsp;Multisite Language Switcher&nbsp;provides some filters and actions,&nbsp;which are very useful for programmers who want to interact with the plugin from their functions and classes. And again: Always back up your files and database prior to working on your site, better safe than sorry. Read first the&nbsp;introduction&nbsp;provided by the WordPress community if you don&#8217;t know what &hellip; \u201eHook Referenze\u201c weiterlesen","og_url":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/","og_site_name":"Multisite Language Switcher","article_publisher":"https:\/\/www.facebook.com\/realloc","article_modified_time":"2025-09-13T09:56:31+00:00","twitter_card":"summary_large_image","twitter_site":"@realloc","twitter_misc":{"Gesch\u00e4tzte Lesezeit":"6\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/","url":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/","name":"Hook Referenze - Multisite Language Switcher","isPartOf":{"@id":"https:\/\/msls.co\/de\/#website"},"datePublished":"2023-02-28T20:54:28+00:00","dateModified":"2025-09-13T09:56:31+00:00","breadcrumb":{"@id":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/msls.co\/de\/developer-docs\/hook-reference\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/msls.co\/de\/developer-docs\/hook-reference\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/msls.co\/de\/"},{"@type":"ListItem","position":2,"name":"Entwickler Dokumentation","item":"https:\/\/msls.co\/de\/developer-docs\/"},{"@type":"ListItem","position":3,"name":"Hook Referenze"}]},{"@type":"WebSite","@id":"https:\/\/msls.co\/de\/#website","url":"https:\/\/msls.co\/de\/","name":"Multisite Language Switcher","description":"WordPress Multilingual \u2013 Simple, powerful and easy to use","publisher":{"@id":"https:\/\/msls.co\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/msls.co\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/msls.co\/de\/#organization","name":"Multisite Language Switcher","url":"https:\/\/msls.co\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/msls.co\/de\/#\/schema\/logo\/image\/","url":"https:\/\/msls.co\/de\/wp-content\/uploads\/sites\/12\/sites\/13\/2023\/03\/cropped-icon.png","contentUrl":"https:\/\/msls.co\/de\/wp-content\/uploads\/sites\/12\/sites\/13\/2023\/03\/cropped-icon.png","width":512,"height":512,"caption":"Multisite Language Switcher"},"image":{"@id":"https:\/\/msls.co\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/realloc","https:\/\/x.com\/realloc"]}]}},"_links":{"self":[{"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/pages\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":4,"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/pages\/481\/revisions"}],"predecessor-version":[{"id":727,"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/pages\/481\/revisions\/727"}],"up":[{"embeddable":true,"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/pages\/357"}],"wp:attachment":[{"href":"https:\/\/msls.co\/de\/wp-json\/wp\/v2\/media?parent=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}