[Gelöst] FOLLOW-UP: Saving Logged-in User Selected Query Results by Checkboxing to a User
This support ticket is created vor 6 Jahre, 5 Monate. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I'm sorry, those login credentials do not work for me. Can you check? I will enable private reply fields again in case you need to send updated credentials.
Okay thanks I was able to log in successfully. I see that you're using the theme "Unicum", but you don't have a child theme installed. Making changes directly to a 3rd-party theme's functions.php file is not recommended, because updates to the theme will overwrite your code. It's always recommended to create a child theme and make your changes in a child theme's functions.php file. More info here: https://codex.wordpress.org/Child_Themes
With that being said, can you provide the error log that you mentioned before? I can enable private reply fields here where you can copy + paste a brief log, or you can post a download link for a larger log. No need to supply valid FTP or login info here, just add to the comments area.
I am guessing your child theme error was caused by this line:
if ( ! function_exists( 'wplab_unicum_setup' ) ) :
There's no endif; so this block is unterminated. That would definitely lead to an error. I'll be glad to try to make some changes, but I'm not able to access your site with FTP using the credentials you provided. I'd rather not make changes without FTP access, because a typo could bring your site down and I wouldn't be able to access the files on the backend. Can you check those FTP credentials for me? Is there a server IP address restriction? Private reply fields enabled again here.
Also - is it okay for me to install the Duplicator plugin and create a clone of your site so I can do the necessary changes on a local copy before deploying them to your live site?
Okay thanks, I was able to set up a clone and determine what's going on with your child theme. Please replace the functions.php file with this content to enable the child theme:
<?php
function wplab_unicum_enqueue_styles() {
$parent_style = 'wplab-unicum'; // This is 'wplab-unibum' for the Unicum theme.
wp_enqueue_style( $wplab_unicum, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'wplab-unibum-child',
get_stylesheet_directory_uri() . '/style.css',
array( $wplab_unicum ),
wp_get_theme()->get('Version')
);
}
add_action( 'wp_enqueue_scripts', 'wplab_unicum_enqueue_styles' );
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*
* @since Cosa 1.0
*/
// Playbox Wishlist action from CRED
add_action('cred_save_data_1583', 'update_user_wishlist',10,2);
function update_user_wishlist($post_id, $form_data) {
$item_id = $_REQUEST['itemid'];
add_user_meta($post_id, 'wpcf-item-id', $item_id);
}
I see that form 1583 is a Post Edit form, and I don't see any code in place to support the edit User form I mentioned before. Which edit User form should I be looking at? Where is it implemented on the front-end of your site?
Corrected the Child theme, but reverted to Parent for now. Hope the below info helps. I'm pretty sure I misinterpreted location for the code before the submit button as instructed.
/** Post Form for the data being output to the search results is (ID: 1583)
/** Loop output Search Results View: (ID: 5562)
/** Location in the Search View 5562 for action on Line 47:
<td class="center aligned"><span class="glyphicon glyphicon-heart-empty" aria-hidden="true"></span></td>
/** Edit User Form: Edit User Playbox Wishlist (ID: 5572)
- If you want to style the submit button or use a heart icon image instead, you can customize the submit button in the CRED form editor.
- Correct the form ID in cred_save_data hook
- Update item ID field slug to match yours: wpcf-itemid
Almost there. I edited the View and Child function.php as instructed. I must still be missing something. Page View in the field <td></td> prints "No user specified". How does it know? How do we specify user type?
To use this feature a user must be logged in at a specific level or asked to login with level credentials to use the wishlist feature.
Could you please tell me what is your expected output with one test case example and please share clear steps to follow that will help me to guide you in right direction.