Class WPGlobus_Filters
Class WPGlobus_Filters
Methods summary
public static
string
|
#
filter__text( string $text )
This is the basic filter used to extract the text portion in the current language from a string. Applied to the main WP texts, such as post title, content and excerpt. |
public static
array
|
#
filter__the_posts( array $posts, WP_Query & $query )
This filter is needed to display correctly the posts with the '--- MORE ---' separator in archives. Without it, the post content is truncated at the beginning of , thus keeping only the first language. * 'the_posts' filter is used by @see get_posts(), which is commonly used in all sorts of places, including, for instance, @see wp_get_associated_nav_menu_items while deleting a post. So, to minimize potential side effects, we limit the scope to main queries, or when the 'wpglobus_force_filter__the_posts' is set (@see WPGlobus_QA::_test_get_posts for example). |
public static
string
|
#
filter__text_default_language( string $text )
This is similar to the @see filter__text filter, but it returns text in the DEFAULT language. |
public static
array
|
|
public static
array
|
|
public static
array
|
|
public static
string
|
#
filter__sanitize_title( string $title )
This filter is needed to build correct permalink (slug, post_name) using only the main part of the post title (in the default language).Because 'sanitize_title' is a commonly used function, we have to apply our filter only on very specific calls. Therefore, there are (ugly) debug_backtrace checks.Case 1 When a draft post is created, the post title is converted to the slug in the @see get_sample_permalink function, using the 'sanitize_title' filter.Case 2 When the draft is published, @see wp_insert_post calls |
public static
string|object
|
|
public static
string
|
|
public static
string
|
#
filter__home_url( string $url )
Localize home_url Should be processed on: - front - AJAX, except for several specific actions |
public static
WP_Post[]
|
|
public static
string
|
|
public static
WP_Post[]
|
#
filter__nav_menu_item( WP_Post[] $object )
Filter @see wp_setup_nav_menu_item in wp-includes\nav-menu.php for more info |
public static
string
|
|
public static
array
|
#
filter__heartbeat_received( array $response, array $data, string $screen_id )
Filter @see heartbeat_received |
public static
array
|
|
public static
string[]
|
#
filter__widget_display_callback( string[] $instance )
Translate widget strings (besides the title handled by the |
public static
string
|
#
filter__comment_moderation( string $text, integer $comment_id )
Filter @see comment_moderation_text, |
public static
string
|
#
filter__wp_trim_words( string $text, integer $num_words, string $more, string $original_text )
Filter @see wp_trim_words |
public static
|
|
public static
|
|
public static
|
|
public static
string|array
|
#
filter__postmeta( string|array $value, integer $object_id, string $meta_key, string|array $single )
Translate meta data |
public static
|
Properties summary
protected static
string[]
|
$multilingual_meta_keys
Meta keys where data can be multilingual |
#
array()
|