pxnji not yet, but I'm working on adding this in a future update.
Right now the only solution is to disable and re-enable comments on each Wordpress post. This could be achieved with a script but it's definitely not optimal.
pxnji not yet, but I'm working on adding this in a future update.
Right now the only solution is to disable and re-enable comments on each Wordpress post. This could be achieved with a script but it's definitely not optimal.
I purchased the extension and installed it for my forum https://discuss.mzacademy.net/. So far I love it. I just have a quick question. For the "Change email and password on main website" option, is it possible to replace wp-admin with my custom directory?
Also I noticed that when I sign in with a WordPress account with subscriber role, it redirects to /my-profile/ page, how do I change this? Thank you
aksh is it possible to replace wp-admin with my custom directory
There is no option in the UI for that, but you can modify the URL using this code added to your extend.php
at the root of Flarum (it must be added inside the existing array).
<?php
use Flarum\Extend;
return [
// Register extenders here to customize your forum!
(new Extend\ApiSerializer(\Flarum\Api\Serializer\ForumSerializer::class))
->attribute('kilowhatWordpressProfileLink', function () {
return resolve('flarum.settings')->get('kilowhat-wordpress.wordpress_url') . '/wp-admin/profile2.php';
}),
];
The part resolve('flarum.settings')->get('kilowhat-wordpress.wordpress_url')
can also be directly hard-coded to your Wordpress domain.
The reason I'm not making this a setting is because it wouldn't solve everything, since some systems will need to dynamically change the URL depending on the user, and those will require a special bit of code anyway.
aksh it redirects to /my-profile/
This is likely something Wordpress or a wordpress plugin is doing. This URL isn't present in the source code of the Wordpress extension.
That's another reason I have not made the profile URL customizable, it's because a lot of Wordpress plugins already automatically redirect the default user settings page.
Renamed wp-admin
folders should be compatible but that's not something I have been testing in production so please let me know if you find any issue, I'll be happy to get it fixed!
There's one other place where wp-admin
is hard-coded, it's the link in the Flarum user edit modal that allows a moderator/admin to directly go to the Wordpress user edit page. Let me know if you need the custom code to edit that one.
I could add a setting to provide a custom wp-admin
path. The potential problem is that it would get exposed to any user who logged with Wordpress since it would be part of their profile edit URL.
Thanks @clarkwinkelmann, I found out the issue and successfully resolved it.
Is there a way to remove the "Log in with WordPress" option when logging in with this extension that I'm missing? I'm using it in conjunction with FoF OAuth, and I can't see any WordPress options in that extension - so I'm assuming it's coming from this WordPress extension. Apologies if it's not.
SSO integration is disabled.
Thanks
JamminMB thanks for the report! There's indeed an issue, the button is always visible.
I'll fix this in the next update. In the meantime you can hide the button with CSS using:
.LogInButton--wordpress {
display: none;
}
clarkwinkelmann thank you
KakaLVPOT hello,
I believe what you're describing is possible using this extension. You don't have to use the SSO feature. You can just enable comments and disable Wordpress registration, and users will be able to comment by creating accounts through Flarum.
If you're looking for a free solution, this might be already possible using the Flarum Embed extension and some existing Wordpress plugin or a custom theme to insert the additional HTML.
I'm not planning to release any free version of this extension at this time. And I wouldn't release a version that requires manually creating a discussion for each post, that seems just too inconvenient and open for user errors if it's any website that publishes regularly. And as soon as we add some convenience features it already gets pretty close to this paid version.
If by manually assigning discussion you mean you might want some posts to have Flarum comments and others to keep native comments, then that's unfortunately also not possible in the current version and I don't plan to add a toggle for each post to enable Flarum discussion. But something I could add is a custom shortcode to embed an arbitrary Flarum discussion inside a Wordpress post, which could be used while the automatic comments integration is turned off.
I'm planning an overhaul to the embed style, which I might release as a standalone extension/library in the future, so this could be used for customized integrations with Wordpress or other CMSes in the future.
Is there a way to disable redirect on logout (e.g. setting skip_wordpress_logout=0) without modifying the wp plugin?
Currently it redirects me to the forum after successful logout for some reason and it shows "Do you want to log out from the forum" message
tbb where do you want the user to end up?
The way it's implemented, the user always ends up on the Wordpress logout page, whether you click logout from Wordpress or from Flarum. At least one redirect is necessary to logout from both Wordpress or Flarum. There are two redirects when logging out from Wordpress to end up back on Wordpress again.
I could add an option so the user stays on the app they were before logout (if on Wordpress, end up on Wordpress logout, if on Flarum, end on on Flarum homepage), or maybe an option to specify a custom redirect URL after logout?
EDIT: based on your edit: that shouldn't happen. Are the two apps on the same domain or same base domain? Do you have the cookie domain configured to the correct common domain between the two apps?
clarkwinkelmann You're correct to assume that - forum is on parent domain (domain.com/forum) while logout happens on (sub.domain.com). Would that cause the logout confirmation in flarum?
tbb it should work if the "cookie domain" setting is set to "domain.com".
If that doesn't help maybe you can share your forum domain with me (you can send privately via email or Discord) so I can check if anything else looks off.
Most of the other issues that could cause this should be caught by the "health report" on the Flarum settings page. (For example if the Flarum domain is different in config.php
and in Wordpress plugin configuration).
There could also be a conflict with another extension regarding the logout endpoint, but I don't know of any other extension that customizes the logout endpoint.
Thanks Clark,
Quick note: if you have some other plugin displaying your login form (e.g. Restrict Content Pro), you should keep Wordpress login path in Flarum set to wp-login.php otherwise the popup stays open after successful login and the forum doesn't refresh.
Everything works fine apart from that logout issue that still shows me Flarum "Are you sure you want to log out?" page. This is just a temporary setup with those sub/domains so I'm guessing that's what causes the issue (perhaps cookie related as you mentioned)
KakaLVPOT I'm not against adding an option to replace the linked discussion. More control could definitely be more beneficial here! What I don't particularly like would be to only give manual control. Because invariably people will have issues understanding how to use it, will ask questions, etc when automating might have solved the issue in the first place. I'm also not sure what would happen if the same discussion is set for two different posts.
You can absolutely use the comments integration of this extension without SSO. Just disable SSO option. The comments iframe will prompt to login with Flarum when replying. To hide the register/login links from Wordpress completely, you can disable registration in Wordpress settings, and you could customize the theme to completely hide the login link if you don't want users to confuse the two login pages.
KakaLVPOT I have disabled SSO on the demo website so you can see how it looks: https://wordpress-flarum-demo.http418.ch/2020/04/18/demo-post-on-wordpress/ The login modal appears inside the iframe. The user will be logged in Flarum in both iframe and non-iframe views.
The state of login between iframe and non-iframe should always be synced. You might need to adjust the cross origin policy if your Wordpress and Flarum are on different domains, but that will work.
There's a known issue with the SSO login still being visible in the Flarum login modal but this will be fixed very soon.
There's currently no redirection, but a future version of the extension might include an option to force users to use comments on the Flarum side and make the iframe only a summary.
Is there a way to redirect user to login screen instead of a popup? I will manage redirects back to the forum on the other side.
tbb not at the moment, no.
Using the modal or respectively popup allows preserving the original Flarum behavior of staying on the same page and just refreshing after login. Also it's required if you still allow other non-SSO login methods.
Where would you like the login page to be opened? From inside the iframe embed, or also when clicking login or new discussion from Flarum?
clarkwinkelmann basically just redirecting to my default login page where I would do custom redirect back to the forum to "forum/auth/wordpress". The problem of full redirect is the fact that you would need to provide me with the target URL for redirect, not just forum/auth/wordpress. It's not a massive issue, but if this was possible it would be great.
KakaLVPOT Comments at most cases display from-bottom-to-top - last comments at top
I have been experimenting with reversing the post stream, I'm not sure yet if I will get it working. I was planning to release this as a standalone extension that has an option to apply to the whole forum or just the Wordpress embed. But I hit a few issues and it's been on hold for a while. Hopefully I can get back to it at some point.
KakaLVPOT I'm very scared about absent of the topic navigation
Yes unfortunately the "scrubber" is not present in the embed. This is a design decision I copied from Flarum's embed extension, but it's true that it would be useful to still have access to it somehow.
The idea was to provide a minimal look in the embed, and allow navigating to the forum for full experience. The full page can be accessed by clicking the "Comments [number]" title in the embed, but maybe there should be another more obvious button to access the forum.
I am working on an improved embed, but I'm still testing what works and what doesn't. Flarum's infinite scrolling makes it hard to design the iframe in a way that doesn't look like a box.
Regarding tree comments, if an extension implements that feature I will do my best to make it compatible, but that's not something this extension would implement in itself. The goal wasn't to imitate Wordpress comments, it's to provide a different experience similar to what you have on Flarum itself.