Got a site where users can leave short remarks directly from front page (similar to Twitter). Users have no access to the WP dashboard. I wish to add a ‘sticky’ button that allows users to make one of their remarks sticky. Then when the user’s individual page is loaded I wish to display that sticky on top of the user’s page.
Any suggestions how I can accomplish this?
The page I need help with: [log in to see the link]
The default sticky functionality stores the sticky post’s ID as an option value. You’ll want to do something similar, storing sticky IDs as user meta. Use the “option_sticky_posts” filter to fool WP_Query into thinking the user’s sticky selection is the site’s sticky selection by using the page owner’s values in place of the site’s.
Buttons don’t reflect a true/false state very well. I recommend using a check box field to indicate sticky status. The chosen state can be saved when the remark is first published. If the remark is already published, the sticky state could be changed via Ajax request triggered by the field’s change event.