Support Forum
Hi simple-press community.
I'm looking for a way to add contents programmatically to a post/reply. I need something like a button , visible by administrators, that redirects to the mycred_edit_balance admin page where i can "adjust"arbitrarily the amount of mycred points for the post/reply author.
Is there any action/filter that i can use to add such functionality?
should i use child theme instead?
Thank in advance
not entirely sure I follow what you want to do... you just want to add a button that links to a mycred page?
if so, have you looked at: https://simple-press.com/docum.....addbutton/
lets you add a standard button linking to where ever you want...
if you only want it shown to admins, then something like:
if ($spThisUser->admin) sp_AddButton();
of course, adjust arguments to the function call to meet your needs...
If this is not what you meant, please elaborate...
Visit Cruise Talk Central and Mr Papa's World
Thank you very much!
It's exactly what i was looking for. It is the button i've created using an action :
add_action('sph_BeforeSectionEnd_action', function() { global $spThisPost,$spThisUser; if ($spThisUser->admin) { sp_AddButton(sp_AddButton('tagClass=spButton spRight&icon=sp-logo-tiny.png&link='.urlencode('/wp-admin/users.php?page=mycred-edit-balance&user_id='.$spThisPost->user_id.'&ctype=mycred_default'), __('Adjust Points'), __('Adjust Points for this user'), 0, 'spLogoButton')); } });
1 Guest(s)