CCCPaste

Some Custom Change || Add new menu and content in Account Page

/* Add New Menu to Account Nav */
function add_custom_menu_account_nav( $endpoint ) {
    $item = array(
        'custom_menu' => array(
            'slug'  => 'custom-menu',
            'label' => 'custom_menu',
            'title' => 'Custom Menu'
        )
    );
    $endpoint = array_merge( $endpoint, $item );
    return $endpoint;
}

add_filter( 'jnews_account_page_endpoint', 'add_custom_menu_account_nav' );

/* Add Title to Account Content */ 
function custom_account_right_title() {
	// Insert Your Code Here
	$accountpage = JNews\AccountPage::getInstance();
	remove_action( 'jnews_account_right_title', array( $accountpage, 'get_right_title' ) );

	if ( $accountpage->get_current_page() === 'custom_menu') {
		echo 'Custom Title';
	}
}

// add_action( 'jnews_account_right_title', 'custom_account_right_title', 9 ); // Default Title will follow title in function add_custom_menu_account_nav

/* Add The Content to Account Content */ 
function custom_account_right_content() {
	// Insert Your Code Here
	$accountpage = JNews\AccountPage::getInstance();

	if ( $accountpage->get_current_page() === 'custom_menu') {
		echo 'Hello';
		echo '
'; echo do_shortcode( '[your_shortcode_handle]' ); echo '
'; echo do_shortcode( '[jnews_block_1 first_title="Example"]' ); } } add_action( 'jnews_account_right_content', 'custom_account_right_content' );