Join our new community forum for support & discussion
Join Now-
AuthorSearch Results
-
flantascience 9 months, 4 weeks agoin RentalHive > How to customize the Account page
I made some progress. I got three new menu items to show up. However, the “Submit a Listing” is the only one that is working. I believe the issue is with the ‘Route’. For the Submit a Listing page, there’s an existing ‘Route’. But for the other two, I added the URL to the page, and its not working. Any guidance? (Code is below)
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { $menu['items']['listing_submit']=[ 'label' => 'Submit a Listing', 'route' => 'listing_submit_page', '_order' => 123, ]; $menu['items']['calendar']=[ 'label' => 'Calendar', 'route' => 'https://luneh.com/calendar-testing/', '_order' => 122, ]; $menu['items']['files']=[ 'label' => 'Your Files', 'route' => 'https://luneh.com/file-sharing-testing/', '_order' => 121, ]; return $menu; }, 1000 );
in ExpertHive > List a Service Button inside de vendor dashboardPlease try this PHP snippet
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { $menu['items']['custom_item_add_listing'] = [ 'label' => 'Add Listing', 'url' => hivepress()->router->get_url('listing_submit_page'), '_order' => 100, ]; return $menu; }, 1000 );
in ExpertHive > List a Service Button inside de vendor dashboardPlease try this PHP snippet. It will add this button only for vendors in account menu
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { if(current_user_can('edit_posts')){ $menu['items']['custom_item_add_listing'] = [ 'label' => 'Add Listing', 'url' => hivepress()->router->get_url('listing_submit_page'), '_order' => 100, ]; } return $menu; }, 1000 );
in ExpertHive > User AccountIf you mean account page menu then you can try changing menu items via the
hivepress/v1/menus/user_account
filter like in this topic https://hivepress.io/support/search/menus%2Fuser_account/But if you want to make changes only for vendors then code needs additional condition
if(current_user_can('edit_posts')) {
For example, I add this condition to code from topic which is provided aboveadd_filter( 'hivepress/v1/menus/user_account', function( $menu ) { // Here is this condition to make changes only for vendors. if(current_user_can('edit_posts')) { // To add some menu items. $menu['items']['custom_item_name'] = [ 'label' => 'Custom Item', 'url' => 'some url', '_order' => 123, ]; // To remove some menu items. For example, 'Listings' item unset($menu['items']['listings_edit']); } return $menu; } );
Bemay1 1 year, 1 month agoin HivePress > Redirect destination page for “my account”After thinking about the last sentence you wrotte i though about an alternative way and got it:
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { $menu['items']['custom_item_name'] = [ 'label' => 'Minha Conta', 'url' => 'https://google.com', '_order' => 0, ]; return $menu; } );
If somebody else needs, you just need to change the fields “label” and “url”
in HivePress > Orders and Packages in the user profilePlease try changing menu items via the
hivepress/v1/menus/user_account
filter https://hivepress.io/support/search/menus%2Fuser_account/in TaskHive > Add custom link in the menu dashboards vendorThere is no easy way to link a modal, but if you create a custom page for tutorials please try this PHP snippet. You can change fields with word ‘custom‘ and adjust
'_order'
by your requirements:add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { if(current_user_can('edit_posts')){ $menu['items']['custom_item_name'] = [ 'label' => 'Custom Item', 'url' => 'some custom url', '_order' => 123, ]; } return $menu; } );
in TaskHive > How to customize My account section in Taskhive ?Please try this sample code snippet to add/remove (but adding a new account section requires advanced customizations) any menu item from My Account menu:
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { // To add some menu items. $menu['items']['custom_item_name'] = [ 'label' => 'Custom Item', 'url' => 'some url', '_order' => 123, ]; // To remove some menu items. For example, 'Listings' item unset($menu['items']['listings_edit']); return $menu; } );
natsu 1 year, 5 months agoin HivePress > ‘vendor_view_page’ in the menuHi everyone.
I came up with a different solution.
Instead of showing a link on Navbar, I managed to put a link within a my account menu.I hope this will help 🙂
//Add a link to My listing page within my account menu add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { $menu['items']['custom_item_name'] = [ 'label' => 'My Listings', 'url' => esc_url( home_url()."/vendor/".get_display_name()), '_order' => 123, ]; return $menu; } ); function get_display_name () { $user_data = get_userdata(get_current_user_id()); return $user_data->display_name; }
I don’t know much about PHP I just combined these POSTS.
https://hivepress.io/support/topic/my-account-section/#post-7202
https://hivepress.io/support/topic/change-username-of-vendors/#post-17598Thanks @ihor @Sergio @RooninStark
fekedew 1 year, 7 months agoin HivePress > ‘vendor_view_page’ in the menutry this. put this code in child theme function.php file
add_filter( 'hivepress/v1/menus/user_account', 'alter_user_account_menu_register1' ); function alter_user_account_menu_register1( $menu ) { global $wpdb; $p_sql = "SELECT <code>post_name</code> FROM wp_posts WHERE <code>post_author</code>=".get_current_user_id()." AND <code>post_type</code>='hp_vendor'"; $row = $wpdb->get_results($p_sql); if(count($row) > 0){ $menu['items']['vender'] = [ 'label' => "Listing page ", 'url' => esc_url( home_url()."/vendor/".$row[0]->post_name ), '_order' => 14, ]; } return $menu; }
tandej 1 year, 9 months agoin TaskHive > Remove Dashboard from User AccountWhere do I find this path hivepress/v1/menus/user_account? I don’t have a v1 folder in my version of hivepress.
lgoldmann 1 year, 9 months agoin TaskHive > Remove Dashboard from User AccountHi,
is there a way to hide the dashboard page & menu item in the user account?
I already tried to unset the item in the “hivepress/v1/menus/user_account” filter
usingunset( $menu['items']['vendor_dashboard_page'] );
, but to no avail.When hiding the dashboard, I’d also need to edit the “My Account” link in the header, since it redirects to the dashboard.
Many thanks!
alphagoldafrica 1 year, 9 months agoin ListingHive > My account sectionHi Ihor,
I am using the expert theme.
Will this section of the code ‘hivepress/v1/menus/user_account’ be the same in the expert theme? If not, what would the equivalent be for the expert theme.
Thank you,
Carolinein Paid Listings > Hide/remove Packages menu itemPlease try using this PHP snippet:
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { unset($menu['items']['user_listing_packages_view']); return $menu; }, 1000 );
If you’re familiar with PHP snippets please try using the “hivepress/v1/menus/user_account” filter, you can unset any links or add a custom link this way, HivePress will automatically render these links.
P.S. You don’t have to post another reply asking for urgent help, I check all topics at least once per 24 hours, even on weekends, so I (or another developer) will reply anyway. Please be patient, remember that it’s open-source software.
Hi,
1. It’s possible, but requires CSS customizations https://www.w3schools.com/cssref/css3_pr_text-overflow.asp
2. You can try this CSS snippet:
.hp-menu__item--user-account {display:none}
3. If you mean adding custom content or menu items this requires PHP customizations (if you’re familiar with PHP you can use the “hivepress/v1/menus/user_account” filter). Also you can add custom widgets to the account sidebar in Appearance/Widgets section.
in ListingHive > My account sectionYou can add a custom menu item with this snippet, but adding a new account section requires advanced customizations:
add_filter( 'hivepress/v1/menus/user_account', function( $menu ) { $menu['items']['custom_item_name'] = [ 'label' => 'Custom Item', 'url' => 'https://example.com', '_order' => 123, ]; return $menu; } );
gsmobina 2 years, 4 months agoin ListingHive > My account sectionI am not a developer, i just manipulate codes.
can you give me snippet for the 1st option using hivepress/v1/menus/user_account filter?
at least a sample?in ListingHive > My account section1. This requires code customizations, please try using HivePress API if you’re familiar with PHP, you can use the “hivepress/v1/menus/user_account” filter.
2. Unfortunately it’s not possible because the check for empty pages is set in HivePress code, e.g. if there are no favorite listings then the menu item is not added.
in HivePress > Re-Arrange My Account Menu ItemsThis code snippet should move the “Listings” menu item to the end:
add_filter( 'hivepress/v1/menus/user_account/items', function( $menu ) { if ( isset( $menu['listings_edit'] ) ) { $menu['listings_edit']['_order'] = 9999; } return $menu; }, 10000 );
You can start with it and copy the “if…” part with different menu item keys. If can’t check the $menu contents, please try removing the “_page” part from menu keys and it should be ok.
-
AuthorSearch Results