Search Results for 'code'
-
Search Results
-
Is there a way to redirect all profile page links so they use the user id, instead of user login/nicename? Some users have their email as their username, so we want to hide it.
So to go from
/forums/users/{login}to
/forums/users/{id}I was able to change the URLs so they point to the right place:
function bbp_custom_author_link( $url, $user_id, $user_nicename){ $url = site_url()."/forums/users/".$user_id; return $url; } add_filter( 'bbp_get_user_profile_url', 'bbp_custom_author_link', 10, 3);
But once you click on the link, you end up in a 404.
Hi,
I’m trying to customise the toolbar in TinyMCE.Initially I just enabled the advanced one:
function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = true; $args['teeny'] = false; $args['quicktags'] = false; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
I thought of adding a button for underline and it led to trying to get only what I needed in one toolbar:
function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = array('toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, strikethrough, forecolor, outdent, indent, undo, redo'); $args['quicktags'] = false; $args['teeny'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
This is causing it to repeat some things in toolbar 2 (as well as the ability to toggle toolbar 2 on and off). I tried adding toolbar 2 to the code above, but then it goes back to default. I could stop there though and just add underline and the tools that’s in toolbar 1 by default, but I’m curious if I can customise things further.
To my question:
Is there a way to add everything in one toolbar and then disable toolbar 2?
Or is there a way to get the toogle for toolbar 2 back when I’ve customised toolbar 1?I also tried enabling teeny which would’ve worked best, but then I lose the forecolor toolbar box so I’d need a way to add it back.
Thanks in advance