Kyle Phillips
Forum Replies Created
-
Forum: Plugins
In reply to: [Favorites] Get user id who like a postThis has been added in version 1.2.0.
There are a couple of new functions and a shortcode.
The function
get_users_who_favorited_post($post_id)returns an array of WP User objects who have liked the post passed in.The function
the_users_who_favorited_postprints out a list of users who have liked the post. There are some options/parameters available to show/hide anonymous users from the list, and formatting. (see the plugin website for full list).The shortcode
[post_favorites]does the same as the print function above. Details and its options are available on the plugin site.Forum: Plugins
In reply to: [Favorites] Force anonymous users to login to favorite1) I think there’s a few ways to tackle that type of functionality, none of which are directly related to this plugin. The first thing that comes to mind:
- Add a couple of query parameters to the link in the email (something like http://domain.com/favorite-page?favorite=true&id=1).
- In the template, you could check for those query parameters, and if they exist, output a simple script that clicks the favorite button on load
2) This feature is under active development
3) The generated list doesn’t include any reference to “favorites”. If you’d like to change the button text, you can do that under the plugin settings: Settings > Favorites > Display > Button Text
Forum: Plugins
In reply to: [Favorites] Request Feature: Most Favorited Posts (Archive & Widget)Sorry for the late response.
For anyone else interested in displaying a list of “most favorited” posts, it’s pretty straight-forward using the WP_Query object.
Elliot Condon has a great post outlining other methods of ordering by custom fields (in this case, the field name is
simplefavorites_count).Post on Advanced Custom Fields
This most likely won’t be something built into the plugin in the future, since the presentation of lists like these will depend heavily on individual sites/themes.
Forum: Plugins
In reply to: [Favorites] Hook to add info to bookmarkThis plugin wouldn’t currently be able to help you out for your specific requirements.
Right now, favorites are saved in simple arrays, grouped as post IDs under site IDs.
I like the idea of adding developer hooks to save extra info for posts. I’ll add it to the list of features to consider for a future version.
Forum: Plugins
In reply to: [Favorites] Force anonymous users to login to favorite1) I may not understand the question correctly, but you could just link to the post itself.
2) This isn’t currently functionality in the plugin. You could fake it by checking if the user is currently logged in, and if not, display a non-functioning button in your template.
3) This isn’t currently supported. It’s on a list of future features to build out, but it may be a while before this is complete.
Forum: Plugins
In reply to: [Favorites] How are logged in users favorites savedLogged-in users’ favorites are stored in the usermeta table in the database. This is where user-specific settings are stored by WordPress.
Since this data is stored in the database, it is not dependent on the user’s browser at all. If someone deletes they’re browser cookies, quits the session, logs in somewhere else, etc… they are unaffected.
A session what the name implies… a single session or visit from a user. Session variables are stored on the server and removed once the session is. They are best for short, disposable bits of information.
Forum: Plugins
In reply to: [Favorites] If no like, it show all postIf an empty array is passed in as the
post__inparameter, the WP_Query returns all posts. (see the NOTE under posts and page parameters in the docs).To prevent that, you can check if there are favorites before performing the query. I’ve updated the example Gist to include this check:
Forum: Plugins
In reply to: [Simple Locator] Simple Locator causes website to crashVersion 1.2.0+ requires PHP version 5.4+.
It sounds like your server is running an older version of PHP. To continue using the plugin, you can downgrade to version 1.1.5.
Forum: Plugins
In reply to: [Favorites] Featured imageThere is not a “built-in” shortcode to include the featured image in the generated list of favorites.
I would suggest building your own WP query. You’ll have all the normal functions available, including
the_post_thumbnailForum: Plugins
In reply to: [Favorites] How to get post id in template??If I understand your question correctly, you can use the
get_user_favoritesfunction to fetch the current user’s favorites. It returns an array of post IDs they have favorited.Forum: Plugins
In reply to: [Simple Locator] Language QuestionThere’s no shortcode parameter currently that’ll change that text. I’ll add it in a list of to-dos for the next release.
If you’re comfortable with Javascript, there is a function you can hook into if there are no results:
wpsl_no_results(location, active_form){ // Perform custom actions here }Forum: Plugins
In reply to: [Simple Locator] Language QuestionYou can pass in a shortcode option to change the label text:
[wp_simple_locator addresslabel="Search by Zip Code or City, State"]The upcoming release will have a placeholder option as well, for the input placeholder.
The button text can be changed as well:
[wp_simple_locator addresslabel="Search by Zip Code or City, State" buttontext="Your Custom Button Text Here"]Forum: Plugins
In reply to: [Simple Locator] https errorsThis should be resolved in the latest release. All calls to the Google Maps API are now made over https.
If that doesn’t fix it (and you’re still using the plugin), it may be a conflict with another plugin. I’m running this plugin on SSL enabled sites without issue.
Forum: Plugins
In reply to: [Simple Locator] Location categories?Sure, just place this in your theme’s functions.php:
Forum: Plugins
In reply to: [Nested Pages] Don't Want Nested Pages to Be Children of Parent in URLIf you’ve already changed the page structure, disabling the nesting option isn’t going to undo that.
You’ll need to enable nesting, reorder the pages, then disable it.
From there, you’ll still be able to drag pages around, but not outside of their parent (so URL structures will remain intact).