Support Forum
Hi!
My blog mostly contains contributor roles, who cannot publish posts, but can send them for activation to administrators.
So they are not able to create linked posts at all, because metabox for linked posts appears only to users who are allowed to publish posts.
I made a litle fix for this, it would be great if this could be included in next version:
# sf_blog_link_form()
#
# Filter call
# Sets up the forum post linking form in the Post/Page Write screen
# ------------------------------------------------------------------
function sf_blog_link_form()
{
global $current_user;
if(function_exists('add_meta_box'))
{
sf_initialise_globals();
# can the user do this?
if (!$current_user->sflinkuse) return;
//if(current_user_can('publish_posts'))
if(current_user_can('create_linked_posts'))
{
add_meta_box('sfforumlink', esc_attr(__("Link To Forum", "sforum")), 'sf_populate_post_form', 'post', 'advanced');
}
if(current_user_can('publish_pages'))
{
add_meta_box('sfforumlink', esc_attr(__("Link To Forum", "sforum")), 'sf_populate_post_form', 'page', 'advanced');
}
}
return;
}
and this also creates a new wp capability? how was that added? another plugin? and btw, you should be able to put that in your functions.php file of your theme and be good to go... hopefully, with plugins on the plan for 5.0, this would be a nice example of one!
Visit Cruise Talk Central and Mr Papa's World
no, it doesn't create new capability, but it isn't hard to write a script that does it. I created capability with Role Manager plugin.
Thanks for advice! I added following code to my themes functions.php, you are welcome to correct my code because I am a beginner in PHP:
Anyway, it would be nice, if you could include this in next release, because I am probably not the only one who needs this.
PS. Can't understand whats wrong with code formatting.
1 Guest(s)