sslv
Forum Replies Created
-
Will do, thanks!
Hi Patrik,
I just tried both options now, and both have empty
- list.
Any solutions?
Thanks,
SSLVThanks for your help π
Hi Stiofan,
Thanks for your reply. I will have a look on the Location Manager plugin.
I will let you know if I have any further questions on this matter.
Thanks for your time,
SSLVHi Patrik.
I created a short-code as shown in the following screenshot. Here I’m using a [uwp_user_meta key=”last_name”] just to check if it shows on the profile. and it works.
https://paste.pics/43cbb6139fb285d65618cfa553e7cb99
Now i’m unsure how to use my Code Snippet in that short-code. I found the following question https://wordpress.org/support/topic/custom-account-tab-2/
which shows how to use available account tabs. However I want the second option – use available profile tabs. What is the code for that?
OKay thanks,
I will try that!
My objective is to provide a list of locations created by current profile (not currently logged in user)..
For example :
- user1 has created 4 locations (GeoDirectory)
- user2 has created 1 location.
I want to create a new profile tab (Owner’s Locations) that would list all locations to the corresponding user. Thus, when user2 visits the profile of user1 they should be able to go on Owner’s Location tab and see the 4 shops only created by the user1.
FYI i managed to create a similar process entirely with PHP in my edit account page, that only works with the currently logged in user. See screenshot below
https://paste.pics/8b7b0f7a6c0be3dfaa0dde2b2c6450fbWhere can I find more info on available hooks and filters for UsersWP?
Based on this topic, I have a related question that i though to post here rather than creating a new question..
I now want to create a new Profile Tab using php. I found the following code online but it doesn’t work for me. Any ideas what I’m doing wrong?
add_filter('uwp_profile_tabs', 'uwp_add_profile_custom_tabs', 10, 3); function uwp_add_profile_custom_tabs($tabs, $user, $allowed_tabs) { $tabs['citas'] = array( 'title' => 'Mis Citas', 'count' => 1 ); return $tabs; } add_action('uwp_profile_citas_tab_content', 'uwp_add_profile_citas_tab_content'); function uwp_add_profile_citas_tab_content($user) { echo "hello world"; do_shortcode('[uwp_user_meta key="first_name"]'); }Do I have to create a shortcode with field key ‘citas’ in order for this to work?
- This reply was modified 4 years, 8 months ago by sslv.
Hi,
Any ideas what it means and how to fix?
I could provide my code snippet, let me knowThanks that worked great π
???
Thanks @bungeshea
The provided article using safe mode has helped me disable the code snippet that was causing the website to shut down..
Regarding the
Error Details ============= An error of type E_PARSE was caused in line 77 of the file /home/dh_p6pwh2/sslvsolutions.com/wp-content/plugins/code-snippets/php/admin-menus/class-edit-menu.php(221) : eval()'d code. Error message: syntax error, unexpected 'Is it something I should be concerned about? Is it a plugin author responsibility or did I caused this?
Here is the solution I came up with but I’m sure there is a better way of doing in. So far works as expected though:
function createMenuItem(){ //NEW MENU ITEM OF UsersWP > Edit Account add_filter('uwp_account_available_tabs', 'uwp_account_available_tabs_cb', 10, 1); function uwp_account_available_tabs_cb($tabs){ //Add new element $tabs['my-shops'] = array( 'title' => __( 'Manage Shops', 'userswp' ), 'icon' => 'fas fa-store-alt', ); //Chane order of array elements in new array $sorted_tabs = array( "account" => array_shift(array_slice($tabs, 0, 1)), "my-shops" => array_shift(array_slice($tabs, 4, 5)), "notifications" => array_shift(array_slice($tabs, 2, 3)), "privacy" => array_shift(array_slice($tabs, 3, 4)), "change-password" => array_shift(array_slice($tabs, 1, 2)) ); return $sorted_tabs; //return sorted array } }Thank you Patrik,
SSLV
Thanks for your help, I really appreciate that π
Hi,
I only managed to get the author id, i’m not so sure about the post type and status…
- I got the id using get_current_user_id();, which is correct i think.
- if I use this echo “Post Type: ” . get_post_type(get_the_ID()); it returns Page.
- As for status is this what I want: https://developer.wordpress.org/reference/hooks/get_post_status/
But for the post type what do I need to specify? From what I understand from the documentation is the slug used or I’m I wrong?
Let me know.
Sorry but I’m not very familiar with php code