Deprecated
This method has been deprecated.
AnsPress_Hooks::update_menu_url( array $items )
Description #
Update AnsPress pages URL dynimacally
Parameters #
- $itemsarray (Required) Menu item.
Source #
File: includes/hooks.php
public static function update_menu_url( $items ) { // If this is admin then we dont want to update url. if ( is_admin() ) { return $items; } $pages = anspress()->pages; foreach ( (array) $items as $key => $item ) { if ( 'anspress-links' === $item->type ) { if ( isset( $pages[ $item->object ]['private'] ) && $pages[ $item->object ]['private'] && ! is_user_logged_in() ) { unset( $items[ $key ] ); } else { if ( 'base' === $item->object ) { $item->url = ap_get_link_to( '/' ); } else { $item->url = apply_filters( 'ap_menu_link', ap_get_link_to( ap_get_page_slug( $item->object ) ), $item ); } } } } return apply_filters( 'ap_menu_items', $items ); }
Expand full source code Collapse full source code View on GitHub: includes/hooks.php:452
Add your comment