August 18, 2011 at 1:24 am #4093
I read a comment about bookmark placement and you recommended turning off bookmarks from the plugin then adding your own filter for placement. Well, only problem is that when you turn off bookmarking via the plugin and then go to view bookmarks, it says bookmarking is disabled. Didnt even get to the point of writing a filter because this breaks the whole point.
Any way you can write a simple function and add this functionality please? It would be very beneficial to developers. Thanks.August 19, 2011 at 12:01 am #35637
Can you please post a link to the post your referring to so I can catch up?August 19, 2011 at 5:15 am #35638August 19, 2011 at 11:42 pm #35639
Thank you… a lot of users were just embedding the bookmark shortcodes without enabling the features so we added that check.
You can turn check off just by tweaking one line. Open the “eMember_bookmark_utils.php” file and search for the following line of code:
if(!$enable_bookmark) return EMEMBER_BOOKMARK_DISABLED;
once you find it simply delete that line and it won’t do that check anymore.
The filter you need to add is for the following function (this function show the bookmark buttons):
The above function name has a typo but the computer does’t care about thatAugust 20, 2011 at 12:20 am #35640
Updated the function name to correct the typo. So now the function name is:
bookmark_handlerAugust 20, 2011 at 2:52 am #35641
Thanks admin.August 20, 2011 at 3:08 am #35642
What am I supposed to declare for argument 1? There is just one argument, which is $content, and its being defined in the function I thought.August 20, 2011 at 3:08 am #35643
What am I supposed to declare for argument 1? There is just one argument, which is $content, and its being defined in the function I thought.August 20, 2011 at 7:30 am #35644
$content will be the content of the post that will be passed down to that function by WordPress (you don’t have to call that function… it will get called automatically by WordPress). That function essentially appends the bookmark button in the post content.
So you can either modify that function itself or remove that function from the plugin and add in the same function name with your custom code in your theme’s function.php file.
If you want to just customize the location of the bookmark button then use this tweak:August 20, 2011 at 2:26 pm #35645
Right, thats what I thought because I saw the global call.
I was trying to add it as a function instead of hooking it.
I.e. if member is logged in, do function boomark_handler();
I want the exact same function, just want to be able to place it wherever I want, in my case, the sidebar.August 20, 2011 at 10:34 pm #35646
By default, eMember has the following call… it adds the bookmark to the post content
Simply call this function and pass the content of the widget and it will add the bookmark button to that widget.
With that said, I can see what you are trying to do but it may not be possible. You are trying to add bookmark button to the sidebar but the sidebar is outside the WordPress main loop. You cannot do post specific actions outside the WordPress loop because the data is not available there. So yes it will add a bookmark button but when you click on it it needs to save the ID of the post and that information is not available outside the WordPress loop. Not all WordPress filters and hooks work outside the loop.August 21, 2011 at 4:49 pm #35647
I see. Thought I could recall the_post, but I guess not.
I’m trying to hook it and it still won’t work. Ah well.
- You must be logged in to reply to this topic.