Skip to content

Instantly share code, notes, and snippets.

@annuman97
annuman97 / fluent-community-moderator-post-approval.php
Last active November 23, 2026 09:20
Custom PHP snippet for Fluent Community Pro that requires global moderators' posts to be reviewed and approved by an administrator before publication. Prevents moderators from approving their own or other moderators' posts while preserving existing moderation permissions for regular member posts. Requirements: Fluent Community Pro with Content M…
/**
* Fluent Community Free + Pro 2.9.1
* Require admin approval for global moderator posts.
*/
if (!function_exists('fcma_is_global_moderator_291')) {
function fcma_is_global_moderator_291($user_id) {
if (
@annuman97
annuman97 / README.md
Last active November 16, 2026 06:38
Sync the WordPress Nickname to FluentCommunity’s public profile name

WordPress Nickname → FluentCommunity public name

This snippet uses a member’s WordPress Nickname as their public name in FluentCommunity. Members edit the nickname in their WordPress user profile; it does not add a field to FluentCommunity.

Install

  1. Add the PHP code as a site-wide FluentSnippets snippet. Omit the <?php tag if FluentSnippets supplies it.
  2. Save an existing member’s WordPress profile once to sync their nickname.
  3. Check their Community profile and the PHP error log.
@annuman97
annuman97 / fluent-forms-qa-post-sync.php
Created September 22, 2026 05:48
Automatically sync Question and Answer fields from Fluent Forms entries to WordPress posts created through the Post Creation Feed. Updates the existing post content when an admin edits the entry and adds an answer, without creating duplicate posts.
<?php
/**
* Fluent Forms: Question & Answer Post Sync
*
* Works with the existing Post Creation Feed.
* Replace 123 with your form ID.
*/
if (!defined('ABSPATH')) {
exit;
@annuman97
annuman97 / fluentcommunity-course-reset-action.php
Created August 26, 2026 10:14
It will create a custom FluentCRM Trigger named 'Reset Course Progress' that will reset the course progress for a user
<?php
add_action('init', function () {
if (
!defined('FLUENTCRM') ||
!class_exists('\FluentCrm\App\Services\Funnel\BaseAction') ||
!class_exists('\FluentCommunity\Modules\Course\Services\CourseHelper') ||
!class_exists('\FluentCommunity\Modules\Course\Model\Course') ||
!class_exists('\FluentCommunity\App\Models\User')
@annuman97
annuman97 / fluentcommunity-custom-waitlist-fluentcrm-tagging.php
Created August 7, 2026 13:37
Upon clicking a Gutenberg button from custom lock screen Description section, user will be added to a CRM tag.
<?php
/**
* Add the user to a FluentCRM tag when a private-space request is submitted.
*/
add_action('fluent_community/space/join_requested', function ($space, $userId, $by) {
if (!defined('FLUENTCRM')) {
return;
}
// Space slug => FluentCRM Tag ID
@annuman97
annuman97 / fluentcommunity-friendly-anonymous-usernames.php
Created July 2, 2026 11:47
Temporary FluentCommunity workaround to generate friendly anonymous WordPress usernames during default signup, helping prevent email-derived usernames from being exposed in mentions or profile UI.
<?php
defined('ABSPATH') || exit;
/**
* Modify FluentCommunity signup fields.
*/
add_filter('fluent_community/auth/signup_fields', function ($fields) {
if (isset($fields['full_name'])) {
/**
* Ninja Tables - Current Month Date Range Filter
*
* Automatically applies the current month date range
* to a Ninja Tables custom date range filter on page load.
*
* Date Format: DD/MM/YYYY
*
* Example:
* From Date: 01/06/2026
/*
# Ninja Tables FooTable Pagination at Top
Moves the existing FooTable pagination controls in Ninja Tables / Ninja Tables Pro from the table footer to above the table.
This is intended for Ninja Tables using the default FooTable renderer.
## Usage
1. Add `JS` to the table's Custom JS field.
@annuman97
annuman97 / fluentforms-preserve-plus-email-redirect.php
Created May 20, 2026 05:44
Temporary Fluent Forms workaround to preserve plus-addressed email values in redirect query strings.
<?php
// Temporary Fluent Forms workaround:
// Preserve plus-addressed emails when passing email through redirect query string.
add_filter('fluentform/submission_confirmation', function ($returnData, $form, $confirmation, $insertId = null, $formData = []) {
$sourceFormId = 29; // Form #1 ID
$emailFieldName = 'email'; // Form #1 email field name
$queryKey = 'email'; // Redirect URL query key: ?email=
if ((int) $form->id !== $sourceFormId || empty($returnData['redirectUrl'])) {
@annuman97
annuman97 / fluentcommunity-basic-pwa-snippet.php
Created May 19, 2026 11:51
A basic PWA snippet for FluentCommunity portal that adds a web app manifest, service worker registration, app-like home screen support, and a simple offline fallback. This is a temporary/basic PWA wrapper and does not include FluentCommunity push notification handling.
<?php
if (!function_exists('fcom_snippet_pwa_portal_start_url')) {
add_action('init', function () {
$fcomPwa = isset($_GET['fcom_pwa']) ? sanitize_key($_GET['fcom_pwa']) : '';
if ($fcomPwa === 'manifest') {
fcom_snippet_pwa_serve_manifest();
}
if ($fcomPwa === 'sw') {