• Resolved dimabuko

    (@dimabuko)


    I need to give possibility to another user to moderate UGC content.
    In FAQ I found that I need to paste this code to functions.php for my child theme:

    add_filter( 'fu_manage_permissions', create_function( '$cap', 'return "edit_others_posts"; ) );

    But after that I had an error:

    Parse error: syntax error, unexpected 'wp_enqueue_scripts' (T_STRING) in /home/www/lililove.me/wp-content/themes/twentysixteen-child/functions.php on line 3

    What I’m doing wrong?

    https://wordpress.org/plugins/frontend-uploader/

Viewing 1 replies (of 1 total)
  • Plugin Author Rinat

    (@rinatkhaziev)

    Looks like you’re missing trailing '.
    This should do:

    add_filter( 'fu_manage_permissions', create_function( '$cap', 'return "edit_others_posts";' ) );

    On a side note, create_function() is considered extremely bad practice due to performance and security implications. If you’re on PHP 5.3+ you can use anonymous function like that:

    add_filter( 'fu_manage_permissions', function( $cap ) { return 'edit_others_posts'; });

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with Fu_manage_permissions’ is closed to new replies.