Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter(
- 'jnews_account_page_endpoint',
- 'add_custom_account_menu',
- 99
- );
- function add_custom_account_menu( $enpoint ) {
- /* add custom menu on account menu item */
- $enpoint['custom_account_menu'] = array(
- 'slug' => 'custom-menu', /* custom menu slug */
- 'label' => 'custom_menu',
- 'title' => esc_html__( 'Custom Menu', 'jnews' ), /* custom menu Title */
- );
- return $enpoint;
- }
- add_action( 'jnews_account_right_content', 'custom_account_menu' );
- function custom_account_menu() {
- global $wp;
- if ( is_user_logged_in() ) {
- if ( isset( $wp->query_vars['account'] ) && ! empty( $wp->query_vars['account'] ) ) {
- $query_vars = explode( '/', $wp->query_vars['account'] );
- if ( 'custom-menu' === $query_vars[0] ) {
- $render_page = 11818; /* change with your custom page ID */
- $page = get_post( $render_page );
- if ( $page ) {
- echo apply_filters( 'the_content', $page->post_content );
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement