PHP Class Mlp_Nav_Menu_Frontend

Afficher le fichier Open project: inpsyde/multilingual-press

Méthodes publiques

Méthode Description
__construct ( string $meta_key, Mlp_Language_Api_Interface $language_api ) Constructor.
filter_items ( array $items ) : WP_Post[] Filters the nav menu items.
maybe_delete_obsolete_item ( WP_Post $item ) : boolean Checks if the site with the given post's remote site ID still exists, and deletes the post if not.

Private Methods

Méthode Description
get_item_details ( array $translations, integer $site_id ) : array Returns the remote URL and the translation object for the according item.
get_site_id ( WP_Post $item ) : integer Returns the site ID for the given nav menu item object.
prepare_item ( WP_Post $item, array $translations ) : void Assigns the remote URL and fires an action hook.

Method Details

__construct() public méthode

Constructor.
public __construct ( string $meta_key, Mlp_Language_Api_Interface $language_api )
$meta_key string The site ID meta key.
$language_api Mlp_Language_Api_Interface The language API.

filter_items() public méthode

Filters the nav menu items.
public filter_items ( array $items ) : WP_Post[]
$items array Nav menu items.
Résultat WP_Post[]

maybe_delete_obsolete_item() public méthode

Checks if the site with the given post's remote site ID still exists, and deletes the post if not.
public maybe_delete_obsolete_item ( WP_Post $item ) : boolean
$item WP_Post Nav menu item.
Résultat boolean