physalis
Forum Replies Created
-
Forum: Plugins
In reply to: [Favorites] Javascript callbacks clarificationHi @river-clement ,
since I went through it myself I can explain how to approach this.
In order to let something happen after the button has been pressed (= post has been added to favorites, NOT removed), you best use JavaScript to e.g. show a div with a message as in my case. For the script not to fail because a crucial resource from the plugin itself hasn’t loaded, you add simple-locator as a dependency for your JavaScript to load. The WordPress Codex helps you understand how you best include a script and/or CSS files into your theme, and then you enqueue your script like this:
wp_enqueue_script('script', get_stylesheet_directory_uri() . '/js/script.js', 'simple-locator', '1.0.0', true);, and inside your script.js you could do something like this:
function favorites_after_button_submit(favorites){ jQuery('.simplefavorite-button.active').after('<div class="fav_success"><i class="fa fa-info-circle"></i>Contract successfully added to your clipboard.</div>'); jQuery('.fav_success').fadeIn(1500).delay(5000).fadeOut(1500); }– does that help you out? It is working in my case (showing a message after user added fav, disappears again after 5 seconds).
Best
physalis
Forum: Plugins
In reply to: [Favorites] Favorite status not savedYou can in a way circumvent the problem by enabling ‘Display loading indicator for buttons (Helpful for slow sites with cache enabled)’ and ‘Include loading indicator image on page load’ (the latter does not show an image if you did not enable the loading image in the box above) in the ‘Display’ settings tab. This way there is a visible indicator that the page needs to load to 100% in order to succeed.
Forum: Plugins
In reply to: [Favorites] Favorite status not savedCan you replicate that it happens when the page is still loading, and does work when it is fully loaded? It seems it has to do with a resource not being loaded that Favorites relies on for its AJAX actions.
Forum: Plugins
In reply to: [Favorites] Favorite status not savedEdit II: This happens even WHEN the page is loaded. I click on the Fav button, it switches (and the count of user favourites changes too), then switches back to unfavourited, and the user fav count is going back too.
What I observed is that if possibly one of your plugin’s resources hasn’t loaded yet and you already click the button, the console throws an error, saying
Uncaught TypeError: Cannot read property 'length' of undefinedfor simple-favorites.min.js in line 1. Hope this helps a bit!Looks like it is working, though ;).
Forum: Plugins
In reply to: [Favorites] Favorite status not savedEdit: Well, it seems to happen when a page needs long to load completely. When I click the button while the content is still loading, the button turns grey, reads ‘Remove’ and then switches back to its former state, and the post is not added to the favourites.
I did so, will try to investigate. The problem was, that it once in a while worked, while on other days it didn’t. I think it got corrupted on editing the password protected page. Will get back to you!
Forum: Plugins
In reply to: [Favorites] Favorite status not savedI simply have the same problem on a site I am using it with, but thought I hadn’t done it properly myself. However, other users of that site report it as well. Adding a post to favourites often doesn’t work immediately, only after adding it multiple times (i.e. hit add to fav, reload page –> state is not being saved, hit button again, reload, then it is saved). Is there something known to interfere with your plugin?
What do you mean? If you didn’t put in the fix, how is uninstalling and re-installing it actually helping :)? I see the last update is from 6 days ago.
Yes, if you rely on it to filter the_excerpt, you’re pretty much lost with the plugin since quite a while.
If you’re only after changing the word count and the ellipsis characters, you can throw this into your functions.php:
* Excerpt length */ function custom_excerpt_length( $length ) { return 40 ;} add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); /* Excerpt ellipse */ function new_excerpt_more( $more ) { return '…'; } add_filter('excerpt_more', 'new_excerpt_more');Forum: Plugins
In reply to: [Lively Chat via SMS] Only allow one chat slot?Yes, exactly that. For my purpose, that would be exactly what is needed! And if the maximum of slots (in my case just one) has been reached, one should best be able to set a custom message being shown to users in that case, e.g. ‘All chatting slots are taken right now. Please wait until we are there for you’ or something like that.
Forum: Plugins
In reply to: [Favorites] Delete list itemsEdit: I don’t know what it was, but I had to switch themes and switch back to my current theme in order to finally see it! I just tested it out on another demo site and it worked there, so I tried the thing with switching themes, and it finally worked. Thanks for your support!
Forum: Plugins
In reply to: [Favorites] Delete list itemsAny updates in this matter, Kyle :)?
Forum: Plugins
In reply to: [Favorites] Delete list itemsThanks for your info, Kyle. You may help me out on this one, though. On the user’s favourites list page, I create the list plus the Clear button by inserting
[user_favorites include_links="true" include_buttons="true"] [clear_favorites_button text="Clear Favorites"]into the page. What I get is the list (without any buttons) plus the Clear favourites button, but no option/buttons to remove single items from my list. I checked the source code, but there are only the list items and no buttons for favourites removal. Am I doing something wrong on my end :)?
Thank you so much
physalis
Forum: Plugins
In reply to: [Favorites] Link to remove items in favorites list?Hey there, Kyle,
that’s really good to hear! The clearing button seems to work quite well, after a moment or two the whole list being cleared.
As regards to the ‘Delete favourite’ button, what I actually meant was that on my user-list view, I want to be able to either delete/clear all favourites or delete single items. I thought maybe include_button=”true” would bring that, but it doesn’t. I was solely referring to the user’s own list where he wants to delete single items :).
All the best
physalis