Join our new community forum for support & discussion

Join Now

Home Support Search Search Results for 'menus/user_account'

Viewing 7 results - 21 through 27 (of 27 total)
  • Author
    Search Results
  • gsmobina

    hi,

    I have been trying to do this for sometime.

    i tries var dump method after searching the net but i still don’t know how to do this properly.

    this is what i finaly wrote as a code snippet

    add_filter(
    ‘hivepress/v1/menus/user_account/items’,
    function( $menu ) {
    	if ( isset( $menu['listings_edit'] ) ) {
    			$menu['listings_edit']['_order'] = 1;
    		} 
    					if ( isset( $menu['messages_thread'] ) ) {
    			$menu['messages_thread']['_order'] = 12;
    		}
    			if ( isset( $menu['listings_favorite_page'] ) ) {
    			$menu['listings_favorite_page']['_order'] = 123;
    		}
    				if ( isset( $menu['memberships_view_page'] ) ) {
    			$menu['memberships_view_page']['_order'] = 1234;
    		}
    				if ( isset( $menu['user_listing_packages_view'] ) ) {
    			$menu['user_listing_packages_view']['_order'] = 12345;
    		}
    			if ( isset( $menu['orders_view'] ) ) {
    			$menu['orders_view']['_order'] = 123456;
    		}
    				if ( isset( $menu['user_edit_settings_pages'] ) ) {
    			$menu['user_edit_settings_page']['_order'] = 1234567;
    		}
    			if ( isset( $menu['user_logout'] ) ) {
    			$menu['user_logout']['_order'] = 12345678;}
    
    			//	echo var_dump($menu);
    			
    return $menu;
        
    });

    Please help me to sort this.

    ihor developer

    Try using this one instead:

    add_filter(
    	'hivepress/v1/menus/user_account/items',
    	function( $menu ) {
    		if ( isset( $menu['listings_edit'] ) ) {
    			$menu['listings_edit']['_order'] = 123;
    		}
    
    		return $menu;
    	},
    	10000
    );

    You can check page IDs with var_dump:

    var_dump($menu);

    For example, the favorites page has “listings_favorite” ID instead of “favorites”.

    gsmobina

    here is what i did. where am i gone wrong in this?

    add_filter(
    ‘hivepress/v1/menus/user_account/items’,
    function( $menu ) {
    if ( isset( $menu[‘listings_edit’] ) ) {
    $menu[‘listings_edit’][‘_order’] = 10;
    }
    if ( isset( $menu[‘messages’] ) ) {
    $menu[‘messages’][‘_order’] = 20;
    }
    if ( isset( $menu[‘favorites’] ) ) {
    $menu[‘favorites’][‘_order’] = 45;
    }
    if ( isset( $menu[‘memberships’] ) ) {
    $menu[‘memberships’][‘_order’] = 40;
    }
    if ( isset( $menu[‘user_listing_packages_view’] ) ) {
    $menu[‘user_listing_packages_view’][‘_order’] = 35;
    }
    if ( isset( $menu[‘woocommerce-orders’] ) ) {
    $menu[‘woocommerce-orders’][‘_order’] = 60;
    }
    if ( isset( $menu[‘user_edit_settings’] ) ) {
    $menu[‘user_edit_settingst’][‘_order’] = 70;
    }
    if ( isset( $menu[‘user_logout’] ) ) {
    $menu[‘user_logout’][‘_order’] = 80;
    }

    return $menu;
    }
    );

    ihor developer

    Here’s an example:

    add_filter(
    	'hivepress/v1/menus/user_account/items',
    	function( $menu ) {
    		if ( isset( $menu['listings_edit'] ) ) {
    			$menu['listings_edit']['_order'] = 123;
    		}
    
    		return $menu;
    	}
    );
    gsmobina

    like this?

    add_filter(
    	'hivepress/v1/menus/user_account',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    				
    
    					'listings'          => [
    						'_order' => 0,
    					],
    						'messages' => [
    						'_order' => 1
    					],
    						'favorites' => [
    						'_order' => 3
    					],
    						'memberships' => [
    						'_order' => 4
    					],
    						'listung_packages' => [
    						'_order' => 5
    					],
    						'orders' => [
    						'_order' => 6
    					],
    						'settings' => [
    						'_order' => 7
    					],
    						'signout' => [
    						'_order' => 8
    					],
    				],
    			]
    		);
    	}
    );

    ——
    doesn’t seem to be working

    ihor developer

    You can do this via HivePress API using “hivepress/v1/menus/user_account” filter, menu items can be re-ordered in the same way as fields (via setting the “_order”).

    ihor developer
    in HivePress > My Account Page

    Sorry, but I can’t estimate this and currently I’m not available for custom work, you can try to find a developer via Fiverr. If you’re familiar with PHP please check the API references, for example https://hivepress.io/docs/references/filters/ If you want to alter the account menu items, you can do it via the “hivepress/v1/menus/user_account” filter.

Viewing 7 results - 21 through 27 (of 27 total)