Plugin Directory

Changeset 3306743


Ignore:
Timestamp:
06/04/2025 09:51:27 PM (10 months ago)
Author:
nsinelnikov
Message:

Update to version 2.1.4 from GitHub

Location:
forumwp
Files:
6 deleted
33 edited
1 copied

Legend:

Unmodified
Added
Removed
  • forumwp/assets/blueprints/blueprint.json

    r3205107 r3306743  
    1616            "pluginZipFile": {
    1717                "resource": "url",
    18                 "url": "https:\/\/downloads.wordpress.org\/plugin\/forumwp.2.1.3.zip"
     18                "url": "https:\/\/downloads.wordpress.org\/plugin\/forumwp.2.1.4.zip"
    1919            },
    2020            "options": {
  • forumwp/tags/2.1.4/assets/front/js/topic-popup.js

    r3205107 r3306743  
    7777
    7878        form.find('input, #wp-fmwptopiccontent-wrap').removeClass('fmwp-error-field').removeAttr('title');
     79
     80        data = wp.hooks.applyFilters( 'fmwp_topic_popup_submitted_data', data, form );
    7981
    8082        fmwp_set_busy( 'topic_popup', true );
  • forumwp/tags/2.1.4/assets/front/js/topic-popup.min.js

    r3205107 r3306743  
    1 jQuery(document).ready(function(r){var i,e,o;r(document.body).on("click","#fmwp-topic-popup-preview-action",function(){var p=r(this).parents("#fmwp-topic-popup-editors");p.hasClass("fmwp-topic-popup-preview-hidden")?(p.removeClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("hide_label")),r("#fmwptopiccontent-preview").html(r("#fmwptopiccontent").val())):(p.addClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("show_label"))),fmwp_resize_popup()}),r(document.body).on("click",".fmwp-topic-popup-discard",function(){var t;fmwp_is_busy("topic_popup")||(t=r(this).parents("#fmwp-topic-popup-wrapper")).hide(1,function(){t.find("form")[0].reset(),r("#fmwptopiccontent").val(""),r("#fmwptopiccontent-preview").html(""),t.removeClass("fmwp-fullsize");var p=t.find("#fmwp-topic-popup-preview-action");p.html(p.data("hide_label")),t.find("#fmwp-topic-popup-editors").removeClass("fmwp-topic-popup-preview-hidden")})}),r(document.body).on("click",".fmwp-topic-popup-submit",function(p){var s,n,t,i,e,a,c,f;p.preventDefault(),fmwp_is_busy("topic_popup")||((s=r(this)).siblings(".fmwp-ajax-loading").css("visibility","visible").show(),s.css("visibility","hidden"),n=r("#fmwp-topic-popup-wrapper"),p=r(this).parents("form"),t=p.serializeArray(),i="undefined"!=typeof tinymce?tinyMCE.get("fmwptopiccontent").getContent({format:"raw"}):r("#fmwptopiccontent").val(),e={},r.each(t,function(p){"fmwp-topic[content]"===t[p].name?e[t[p].name]=i:e[t[p].name]=t[p].value}),a=e["fmwp-topic[forum_id]"],c=e["fmwp-topic[topic_id]"],f="edit-topic"===e["fmwp-action"]?"fmwp_edit_topic":"fmwp_create_topic",p.find("input, #wp-fmwptopiccontent-wrap").removeClass("fmwp-error-field").removeAttr("title"),fmwp_set_busy("topic_popup",!0),wp.ajax.send(f,{data:e,success:function(t){if("fmwp_edit_topic"==f){var i=n.data("fmwp-target"),p=t,e=c;"forum-page"===i||"topics-page"===i?(o=wp.template("fmwp-topic")(p),r(".fmwp-topics-wrapper").find('.fmwp-topic-row[data-topic_id="'+e+'"]').replaceWith(o)):"topic-page"===i&&(r(".fmwp-topic-title").html(p.title),r(".fmwp-topic-data-content").html(p.content),r(".fmwp-topic-stats.fmwp-tags-stats").length&&(e=wp.template("fmwp-topic-tags-line")(p.tags),r(".fmwp-topic-stats.fmwp-tags-stats").html(e)),wp.hooks.doAction("fmwp_after_edit_topic",p))}else{var o=t,i=a;o=wp.template("fmwp-topic")(o);let p=(i=r('.fmwp-topics-wrapper[data-fmwp_forum_id="'+i+'"]')).find(".fmwp-forum-sort:visible").val();i.length||(i=r(".fmwp-archive-topics-wrapper .fmwp-topics-wrapper"),p=r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible").val()),"date_desc"===p?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").length?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-pinned:last").length?i.find(".fmwp-topic-row.fmwp-topic-pinned:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-global:last").length?i.find(".fmwp-topic-row.fmwp-topic-global:last").after(o):i.prepend(o):"date_asc"===p&&i.append(o),i.find(".fmwp-forum-no-topics").length&&i.find(".fmwp-forum-no-topics").remove(),i.find(".fmwp-topic-actions-dropdown").length?i.siblings(".fmwp-topics-wrapper-heading").removeClass("fmwp-no-actions-heading"):i.siblings(".fmwp-topics-wrapper-heading").addClass("fmwp-no-actions-heading")}fmwp_set_busy("topic_popup",!1),r(".fmwp-topic-popup-discard:first").trigger("click"),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible");e=r('.fmwp-forum-head[data-fmwp_forum_id="'+a+'"]');(e.length?e.find(".fmwp-forum-sort:visible"):r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible")).trigger("change")},error:function(t){t.errors?r.each(t.errors,function(p){jQuery("#"+t.errors[p].field).addClass("fmwp-error-field").attr("title",t.errors[p].message)}):(console.log(t),r(this).fmwp_notice({message:t,type:"error"})),fmwp_set_busy("topic_popup",!1),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible")}}))}),r(document.body).on("keyup","#fmwptopiccontent",(i=function(p){var t;r(this).parents("#fmwp-topic-popup-editors").hasClass("fmwp-topic-popup-preview-hidden")||fmwp_is_busy("topic_popup_preview")||(t=fmwp_stringToHash(this.value))!=r(this).data("content-hash")&&(r(this).data("content-hash",t),fmwp_set_busy("topic_popup_preview",!0),wp.ajax.send("fmwp_topic_build_preview",{data:{content:this.value,nonce:fmwp_front_data.nonce},success:function(p){r("#fmwptopiccontent-preview").html(p),fmwp_set_busy("topic_popup_preview",!1)},error:function(p){console.log(p),r(this).fmwp_notice({message:p,type:"error"}),fmwp_set_busy("topic_popup_preview",!1)}}))},e=1e3,o=0,function(){var p=this,t=arguments;clearTimeout(o),o=setTimeout(function(){i.apply(p,t)},e||0)}))});
     1jQuery(document).ready(function(r){var i,e,o;r(document.body).on("click","#fmwp-topic-popup-preview-action",function(){var p=r(this).parents("#fmwp-topic-popup-editors");p.hasClass("fmwp-topic-popup-preview-hidden")?(p.removeClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("hide_label")),r("#fmwptopiccontent-preview").html(r("#fmwptopiccontent").val())):(p.addClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("show_label"))),fmwp_resize_popup()}),r(document.body).on("click",".fmwp-topic-popup-discard",function(){var t;fmwp_is_busy("topic_popup")||(t=r(this).parents("#fmwp-topic-popup-wrapper")).hide(1,function(){t.find("form")[0].reset(),r("#fmwptopiccontent").val(""),r("#fmwptopiccontent-preview").html(""),t.removeClass("fmwp-fullsize");var p=t.find("#fmwp-topic-popup-preview-action");p.html(p.data("hide_label")),t.find("#fmwp-topic-popup-editors").removeClass("fmwp-topic-popup-preview-hidden")})}),r(document.body).on("click",".fmwp-topic-popup-submit",function(p){var s,n,t,i,e,a,c,f;p.preventDefault(),fmwp_is_busy("topic_popup")||((s=r(this)).siblings(".fmwp-ajax-loading").css("visibility","visible").show(),s.css("visibility","hidden"),n=r("#fmwp-topic-popup-wrapper"),p=r(this).parents("form"),t=p.serializeArray(),i="undefined"!=typeof tinymce?tinyMCE.get("fmwptopiccontent").getContent({format:"raw"}):r("#fmwptopiccontent").val(),e={},r.each(t,function(p){"fmwp-topic[content]"===t[p].name?e[t[p].name]=i:e[t[p].name]=t[p].value}),a=e["fmwp-topic[forum_id]"],c=e["fmwp-topic[topic_id]"],f="edit-topic"===e["fmwp-action"]?"fmwp_edit_topic":"fmwp_create_topic",p.find("input, #wp-fmwptopiccontent-wrap").removeClass("fmwp-error-field").removeAttr("title"),e=wp.hooks.applyFilters("fmwp_topic_popup_submitted_data",e,p),fmwp_set_busy("topic_popup",!0),wp.ajax.send(f,{data:e,success:function(t){if("fmwp_edit_topic"==f){var i=n.data("fmwp-target"),p=t,e=c;"forum-page"===i||"topics-page"===i?(o=wp.template("fmwp-topic")(p),r(".fmwp-topics-wrapper").find('.fmwp-topic-row[data-topic_id="'+e+'"]').replaceWith(o)):"topic-page"===i&&(r(".fmwp-topic-title").html(p.title),r(".fmwp-topic-data-content").html(p.content),r(".fmwp-topic-stats.fmwp-tags-stats").length&&(e=wp.template("fmwp-topic-tags-line")(p.tags),r(".fmwp-topic-stats.fmwp-tags-stats").html(e)),wp.hooks.doAction("fmwp_after_edit_topic",p))}else{var o=t,i=a;o=wp.template("fmwp-topic")(o);let p=(i=r('.fmwp-topics-wrapper[data-fmwp_forum_id="'+i+'"]')).find(".fmwp-forum-sort:visible").val();i.length||(i=r(".fmwp-archive-topics-wrapper .fmwp-topics-wrapper"),p=r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible").val()),"date_desc"===p?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").length?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-pinned:last").length?i.find(".fmwp-topic-row.fmwp-topic-pinned:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-global:last").length?i.find(".fmwp-topic-row.fmwp-topic-global:last").after(o):i.prepend(o):"date_asc"===p&&i.append(o),i.find(".fmwp-forum-no-topics").length&&i.find(".fmwp-forum-no-topics").remove(),i.find(".fmwp-topic-actions-dropdown").length?i.siblings(".fmwp-topics-wrapper-heading").removeClass("fmwp-no-actions-heading"):i.siblings(".fmwp-topics-wrapper-heading").addClass("fmwp-no-actions-heading")}fmwp_set_busy("topic_popup",!1),r(".fmwp-topic-popup-discard:first").trigger("click"),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible");e=r('.fmwp-forum-head[data-fmwp_forum_id="'+a+'"]');(e.length?e.find(".fmwp-forum-sort:visible"):r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible")).trigger("change")},error:function(t){t.errors?r.each(t.errors,function(p){jQuery("#"+t.errors[p].field).addClass("fmwp-error-field").attr("title",t.errors[p].message)}):(console.log(t),r(this).fmwp_notice({message:t,type:"error"})),fmwp_set_busy("topic_popup",!1),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible")}}))}),r(document.body).on("keyup","#fmwptopiccontent",(i=function(p){var t;r(this).parents("#fmwp-topic-popup-editors").hasClass("fmwp-topic-popup-preview-hidden")||fmwp_is_busy("topic_popup_preview")||(t=fmwp_stringToHash(this.value))!=r(this).data("content-hash")&&(r(this).data("content-hash",t),fmwp_set_busy("topic_popup_preview",!0),wp.ajax.send("fmwp_topic_build_preview",{data:{content:this.value,nonce:fmwp_front_data.nonce},success:function(p){r("#fmwptopiccontent-preview").html(p),fmwp_set_busy("topic_popup_preview",!1)},error:function(p){console.log(p),r(this).fmwp_notice({message:p,type:"error"}),fmwp_set_busy("topic_popup_preview",!1)}}))},e=1e3,o=0,function(){var p=this,t=arguments;clearTimeout(o),o=setTimeout(function(){i.apply(p,t)},e||0)}))});
  • forumwp/tags/2.1.4/forumwp.php

    r3205107 r3306743  
    44 * Plugin URI: https://forumwpplugin.com/
    55 * Description: A full-featured, powerful forum plugin for WordPress
    6  * Version: 2.1.3
     6 * Version: 2.1.4
    77 * Author: ForumWP
     8 * License: GPLv3
     9 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
    810 * Text Domain: forumwp
    911 * Domain Path: /languages
  • forumwp/tags/2.1.4/includes/ajax/class-forum.php

    r3205107 r3306743  
    7676                'title'            => $forum->post_title,
    7777                'permalink'        => get_permalink( $forum->ID ),
    78                 'author'           => FMWP()->user()->display_name( $author ),
    79                 'author_url'       => FMWP()->user()->get_profile_link( $author->ID ),
    80                 'author_avatar'    => FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ),
     78                'author'           => $author ? FMWP()->user()->display_name( $author ) : '',
     79                'author_url'       => $author ? FMWP()->user()->get_profile_link( $author->ID ) : '',
     80                'author_avatar'    => $author ? FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ) : '',
    8181                'last_upgrade'     => $last_upgrade,
    8282                'strip_content'    => $strip_content,
     
    9292                'is_locked'        => FMWP()->common()->forum()->is_locked( $forum->ID ),
    9393                'is_trashed'       => FMWP()->common()->forum()->is_trashed( $forum->ID ),
     94                'extra_classes'    => '',
    9495            );
    9596
  • forumwp/tags/2.1.4/includes/ajax/class-reply.php

    r3182324 r3306743  
    5050            $dropdown_actions = FMWP()->common()->reply()->actions_list( $reply );
    5151
    52             $author_url = FMWP()->user()->get_profile_link( $author->ID );
    53 
    54             $slug = FMWP()->user()->maybe_get_slug( $author->ID );
    55 
    5652            $beauty_date = '';
    5753            if ( ! FMWP()->common()->reply()->is_pending( $reply->ID ) ) {
     
    6965                'content'          => nl2br( $reply->post_content ),
    7066                'permalink'        => FMWP()->common()->reply()->get_link( $reply->ID ),
    71                 'author'           => FMWP()->user()->display_name( $author ),
    72                 'author_url'       => $author_url,
    73                 'author_avatar'    => FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ),
     67                'author'           => $author ? FMWP()->user()->display_name( $author ) : '',
     68                'author_url'       => $author ? FMWP()->user()->get_profile_link( $author->ID ) : '',
     69                'author_avatar'    => $author ? FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ) : '',
    7470                'date'             => $date,
    7571                'beauty_date'      => $beauty_date,
     
    8076                'more_answers'     => count( $child ) > 2,
    8177                'total_replies'    => $total_child,
    82                 'mention'          => '@' . $slug,
     78                'mention'          => $author ? '@' . FMWP()->user()->maybe_get_slug( $author->ID ) : '',
    8379                'is_trashed'       => FMWP()->common()->reply()->is_trashed( $reply->ID ),
    8480                'can_edit'         => $can_edit,
    8581                'author_tags'      => FMWP()->common()->reply()->get_author_tags( $reply ),
    86                 'author_card'      => FMWP()->user()->generate_card( $author->ID ),
     82                'author_card'      => $author ? FMWP()->user()->generate_card( $author->ID ) : '',
    8783                'is_locked'        => FMWP()->common()->reply()->is_locked( $reply ),
    88                 'is_author'        => ( is_user_logged_in() && get_current_user_id() === $author->ID ),
     84                'is_author'        => is_user_logged_in() && $author && get_current_user_id() === $author->ID,
    8985                'dropdown_actions' => $dropdown_actions,
    9086                'can_actions'      => count( $dropdown_actions ),
  • forumwp/tags/2.1.4/includes/class-fmwp-functions.php

    r3205107 r3306743  
    534534        public function get_template_part( $slug, $args = array(), $module = '' ) {
    535535            global $wp_query;
     536            /**
     537             * Fires just before the algorithm for getting ForumWP custom templates.
     538             *
     539             * Note: Allow 3rd party plugins or modules filter template file, arguments, module name from their side.
     540             *
     541             * @since 2.1.4
     542             * @hook fmwp_change_template_part
     543             *
     544             * @param {string} $slug Template name passed by reference.
     545             * @param {array}  $args          Arguments passed for the template by reference.
     546             * @param {string} $module        Module slug passed by reference. (default: '').
     547             */
     548            do_action_ref_array( 'fmwp_change_template_part', array( &$slug, &$args, &$module ) );
    536549
    537550            $query_title = $this->undash( sanitize_title( $slug ) );
  • forumwp/tags/2.1.4/includes/class-modules.php

    r3161123 r3306743  
    2626         */
    2727        public function __construct() {
    28             add_action( 'forumwp_loaded', array( &$this, 'predefined_modules' ), 0 );
     28            // Register modules here on the early priority and then loading them on the `0` priority in common class.
     29            add_action( 'forumwp_init', array( &$this, 'predefined_modules' ), -1 );
    2930        }
    3031
  • forumwp/tags/2.1.4/includes/common/class-common.php

    r3205107 r3306743  
    2929            add_action( 'plugins_loaded', array( &$this, 'on_plugins_loaded' ), -19 );
    3030
     31            add_action( 'init', array( $this, 'init' ), 0 );
    3132            // loading modules when forumwp is loaded
    32             add_action( 'forumwp_loaded', array( FMWP()->modules(), 'load_modules' ), 1 );
    33 
    34             add_action( 'init', array( $this, 'init' ), 0 );
     33            add_action( 'forumwp_init', array( FMWP()->modules(), 'load_modules' ), 0 );
    3534
    3635            add_action( 'admin_bar_menu', array( &$this, 'toolbar_links' ), 999 );
     
    549548        }
    550549
    551 
    552550        /**
    553551         *
  • forumwp/tags/2.1.4/includes/common/class-forum.php

    r3205107 r3306743  
    3737         */
    3838        public function __construct() {
     39            add_action( 'forumwp_init', array( &$this, 'init_variables' ), 9 );
     40
     41            add_action( 'save_post_fmwp_forum', array( &$this, 'save_post' ), 999997 );
     42
     43            add_filter( 'the_posts', array( &$this, 'filter_private_forums' ), 99 );
     44            add_filter( 'posts_where', array( &$this, 'filter_trashed_for_author' ), 10, 2 );
     45
     46            add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
     47        }
     48
     49        /**
     50         * Initialize variables for the class.
     51         */
     52        public function init_variables() {
     53            // Set visibilities.
    3954            $this->visibilities = array(
    4055                'public'  => __( 'Public', 'forumwp' ),
     
    4358            );
    4459
    45             add_action( 'init', array( &$this, 'init_statuses' ) );
    46 
    47             add_action( 'save_post_fmwp_forum', array( &$this, 'save_post' ), 999997 );
    48 
    49             add_filter( 'the_posts', array( &$this, 'filter_private_forums' ), 99 );
    50             add_filter( 'posts_where', array( &$this, 'filter_trashed_for_author' ), 10, 2 );
    51 
    52             add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
     60            // Set statuses.
     61            $this->post_status = array( 'publish' );
     62            if ( is_user_logged_in() ) {
     63                $this->post_status[] = 'trash'; // will be visible for trash author or `manage_fmwp_forums_all`. See `$this->filter_trashed_for_author()`.
     64                if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
     65                    $this->post_status[] = 'private';
     66                    $this->post_status[] = 'pending';
     67                }
     68            }
    5369        }
    5470
     
    129145            if ( $upgrade_last_update ) {
    130146                update_post_meta( $post_ID, 'fmwp_last_update', time() );
    131             }
    132         }
    133 
    134         /**
    135          * Set statuses
    136          */
    137         public function init_statuses() {
    138             $this->post_status = array( 'publish' );
    139 
    140             if ( is_user_logged_in() ) {
    141                 $this->post_status[] = 'trash'; // will be visible for trash author or `manage_fmwp_forums_all`. See `$this->filter_trashed_for_author()`.
    142                 if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
    143                     $this->post_status[] = 'private';
    144                     $this->post_status[] = 'pending';
    145                 }
    146147            }
    147148        }
  • forumwp/tags/2.1.4/includes/common/class-options.php

    r3161123 r3306743  
    1818         * @var array
    1919         */
    20         private $options = array();
     20        private $options;
    2121
    2222        /**
     
    2929         */
    3030        public function __construct() {
    31             $this->init();
    32             $this->init_pages();
     31            $this->options = get_option( 'fmwp_options', array() ); // Force setting options variable here for getting them everywhere even on early hooks.
     32            add_action( 'forumwp_init', array( $this, 'init_variables' ), 0 );
    3333        }
    3434
     
    3636         * Set variables
    3737         */
    38         public function init() {
    39             $this->options = get_option( 'fmwp_options', array() );
    40         }
    41 
    42         /**
    43          * Set variables
    44          */
    45         public function init_pages() {
     38        public function init_variables() {
    4639            $core_pages = array_keys( FMWP()->config()->get( 'core_pages' ) );
    4740            if ( ! empty( $core_pages ) ) {
  • forumwp/tags/2.1.4/includes/common/class-reply.php

    r3205107 r3306743  
    3232
    3333            add_action( 'save_post_fmwp_reply', array( &$this, 'save_post' ), 999997, 3 );
    34             add_action( 'init', array( &$this, 'init_statuses' ), 10 );
    3534
    3635            add_filter( 'posts_where', array( &$this, 'filter_pending_for_author' ), 10, 2 );
     
    4039
    4140            add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
     41        }
     42
     43        /**
     44         * Initialize variables for the forum replies.
     45         */
     46        public function init_variables() {
     47            // Set soring types.
     48            $this->sort_by = apply_filters(
     49                'fmwp_replies_sorting',
     50                array(
     51                    'date_asc'  => __( 'Oldest to Newest', 'forumwp' ),
     52                    'date_desc' => __( 'Newest to Oldest', 'forumwp' ),
     53                )
     54            );
     55            // Set statuses.
     56            $this->post_status = array( 'publish' );
     57            if ( is_user_logged_in() ) {
     58                $this->post_status[] = 'pending';
     59                $this->post_status[] = 'trash';
     60            }
    4261        }
    4362
     
    113132        }
    114133
    115         public function init_variables() {
    116             $this->sort_by = apply_filters(
    117                 'fmwp_replies_sorting',
    118                 array(
    119                     'date_asc'  => __( 'Oldest to Newest', 'forumwp' ),
    120                     'date_desc' => __( 'Newest to Oldest', 'forumwp' ),
    121                 )
    122             );
    123         }
    124 
    125134        /**
    126135         * @param int $reply_id
     
    238247
    239248            return $spam;
    240         }
    241 
    242         /**
    243          * Set statuses
    244          */
    245         public function init_statuses() {
    246             $this->post_status = array( 'publish' );
    247             if ( is_user_logged_in() ) {
    248                 $this->post_status[] = 'pending';
    249                 $this->post_status[] = 'trash';
    250             }
    251249        }
    252250
  • forumwp/tags/2.1.4/includes/common/class-topic.php

    r3205107 r3306743  
    5454            add_filter( 'posts_where', array( &$this, 'filter_pending_for_author' ), 10, 2 );
    5555
    56             add_action( 'init', array( &$this, 'init_statuses' ), 10 );
    57 
    5856            add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
    5957        }
    6058
    61 
    62         /**
    63          * Set statuses
    64          */
    65         public function init_statuses() {
    66             $this->post_status = array( 'publish' );
    67             if ( is_user_logged_in() ) {
    68                 $this->post_status[] = 'trash';
    69                 $this->post_status[] = 'pending'; //pending can be visible for author
    70                 if ( current_user_can( 'manage_fmwp_topics_all' ) ) {
    71                     $this->post_status[] = 'private';
    72                 }
    73             }
    74         }
    75 
    76 
    77         /**
    78          * @param $where
    79          * @param $wp_query
    80          *
    81          * @return mixed
    82          */
    83         public function filter_pending_for_author( $where, $wp_query ) {
    84             if ( isset( $wp_query->query['post_type'] ) && 'fmwp_topic' === $wp_query->query['post_type'] ) {
    85                 if ( isset( $wp_query->query['post_status'] ) && ( 'pending' === $wp_query->query['post_status'] || ( is_array( $wp_query->query['post_status'] ) && in_array( 'pending', $wp_query->query['post_status'], true ) ) ) ) {
    86                     global $wpdb;
    87                     if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
    88                         $current_user_id = get_current_user_id();
    89 
    90                         $where = str_replace( "{$wpdb->posts}.post_status = 'pending'", "( {$wpdb->posts}.post_status = 'pending' AND {$wpdb->posts}.post_author = '" . $current_user_id . "' )", $where );
    91                         $where = str_replace(
    92                             "{$wpdb->posts}.post_status = 'trash'",
    93                             "( {$wpdb->posts}.post_status = 'trash' AND {$wpdb->posts}.post_author = '$current_user_id' )",
    94                             $where
    95                         );
    96                     }
    97                 }
    98             }
    99 
    100             return $where;
    101         }
    102 
    103 
    104         /**
    105          * Make invisible topics from trashed forums
    106          *
    107          * @param $posts
    108          * @param $query
    109          *
    110          * @return array
    111          */
    112         public function filter_topics_from_hidden_forums( $posts, $query ) {
    113             if ( FMWP()->is_request( 'admin' ) && ! FMWP()->is_request( 'ajax' ) ) {
    114                 return $posts;
    115             }
    116 
    117             $filtered_posts = array();
    118 
    119             //if empty
    120             if ( empty( $posts ) ) {
    121                 return $posts;
    122             }
    123 
    124             foreach ( $posts as $post ) {
    125 
    126                 if ( 'fmwp_topic' !== $post->post_type ) {
    127                     $filtered_posts[] = $post;
    128                     continue;
    129                 }
    130 
    131                 if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
    132                     if ( $this->is_spam( $post ) ) {
    133                         continue;
    134                     }
    135                 }
    136 
    137                 $forum_id = $this->get_forum_id( $post->ID );
    138                 $forum    = get_post( $forum_id );
    139 
    140                 if ( in_array( $forum->post_status, array( 'private', 'pending' ), true ) && current_user_can( 'manage_fmwp_forums_all' ) ) {
    141                     $filtered_posts[] = $post;
    142                     continue;
    143                 }
    144 
    145                 if ( 'publish' === $forum->post_status ) {
    146                     if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
    147                         $filtered_posts[] = $post;
    148                         continue;
    149                     }
    150 
    151                     $visibility = get_post_meta( $forum_id, 'fmwp_visibility', true );
    152                     if ( 'public' === $visibility ) {
    153                         $filtered_posts[] = $post;
    154                     }
    155                 }
    156             }
    157             return $filtered_posts;
    158         }
    159 
    160         /**
    161          * @param int|WP_Post|array $post
    162          *
    163          * @return bool
    164          */
    165         public function is_locked( $post ) {
    166             $locked = false;
    167             if ( is_numeric( $post ) ) {
    168                 $post = get_post( $post );
    169 
    170                 if ( empty( $post ) || is_wp_error( $post ) ) {
    171                     return false;
    172                 }
    173             }
    174 
    175             if ( 'fmwp_topic' === $post->post_type ) {
    176                 $is_locked = get_post_meta( $post->ID, 'fmwp_locked', true );
    177                 $locked    = ! empty( $is_locked );
    178             }
    179 
    180             return $locked;
    181         }
    182 
    183         /**
    184          * @param int|WP_Post|array $post
    185          *
    186          * @return bool
    187          */
    188         public function is_spam( $post ) {
    189             $spam = false;
    190             if ( is_numeric( $post ) ) {
    191                 $post = get_post( $post );
    192 
    193                 if ( empty( $post ) || is_wp_error( $post ) ) {
    194                     return false;
    195                 }
    196             }
    197 
    198             if ( 'fmwp_topic' === $post->post_type ) {
    199                 $is_spam = get_post_meta( $post->ID, 'fmwp_spam', true );
    200                 $spam    = ! empty( $is_spam );
    201             }
    202 
    203             return $spam;
    204         }
    205 
    206 
    207         /**
    208          *
     59        /**
     60         * Initializes variables including statuses, types, status markers, and sorting criteria.
    20961         */
    21062        public function init_variables() {
     
    268120                )
    269121            );
     122            // Set statuses.
     123            $this->post_status = array( 'publish' );
     124            if ( is_user_logged_in() ) {
     125                $this->post_status[] = 'trash';
     126                $this->post_status[] = 'pending'; //pending can be visible for author
     127                if ( current_user_can( 'manage_fmwp_topics_all' ) ) {
     128                    $this->post_status[] = 'private';
     129                }
     130            }
     131        }
     132
     133        /**
     134         * @param $where
     135         * @param $wp_query
     136         *
     137         * @return mixed
     138         */
     139        public function filter_pending_for_author( $where, $wp_query ) {
     140            if ( isset( $wp_query->query['post_type'] ) && 'fmwp_topic' === $wp_query->query['post_type'] ) {
     141                if ( isset( $wp_query->query['post_status'] ) && ( 'pending' === $wp_query->query['post_status'] || ( is_array( $wp_query->query['post_status'] ) && in_array( 'pending', $wp_query->query['post_status'], true ) ) ) ) {
     142                    global $wpdb;
     143                    if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
     144                        $current_user_id = get_current_user_id();
     145
     146                        $where = str_replace( "{$wpdb->posts}.post_status = 'pending'", "( {$wpdb->posts}.post_status = 'pending' AND {$wpdb->posts}.post_author = '" . $current_user_id . "' )", $where );
     147                        $where = str_replace(
     148                            "{$wpdb->posts}.post_status = 'trash'",
     149                            "( {$wpdb->posts}.post_status = 'trash' AND {$wpdb->posts}.post_author = '$current_user_id' )",
     150                            $where
     151                        );
     152                    }
     153                }
     154            }
     155
     156            return $where;
     157        }
     158
     159        /**
     160         * Make invisible topics from trashed forums
     161         *
     162         * @param $posts
     163         * @param $query
     164         *
     165         * @return array
     166         */
     167        public function filter_topics_from_hidden_forums( $posts, $query ) {
     168            if ( FMWP()->is_request( 'admin' ) && ! FMWP()->is_request( 'ajax' ) ) {
     169                return $posts;
     170            }
     171
     172            $filtered_posts = array();
     173
     174            //if empty
     175            if ( empty( $posts ) ) {
     176                return $posts;
     177            }
     178
     179            foreach ( $posts as $post ) {
     180
     181                if ( 'fmwp_topic' !== $post->post_type ) {
     182                    $filtered_posts[] = $post;
     183                    continue;
     184                }
     185
     186                if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
     187                    if ( $this->is_spam( $post ) ) {
     188                        continue;
     189                    }
     190                }
     191
     192                $forum_id = $this->get_forum_id( $post->ID );
     193                $forum    = get_post( $forum_id );
     194
     195                if ( in_array( $forum->post_status, array( 'private', 'pending' ), true ) && current_user_can( 'manage_fmwp_forums_all' ) ) {
     196                    $filtered_posts[] = $post;
     197                    continue;
     198                }
     199
     200                if ( 'publish' === $forum->post_status ) {
     201                    if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
     202                        $filtered_posts[] = $post;
     203                        continue;
     204                    }
     205
     206                    $visibility = get_post_meta( $forum_id, 'fmwp_visibility', true );
     207                    if ( 'public' === $visibility ) {
     208                        $filtered_posts[] = $post;
     209                    }
     210                }
     211            }
     212            return $filtered_posts;
     213        }
     214
     215        /**
     216         * @param int|WP_Post|array $post
     217         *
     218         * @return bool
     219         */
     220        public function is_locked( $post ) {
     221            $locked = false;
     222            if ( is_numeric( $post ) ) {
     223                $post = get_post( $post );
     224
     225                if ( empty( $post ) || is_wp_error( $post ) ) {
     226                    return false;
     227                }
     228            }
     229
     230            if ( 'fmwp_topic' === $post->post_type ) {
     231                $is_locked = get_post_meta( $post->ID, 'fmwp_locked', true );
     232                $locked    = ! empty( $is_locked );
     233            }
     234
     235            return $locked;
     236        }
     237
     238        /**
     239         * @param int|WP_Post|array $post
     240         *
     241         * @return bool
     242         */
     243        public function is_spam( $post ) {
     244            $spam = false;
     245            if ( is_numeric( $post ) ) {
     246                $post = get_post( $post );
     247
     248                if ( empty( $post ) || is_wp_error( $post ) ) {
     249                    return false;
     250                }
     251            }
     252
     253            if ( 'fmwp_topic' === $post->post_type ) {
     254                $is_spam = get_post_meta( $post->ID, 'fmwp_spam', true );
     255                $spam    = ! empty( $is_spam );
     256            }
     257
     258            return $spam;
    270259        }
    271260
  • forumwp/tags/2.1.4/includes/frontend/class-shortcodes.php

    r3205107 r3306743  
    619619                add_action( 'wp_footer', array( &$this, 'login_popup' ), -1 );
    620620            } elseif ( FMWP()->user()->can_create_topic( $args['id'] ) ) {
    621                     // pre-init ajax loader styles
    622                     FMWP()->ajax_loader_styles( 25 );
    623 
    624                     add_action( 'wp_footer', array( &$this, 'topic_popup' ), -1 );
     621                // pre-init ajax loader styles
     622                FMWP()->ajax_loader_styles( 25 );
     623
     624                add_action( 'wp_footer', array( &$this, 'topic_popup' ), -1 );
    625625            }
    626626
     
    967967            $args = shortcode_atts( $default_args, $args );
    968968
     969            /**
     970             * Fires before render User Topics List shortcode.
     971             *
     972             * @since 2.1.4
     973             * @hook fmwp_before_user_topics_shortcode
     974             *
     975             * @param {array} $args Arguments passed into shortcode.
     976             */
     977            do_action( 'fmwp_before_user_topics_shortcode', $args );
     978
    969979            ob_start();
    970980
     
    9931003
    9941004            $args = shortcode_atts( $default_args, $args );
     1005
     1006            /**
     1007             * Fires before render User Replies List shortcode.
     1008             *
     1009             * @since 2.1.4
     1010             * @hook fmwp_before_user_replies_shortcode
     1011             *
     1012             * @param {array} $args Arguments passed into shortcode.
     1013             */
     1014            do_action( 'fmwp_before_user_replies_shortcode', $args );
    9951015
    9961016            ob_start();
  • forumwp/tags/2.1.4/languages/forumwp.pot

    r3205107 r3306743  
    1 # Copyright (C) 2024 ForumWP
    2 # This file is distributed under the same license as the ForumWP plugin.
     1# Copyright (C) 2025 ForumWP
     2# This file is distributed under the GPLv3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ForumWP 2.1.3\n"
     5"Project-Id-Version: ForumWP 2.1.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/forumwp\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-12-09T20:24:35+00:00\n"
     12"POT-Creation-Date: 2025-05-30T14:15:01+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: forumwp\n"
    1616
     
    4040#: includes/admin/class-columns.php:409
    4141#: includes/admin/class-columns.php:419
    42 #: includes/common/class-reply.php:763
    43 #: includes/common/class-topic.php:515
     42#: includes/common/class-reply.php:761
     43#: includes/common/class-topic.php:504
    4444msgid "Reported"
    4545msgstr ""
     
    5050#: includes/admin/class-columns.php:400
    5151#: includes/admin/class-columns.php:484
    52 #: includes/common/class-topic.php:244
     52#: includes/common/class-topic.php:96
    5353#: templates/js/forum-row.php:41
    5454#: templates/single-forum-info.php:88
     
    6363#: includes/admin/class-columns.php:404
    6464#: includes/admin/class-columns.php:414
    65 #: includes/common/class-reply.php:758
    66 #: includes/common/class-topic.php:513
     65#: includes/common/class-reply.php:756
     66#: includes/common/class-topic.php:502
    6767#: blocks-src/fmwp-topics-list/src/index.js:78
    6868#: includes/blocks/fmwp-topics-list/src/index.js:1
     
    8787#: includes/class-config.php:566
    8888#: includes/class-fmwp-functions.php:185
    89 #: includes/class-fmwp-functions.php:678
    90 #: includes/class-fmwp-functions.php:696
     89#: includes/class-fmwp-functions.php:691
     90#: includes/class-fmwp-functions.php:709
    9191#: includes/frontend/class-profile.php:62
    9292#: templates/archive-forum-header.php:15
     
    145145#: includes/admin/templates/topic/attributes.php:81
    146146#: includes/class-fmwp-functions.php:140
    147 #: includes/common/class-common.php:971
     147#: includes/common/class-common.php:969
    148148#: templates/archive-forum-header.php:21
    149149msgid "Forum"
     
    158158
    159159#: includes/admin/class-columns.php:577
    160 #: includes/class-fmwp-functions.php:682
     160#: includes/class-fmwp-functions.php:695
    161161msgid "Tags"
    162162msgstr ""
     
    203203#: includes/class-config.php:563
    204204#: includes/class-fmwp-functions.php:139
    205 #: includes/class-fmwp-functions.php:641
    206 #: includes/class-fmwp-functions.php:660
    207 #: includes/class-fmwp-functions.php:707
    208 #: includes/class-fmwp-functions.php:724
     205#: includes/class-fmwp-functions.php:654
     206#: includes/class-fmwp-functions.php:673
     207#: includes/class-fmwp-functions.php:720
     208#: includes/class-fmwp-functions.php:737
    209209#: templates/js/forum-category-list.php:20
    210210msgid "Forums"
     
    262262#. translators: %s is a plugin name.
    263263#: includes/admin/class-notices.php:204
     264#, php-format
    264265msgid "To add forum functionality to your website %s needs to create several front-end pages (Forums, Topics, Profile, Registration & Login)."
    265266msgstr ""
     
    279280#. translators: %1$s,%3$s is a plugin name; %2$s,%4$s is a plugin version; %5$s is a upgrade page URL.
    280281#: includes/admin/class-notices.php:277
     282#, php-format
    281283msgid "<strong>%1$s version %2$s</strong> needs to be updated to work correctly.<br />It is necessary to update the structure of the database and options that are associated with <strong>%3$s %4$s</strong>.<br />Please visit \"<a href=\"%5$s\">Upgrade</a>\" page and run the upgrade process."
    282284msgstr ""
     
    288290#. translators: %1$s is a plugin name; %2$s is a plugin version.
    289291#: includes/admin/class-notices.php:302
     292#, php-format
    290293msgid "<strong>%1$s %2$s</strong> Successfully Upgraded"
    291294msgstr ""
     
    293296#. translators: %1$s is a post title; %2$s is a post name (slug).
    294297#: includes/admin/class-notices.php:352
     298#, php-format
    295299msgid "Permalink Conflict! Please change permalink for the <strong>\"%1$s\"</strong> post, the <strong>\"%2$s\"</strong> slug is reserved."
    296300msgstr ""
     
    306310#. translators: %s override templates page link.
    307311#: includes/admin/class-notices.php:417
     312#, php-format
    308313msgid "Your templates are out of date. Please visit <a href=\"%s\">override templates status page</a> and update templates."
    309314msgstr ""
     
    331336#. translators: %s is a page title.
    332337#: includes/admin/class-settings.php:216
     338#, php-format
    333339msgid "%s page"
    334340msgstr ""
     
    404410
    405411#: includes/admin/class-settings.php:334
    406 #: includes/common/class-reply.php:120
    407 #: includes/common/class-topic.php:265
     412#: includes/common/class-reply.php:52
     413#: includes/common/class-topic.php:117
    408414#: blocks-src/fmwp-forum/src/index.js:46
    409415#: blocks-src/fmwp-forums-list/src/index.js:62
     
    418424
    419425#: includes/admin/class-settings.php:335
    420 #: includes/common/class-reply.php:119
    421 #: includes/common/class-topic.php:264
     426#: includes/common/class-reply.php:51
     427#: includes/common/class-topic.php:116
    422428#: blocks-src/fmwp-forum/src/index.js:47
    423429#: blocks-src/fmwp-forums-list/src/index.js:63
     
    577583#. translators: %s is a plan data.
    578584#: includes/admin/class-settings.php:500
     585#, php-format
    579586msgid "%s modules"
    580587msgstr ""
     
    634641#. translators: %s: Last checking templates time.
    635642#: includes/admin/class-settings.php:844
     643#, php-format
    636644msgid "Last update: %s. You could re-check changes manually."
    637645msgstr ""
     
    643651#. translators: %s: Link to the docs article.
    644652#: includes/admin/class-settings.php:853
     653#, php-format
    645654msgid "You may get more details about overriding templates <a href=\"%s\" target=\"_blank\">here</a>."
    646655msgstr ""
     
    660669#. translators: %s is a new plugins version
    661670#: includes/admin/class-upgrade.php:122
     671#, php-format
    662672msgid "%s is a major update, and we highly recommend creating a full backup of your site before updating."
    663673msgstr ""
     
    673683#. translators: %s is the plugin name.
    674684#: includes/admin/class-upgrade.php:227
     685#, php-format
    675686msgid "%s - Upgrade Process"
    676687msgstr ""
     
    678689#. translators: %1$s is the installed version. %2$s is the DB version.
    679690#: includes/admin/class-upgrade.php:233
     691#, php-format
    680692msgid "You have installed <strong>%1$s</strong> version. Your latest DB version is <strong>%2$s</strong>. We recommend creating a backup of your site before running the update process. Do not exit the page before the update process has complete."
    681693msgstr ""
     
    720732#. translators: %s is a count.
    721733#: includes/admin/packages/2.0.1/spam.php:15
     734#, php-format
    722735msgid "Spam <span class=\"count\">(%s)</span>"
    723736msgid_plural "Spam <span class=\"count\">(%s)</span>"
     
    756769#. translators: %s is a count
    757770#: includes/admin/packages/2.0/locked.php:15
     771#, php-format
    758772msgid "Locked <span class=\"count\">(%s)</span>"
    759773msgid_plural "Locked <span class=\"count\">(%s)</span>"
     
    768782#. translators: %s is a count.
    769783#: includes/admin/packages/2.0/solved.php:15
     784#, php-format
    770785msgid "Solved <span class=\"count\">(%s)</span>"
    771786msgid_plural "Solved <span class=\"count\">(%s)</span>"
     
    854869#. translators: %s is a plugin name.
    855870#: includes/admin/templates/settings/settings.php:12
     871#, php-format
    856872msgid "%s - Settings"
    857873msgstr ""
     
    889905msgstr ""
    890906
    891 #: includes/ajax/class-forum.php:211
    892 #: includes/ajax/class-forum.php:245
    893 #: includes/ajax/class-forum.php:280
    894 #: includes/ajax/class-forum.php:310
    895 #: includes/ajax/class-forum.php:337
    896 #: includes/ajax/class-reply.php:444
    897 #: includes/ajax/class-reply.php:562
    898 #: includes/ajax/class-reply.php:623
    899 #: includes/ajax/class-reply.php:659
    900 #: includes/ajax/class-reply.php:696
    901 #: includes/ajax/class-reply.php:806
    902 #: includes/ajax/class-reply.php:840
     907#: includes/ajax/class-forum.php:212
     908#: includes/ajax/class-forum.php:246
     909#: includes/ajax/class-forum.php:281
     910#: includes/ajax/class-forum.php:311
     911#: includes/ajax/class-forum.php:338
     912#: includes/ajax/class-reply.php:440
     913#: includes/ajax/class-reply.php:558
     914#: includes/ajax/class-reply.php:619
     915#: includes/ajax/class-reply.php:655
     916#: includes/ajax/class-reply.php:692
     917#: includes/ajax/class-reply.php:802
     918#: includes/ajax/class-reply.php:836
    903919#: includes/ajax/class-topic.php:495
    904920#: includes/ajax/class-topic.php:616
     
    915931msgstr ""
    916932
    917 #: includes/ajax/class-forum.php:218
    918 #: includes/ajax/class-forum.php:252
    919 #: includes/ajax/class-forum.php:287
    920 #: includes/ajax/class-forum.php:317
    921 #: includes/ajax/class-forum.php:344
     933#: includes/ajax/class-forum.php:219
     934#: includes/ajax/class-forum.php:253
     935#: includes/ajax/class-forum.php:288
     936#: includes/ajax/class-forum.php:318
     937#: includes/ajax/class-forum.php:345
    922938msgid "Forum ID is invalid"
    923939msgstr ""
    924940
    925 #: includes/ajax/class-forum.php:222
     941#: includes/ajax/class-forum.php:223
    926942msgid "You do not have the ability to move this forum to trash"
    927943msgstr ""
    928944
    929 #: includes/ajax/class-forum.php:256
     945#: includes/ajax/class-forum.php:257
    930946msgid "You do not have the ability to restore this forum"
    931947msgstr ""
    932948
    933 #: includes/ajax/class-forum.php:291
     949#: includes/ajax/class-forum.php:292
    934950#: includes/ajax/class-topic.php:812
    935951msgid "You do not have the ability to delete this topic"
    936952msgstr ""
    937953
    938 #: includes/ajax/class-forum.php:298
     954#: includes/ajax/class-forum.php:299
    939955msgid "Forum was deleted successfully."
    940956msgstr ""
     
    962978msgstr ""
    963979
    964 #: includes/ajax/class-reply.php:351
    965 #: includes/ajax/class-reply.php:357
    966 #: includes/ajax/class-reply.php:531
     980#: includes/ajax/class-reply.php:347
     981#: includes/ajax/class-reply.php:353
     982#: includes/ajax/class-reply.php:527
    967983msgid "Invalid reply"
    968984msgstr ""
    969985
    970 #: includes/ajax/class-reply.php:451
     986#: includes/ajax/class-reply.php:447
    971987#: includes/ajax/class-topic.php:906
    972988#: includes/ajax/class-topic.php:934
     
    975991msgstr ""
    976992
    977 #: includes/ajax/class-reply.php:457
     993#: includes/ajax/class-reply.php:453
    978994msgid "You haven't capabilities to make this action"
    979995msgstr ""
    980996
    981 #: includes/ajax/class-reply.php:464
     997#: includes/ajax/class-reply.php:460
    982998msgid "Empty or Invalid Topic ID."
    983999msgstr ""
    9841000
    985 #: includes/ajax/class-reply.php:471
    986 #: includes/ajax/class-reply.php:582
     1001#: includes/ajax/class-reply.php:467
     1002#: includes/ajax/class-reply.php:578
    9871003#: includes/ajax/class-topic.php:440
    9881004#: includes/ajax/class-topic.php:523
     
    9911007
    9921008#. translators: %s is a reply creation delay
    993 #: includes/ajax/class-reply.php:483
     1009#: includes/ajax/class-reply.php:479
     1010#, php-format
    9941011msgid "You cannot leave replies faster than %s seconds"
    9951012msgstr ""
    9961013
    997 #: includes/ajax/class-reply.php:525
     1014#: includes/ajax/class-reply.php:521
    9981015msgid "Invalid reply ID"
    9991016msgstr ""
    10001017
    1001 #: includes/ajax/class-reply.php:535
    1002 #: includes/ajax/class-reply.php:575
     1018#: includes/ajax/class-reply.php:531
     1019#: includes/ajax/class-reply.php:571
    10031020msgid "You do not have the ability to edit this reply"
    10041021msgstr ""
    10051022
    1006 #: includes/ajax/class-reply.php:569
    1007 #: includes/ajax/class-reply.php:630
    1008 #: includes/ajax/class-reply.php:666
    1009 #: includes/ajax/class-reply.php:703
    1010 #: includes/ajax/class-reply.php:813
    1011 #: includes/ajax/class-reply.php:847
     1023#: includes/ajax/class-reply.php:565
     1024#: includes/ajax/class-reply.php:626
     1025#: includes/ajax/class-reply.php:662
     1026#: includes/ajax/class-reply.php:699
     1027#: includes/ajax/class-reply.php:809
     1028#: includes/ajax/class-reply.php:843
    10121029msgid "Reply ID is invalid"
    10131030msgstr ""
    10141031
    1015 #: includes/ajax/class-reply.php:604
     1032#: includes/ajax/class-reply.php:600
    10161033#: includes/ajax/class-topic.php:552
    10171034msgid "Something is wrong with the data"
    10181035msgstr ""
    10191036
    1020 #: includes/ajax/class-reply.php:634
     1037#: includes/ajax/class-reply.php:630
    10211038msgid "You do not have the ability to move this reply to trash"
    10221039msgstr ""
    10231040
    1024 #: includes/ajax/class-reply.php:670
     1041#: includes/ajax/class-reply.php:666
    10251042msgid "You do not have the ability to restore this reply"
    10261043msgstr ""
    10271044
    1028 #: includes/ajax/class-reply.php:707
     1045#: includes/ajax/class-reply.php:703
    10291046msgid "You do not have the ability to delete this reply"
    10301047msgstr ""
    10311048
    1032 #: includes/ajax/class-reply.php:817
     1049#: includes/ajax/class-reply.php:813
    10331050msgid "You do not have the ability to mark this reply as spam"
    10341051msgstr ""
    10351052
    1036 #: includes/ajax/class-reply.php:851
     1053#: includes/ajax/class-reply.php:847
    10371054msgid "You do not have the ability to restore this reply from spam"
    10381055msgstr ""
    10391056
    1040 #: includes/ajax/class-reply.php:874
    1041 #: includes/ajax/class-reply.php:902
    1042 #: includes/ajax/class-reply.php:929
     1057#: includes/ajax/class-reply.php:870
     1058#: includes/ajax/class-reply.php:898
     1059#: includes/ajax/class-reply.php:925
    10431060msgid "Empty Reply ID"
    10441061msgstr ""
    10451062
    1046 #: includes/ajax/class-reply.php:882
     1063#: includes/ajax/class-reply.php:878
    10471064#: includes/ajax/class-topic.php:921
    10481065msgid "Something wrong with reports"
    10491066msgstr ""
    10501067
    1051 #: includes/ajax/class-reply.php:909
    1052 #: includes/ajax/class-reply.php:944
     1068#: includes/ajax/class-reply.php:905
     1069#: includes/ajax/class-reply.php:940
    10531070#: includes/ajax/class-topic.php:949
    10541071#: includes/ajax/class-topic.php:977
     
    10581075#. translators: %s is an author display name
    10591076#: includes/ajax/class-topic.php:84
     1077#, php-format
    10601078msgid "Created by %s"
    10611079msgstr ""
     
    10631081#. translators: %s is a last replies author display name
    10641082#: includes/ajax/class-topic.php:103
     1083#, php-format
    10651084msgid "Last reply by %s"
    10661085msgstr ""
     
    10891108#. translators: %s is a topic delay time
    10901109#: includes/ajax/class-topic.php:452
     1110#, php-format
    10911111msgid "You cannot create topics faster than %s seconds"
    10921112msgstr ""
     
    11391159
    11401160#: includes/ajax/class-user.php:41
    1141 #: includes/common/class-common.php:318
     1161#: includes/common/class-common.php:317
    11421162msgid "Everyone"
    11431163msgstr ""
    11441164
    11451165#: includes/ajax/class-user.php:46
    1146 #: includes/common/class-common.php:315
     1166#: includes/common/class-common.php:314
    11471167msgid "All"
    11481168msgstr ""
     
    11921212#. translators: %s is a plugin name.
    11931213#: includes/class-dependencies.php:75
     1214#, php-format
    11941215msgid "Please check <strong>\"%s\"</strong> plugin's folder name. Correct folder name is <strong>\"forumwp\"</strong>"
    11951216msgstr ""
     
    12121233
    12131234#: includes/class-fmwp-functions.php:145
    1214 #: includes/common/class-common.php:1012
     1235#: includes/common/class-common.php:1010
    12151236msgid "Edit Forum"
    12161237msgstr ""
     
    12631284
    12641285#: includes/class-fmwp-functions.php:186
    1265 #: includes/common/class-common.php:982
     1286#: includes/common/class-common.php:980
    12661287#: templates/archive-topic-header.php:26
    12671288msgid "Topic"
     
    12821303
    12831304#: includes/class-fmwp-functions.php:191
    1284 #: includes/common/class-common.php:1024
     1305#: includes/common/class-common.php:1022
    12851306msgid "Edit Topic"
    12861307msgstr ""
     
    13121333
    13131334#: includes/class-fmwp-functions.php:225
    1314 #: includes/common/class-topic.php:1145
    1315 #: includes/common/class-topic.php:1152
     1335#: includes/common/class-topic.php:1134
     1336#: includes/common/class-topic.php:1141
    13161337#: templates/js/reply-row.php:117
    13171338#: templates/js/reply-row.php:132
     
    14671488msgstr ""
    14681489
    1469 #: includes/class-fmwp-functions.php:612
     1490#: includes/class-fmwp-functions.php:625
    14701491msgid "Home"
    14711492msgstr ""
    14721493
    1473 #: includes/class-fmwp-functions.php:645
     1494#: includes/class-fmwp-functions.php:658
    14741495#: templates/new-forum.php:47
    14751496msgid "Categories"
     
    14811502msgstr ""
    14821503
    1483 #: includes/class-modules.php:38
     1504#: includes/class-modules.php:39
    14841505msgid "Basic"
    14851506msgstr ""
    14861507
    1487 #: includes/class-modules.php:41
     1508#: includes/class-modules.php:42
    14881509msgid "Migration"
    14891510msgstr ""
    14901511
    1491 #: includes/class-modules.php:42
     1512#: includes/class-modules.php:43
    14921513msgid "Ability to migration forums, topics and replies from bbPress"
    14931514msgstr ""
    14941515
    1495 #: includes/common/class-forum.php:40
     1516#: includes/common/class-forum.php:55
    14961517msgid "Public"
    14971518msgstr ""
    14981519
    1499 #: includes/common/class-forum.php:41
     1520#: includes/common/class-forum.php:56
    15001521msgid "Private"
    15011522msgstr ""
    15021523
    1503 #: includes/common/class-forum.php:42
     1524#: includes/common/class-forum.php:57
    15041525msgid "Hidden"
    15051526msgstr ""
    15061527
    1507 #: includes/common/class-forum.php:172
     1528#: includes/common/class-forum.php:173
    15081529msgid "Unlock forum"
    15091530msgstr ""
    15101531
    1511 #: includes/common/class-forum.php:179
     1532#: includes/common/class-forum.php:180
    15121533msgid "Lock forum"
    15131534msgstr ""
    15141535
    1515 #: includes/common/class-forum.php:189
    1516 #: includes/common/class-reply.php:835
    1517 #: includes/common/class-topic.php:590
     1536#: includes/common/class-forum.php:190
     1537#: includes/common/class-reply.php:833
     1538#: includes/common/class-topic.php:579
    15181539msgid "Move to trash"
    15191540msgstr ""
    15201541
    1521 #: includes/common/class-forum.php:205
     1542#: includes/common/class-forum.php:206
    15221543msgid "Restore forum"
    15231544msgstr ""
    15241545
    1525 #: includes/common/class-forum.php:214
     1546#: includes/common/class-forum.php:215
    15261547msgid "Remove forum"
    15271548msgstr ""
     
    15341555#: includes/common/class-mail.php:103
    15351556#: includes/common/class-mail.php:221
     1557#, php-format
    15361558msgid "<code>%s</code> does not exist."
    15371559msgstr ""
     
    15391561#. translators: %s is a topic title
    15401562#. translators: %s is a topic title.
    1541 #: includes/common/class-reply.php:406
     1563#: includes/common/class-reply.php:404
    15421564#: modules/migration/class-init.php:909
     1565#, php-format
    15431566msgid "Reply To: %s"
    15441567msgstr ""
    15451568
    1546 #: includes/common/class-reply.php:749
    1547 #: includes/common/class-topic.php:215
    1548 #: includes/common/class-topic.php:516
     1569#: includes/common/class-reply.php:747
     1570#: includes/common/class-topic.php:67
     1571#: includes/common/class-topic.php:505
    15491572#: blocks-src/fmwp-topics-list/src/index.js:76
    15501573#: includes/blocks/fmwp-topics-list/src/index.js:1
     
    15521575msgstr ""
    15531576
    1554 #: includes/common/class-reply.php:753
    1555 #: includes/common/class-topic.php:511
     1577#: includes/common/class-reply.php:751
     1578#: includes/common/class-topic.php:500
    15561579#: templates/js/forum-row.php:55
    15571580msgid "Trashed"
    15581581msgstr ""
    15591582
    1560 #: includes/common/class-reply.php:826
     1583#: includes/common/class-reply.php:824
    15611584msgid "Edit reply"
    15621585msgstr ""
    15631586
    1564 #: includes/common/class-reply.php:844
    1565 #: includes/common/class-topic.php:599
     1587#: includes/common/class-reply.php:842
     1588#: includes/common/class-topic.php:588
    15661589msgid "Mark as spam"
    15671590msgstr ""
    15681591
    1569 #: includes/common/class-reply.php:853
    1570 #: includes/common/class-topic.php:608
     1592#: includes/common/class-reply.php:851
     1593#: includes/common/class-topic.php:597
    15711594msgid "Isn't spam"
    15721595msgstr ""
    15731596
    1574 #: includes/common/class-reply.php:864
     1597#: includes/common/class-reply.php:862
    15751598msgid "Report reply"
    15761599msgstr ""
    15771600
    1578 #: includes/common/class-reply.php:871
     1601#: includes/common/class-reply.php:869
    15791602msgid "Un-report reply"
    15801603msgstr ""
    15811604
    1582 #: includes/common/class-reply.php:881
     1605#: includes/common/class-reply.php:879
    15831606msgid "Clear reply's reports"
    15841607msgstr ""
    15851608
    1586 #: includes/common/class-reply.php:891
     1609#: includes/common/class-reply.php:889
    15871610msgid "Restore reply"
    15881611msgstr ""
    15891612
    1590 #: includes/common/class-reply.php:900
     1613#: includes/common/class-reply.php:898
    15911614msgid "Remove reply"
    15921615msgstr ""
    15931616
    1594 #: includes/common/class-topic.php:214
     1617#: includes/common/class-topic.php:66
    15951618msgid "Open"
    15961619msgstr ""
    15971620
    1598 #: includes/common/class-topic.php:216
     1621#: includes/common/class-topic.php:68
    15991622#: blocks-src/fmwp-topics-list/src/index.js:77
    16001623#: includes/blocks/fmwp-topics-list/src/index.js:1
     
    16021625msgstr ""
    16031626
    1604 #: includes/common/class-topic.php:222
     1627#: includes/common/class-topic.php:74
    16051628msgid "Normal"
    16061629msgstr ""
    16071630
    1608 #: includes/common/class-topic.php:226
    1609 #: includes/common/class-topic.php:248
     1631#: includes/common/class-topic.php:78
     1632#: includes/common/class-topic.php:100
    16101633msgid "Pinned"
    16111634msgstr ""
    16121635
    1613 #: includes/common/class-topic.php:230
    1614 #: includes/common/class-topic.php:252
     1636#: includes/common/class-topic.php:82
     1637#: includes/common/class-topic.php:104
    16151638msgid "Announcement"
    16161639msgstr ""
    16171640
    1618 #: includes/common/class-topic.php:234
    1619 #: includes/common/class-topic.php:256
     1641#: includes/common/class-topic.php:86
     1642#: includes/common/class-topic.php:108
    16201643msgid "Global"
    16211644msgstr ""
    16221645
    1623 #: includes/common/class-topic.php:266
     1646#: includes/common/class-topic.php:118
    16241647#: blocks-src/fmwp-forum/src/index.js:48
    16251648#: blocks-src/fmwp-topics-list/src/index.js:101
     
    16291652msgstr ""
    16301653
    1631 #: includes/common/class-topic.php:267
     1654#: includes/common/class-topic.php:119
    16321655#: blocks-src/fmwp-forum/src/index.js:49
    16331656#: blocks-src/fmwp-topics-list/src/index.js:102
     
    16371660msgstr ""
    16381661
    1639 #: includes/common/class-topic.php:545
     1662#: includes/common/class-topic.php:534
    16401663msgid "Edit topic"
    16411664msgstr ""
    16421665
    1643 #: includes/common/class-topic.php:554
     1666#: includes/common/class-topic.php:543
    16441667msgid "Pin topic"
    16451668msgstr ""
    16461669
    1647 #: includes/common/class-topic.php:563
     1670#: includes/common/class-topic.php:552
    16481671msgid "Unpin topic"
    16491672msgstr ""
    16501673
    1651 #: includes/common/class-topic.php:572
     1674#: includes/common/class-topic.php:561
    16521675msgid "Lock topic"
    16531676msgstr ""
    16541677
    1655 #: includes/common/class-topic.php:581
     1678#: includes/common/class-topic.php:570
    16561679msgid "Unlock topic"
    16571680msgstr ""
    16581681
    1659 #: includes/common/class-topic.php:618
     1682#: includes/common/class-topic.php:607
    16601683msgid "Report topic"
    16611684msgstr ""
    16621685
    1663 #: includes/common/class-topic.php:625
     1686#: includes/common/class-topic.php:614
    16641687msgid "Un-report topic"
    16651688msgstr ""
    16661689
    1667 #: includes/common/class-topic.php:635
     1690#: includes/common/class-topic.php:624
    16681691msgid "Clear topic's reports"
    16691692msgstr ""
    16701693
    1671 #: includes/common/class-topic.php:651
     1694#: includes/common/class-topic.php:640
    16721695msgid "Restore topic"
    16731696msgstr ""
    16741697
    1675 #: includes/common/class-topic.php:660
     1698#: includes/common/class-topic.php:649
    16761699msgid "Remove topic"
    16771700msgstr ""
    16781701
    1679 #: includes/common/class-topic.php:1152
     1702#: includes/common/class-topic.php:1141
    16801703#: templates/js/reply-row.php:120
    16811704#: templates/js/reply-row.php:135
     
    16851708msgstr ""
    16861709
    1687 #: includes/common/class-topic.php:1156
     1710#: includes/common/class-topic.php:1145
    16881711#: templates/topic.php:288
    16891712#: templates/topic.php:291
     
    17831806#. translators: %s is a forum category name
    17841807#: includes/frontend/class-shortcodes.php:339
     1808#, php-format
    17851809msgid "Forum Category: %s"
    17861810msgstr ""
     
    17881812#. translators: %s is a topic tag name
    17891813#: includes/frontend/class-shortcodes.php:345
     1814#, php-format
    17901815msgid "Topic Tag: %s"
    17911816msgstr ""
     
    18341859#. translators: %1$d and %2$d are from-to migrated forums numbers.
    18351860#: modules/migration/class-init.php:431
     1861#, php-format
    18361862msgid "Forums from %1$d to %2$d are migrated"
    18371863msgstr ""
     
    18391865#. translators: %1$d and %2$d are from-to migrated topics numbers.
    18401866#: modules/migration/class-init.php:595
     1867#, php-format
    18411868msgid "Topics from %1$d to %2$d are migrated"
    18421869msgstr ""
     
    18441871#. translators: %1$d and %2$d are from-to migrated topic tabs numbers.
    18451872#: modules/migration/class-init.php:749
     1873#, php-format
    18461874msgid "Topic tags from %1$d to %2$d are migrated"
    18471875msgstr ""
     
    18491877#. translators: %1$d and %2$d are from-to migrated replies numbers.
    18501878#: modules/migration/class-init.php:817
     1879#, php-format
    18511880msgid "Replies from %1$d to %2$d are migrated"
    18521881msgstr ""
     
    19121941#. translators: %s is the class attribute
    19131942#: templates/forum.php:70
     1943#, php-format
    19141944msgid "Please <a href=\"#\" class=\"%s\" title=\"Login to view\" data-fmwp_popup_title=\"Login to view forum\">login</a> to view this forum"
    19151945msgstr ""
     
    20892119#: templates/profile/main.php:85
    20902120#: templates/user-card.php:66
     2121#, php-format
    20912122msgid "%s topic"
    20922123msgid_plural "%s topics"
     
    20982129#: templates/profile/main.php:92
    20992130#: templates/user-card.php:75
     2131#, php-format
    21002132msgid "%s reply"
    21012133msgid_plural "%s replies"
     
    21062138#: templates/profile/main-mobile.php:64
    21072139#: templates/profile/main.php:100
     2140#, php-format
    21082141msgid "Joined: %s"
    21092142msgstr ""
     
    21372170#. translators: %s is a topic title
    21382171#: templates/reply-popup.php:52
     2172#, php-format
    21392173msgid "Replying to: \"%s\""
    21402174msgstr ""
     
    21702204#. translators: %s is the class attribute
    21712205#: templates/topic.php:124
     2206#, php-format
    21722207msgid "Please <a href=\"#\" class=\"%s\" title=\"Login to view\" data-fmwp_popup_title=\"Login to view topic\">login</a> to view this topic"
    21732208msgstr ""
     
    21752210#. translators: %s is a total replies count
    21762211#: templates/topic.php:160
     2212#, php-format
    21772213msgid "<span id=\"fmwp-replies-total\">%s</span> reply"
    21782214msgid_plural "<span id=\"fmwp-replies-total\">%s</span> replies"
     
    21822218#. translators: %s is a total topics count
    21832219#: templates/topic.php:170
     2220#, php-format
    21842221msgid "<span id=\"fmwp-views-total\">%s</span> view"
    21852222msgid_plural "<span id=\"fmwp-views-total\">%s</span> views"
     
    21892226#. translators: %s is the user display name.
    21902227#: templates/topic.php:221
     2228#, php-format
    21912229msgid "%s Profile"
    21922230msgstr ""
  • forumwp/tags/2.1.4/readme.txt

    r3205107 r3306743  
    66Requires PHP: 7.0
    77Requires at least: 5.5
    8 Tested up to: 6.7
    9 Stable tag: 2.1.3
     8Tested up to: 6.8
     9Stable tag: 2.1.4
    1010License: GPLv3
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    6161
    6262== Changelog ==
     63
     64= 2.1.4: June 04, 2025 =
     65
     66* Added: Action hooks 'fmwp_change_template_part', 'fmwp_before_user_topics_shortcode', 'fmwp_before_user_replies_shortcode' for 3rd-party integrations.
     67* Fixed: Loading textdomain for compatibility with WordPress 6.7 and 6.8.
     68
     69* Templates required update:
     70  - js/forum-row.php
    6371
    6472= 2.1.3: December 09, 2024 =
  • forumwp/tags/2.1.4/templates/js/forum-row.php

    r3205107 r3306743  
    55 * This template can be overridden by copying it to your-theme/forumwp/js/forum-row.php
    66 *
    7  * @version 2.1.3
     7 * @version 2.1.4
    88 *
    99 * @var array $fmwp_js_forum_row
     
    1717?>
    1818
    19 <div class="fmwp-forum-row<# if ( <?php echo esc_js( $item ); ?>.is_locked ) { #> fmwp-forum-locked<# } #><# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #> fmwp-forum-trashed<# } #><# if ( Object.keys( <?php echo esc_js( $item ); ?>.dropdown_actions ).length === 0 ) { #> fmwp-forum-no-actions<# } #>" data-forum_id="{{{<?php echo esc_js( $item ); ?>.forum_id}}}" data-trashed="<# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #>1<# } #>">
     19<div class="fmwp-forum-row<# if ( <?php echo esc_js( $item ); ?>.is_locked ) { #> fmwp-forum-locked<# } #><# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #> fmwp-forum-trashed<# } #><# if ( Object.keys( <?php echo esc_js( $item ); ?>.dropdown_actions ).length === 0 ) { #> fmwp-forum-no-actions<# } #> {{{<?php echo esc_js( $item ); ?>.extra_classes}}}" data-forum_id="{{{<?php echo esc_js( $item ); ?>.forum_id}}}" data-trashed="<# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #>1<# } #>">
    2020    <div class="fmwp-forum-row-lines">
    2121
  • forumwp/trunk/assets/front/js/topic-popup.js

    r3205107 r3306743  
    7777
    7878        form.find('input, #wp-fmwptopiccontent-wrap').removeClass('fmwp-error-field').removeAttr('title');
     79
     80        data = wp.hooks.applyFilters( 'fmwp_topic_popup_submitted_data', data, form );
    7981
    8082        fmwp_set_busy( 'topic_popup', true );
  • forumwp/trunk/assets/front/js/topic-popup.min.js

    r3205107 r3306743  
    1 jQuery(document).ready(function(r){var i,e,o;r(document.body).on("click","#fmwp-topic-popup-preview-action",function(){var p=r(this).parents("#fmwp-topic-popup-editors");p.hasClass("fmwp-topic-popup-preview-hidden")?(p.removeClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("hide_label")),r("#fmwptopiccontent-preview").html(r("#fmwptopiccontent").val())):(p.addClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("show_label"))),fmwp_resize_popup()}),r(document.body).on("click",".fmwp-topic-popup-discard",function(){var t;fmwp_is_busy("topic_popup")||(t=r(this).parents("#fmwp-topic-popup-wrapper")).hide(1,function(){t.find("form")[0].reset(),r("#fmwptopiccontent").val(""),r("#fmwptopiccontent-preview").html(""),t.removeClass("fmwp-fullsize");var p=t.find("#fmwp-topic-popup-preview-action");p.html(p.data("hide_label")),t.find("#fmwp-topic-popup-editors").removeClass("fmwp-topic-popup-preview-hidden")})}),r(document.body).on("click",".fmwp-topic-popup-submit",function(p){var s,n,t,i,e,a,c,f;p.preventDefault(),fmwp_is_busy("topic_popup")||((s=r(this)).siblings(".fmwp-ajax-loading").css("visibility","visible").show(),s.css("visibility","hidden"),n=r("#fmwp-topic-popup-wrapper"),p=r(this).parents("form"),t=p.serializeArray(),i="undefined"!=typeof tinymce?tinyMCE.get("fmwptopiccontent").getContent({format:"raw"}):r("#fmwptopiccontent").val(),e={},r.each(t,function(p){"fmwp-topic[content]"===t[p].name?e[t[p].name]=i:e[t[p].name]=t[p].value}),a=e["fmwp-topic[forum_id]"],c=e["fmwp-topic[topic_id]"],f="edit-topic"===e["fmwp-action"]?"fmwp_edit_topic":"fmwp_create_topic",p.find("input, #wp-fmwptopiccontent-wrap").removeClass("fmwp-error-field").removeAttr("title"),fmwp_set_busy("topic_popup",!0),wp.ajax.send(f,{data:e,success:function(t){if("fmwp_edit_topic"==f){var i=n.data("fmwp-target"),p=t,e=c;"forum-page"===i||"topics-page"===i?(o=wp.template("fmwp-topic")(p),r(".fmwp-topics-wrapper").find('.fmwp-topic-row[data-topic_id="'+e+'"]').replaceWith(o)):"topic-page"===i&&(r(".fmwp-topic-title").html(p.title),r(".fmwp-topic-data-content").html(p.content),r(".fmwp-topic-stats.fmwp-tags-stats").length&&(e=wp.template("fmwp-topic-tags-line")(p.tags),r(".fmwp-topic-stats.fmwp-tags-stats").html(e)),wp.hooks.doAction("fmwp_after_edit_topic",p))}else{var o=t,i=a;o=wp.template("fmwp-topic")(o);let p=(i=r('.fmwp-topics-wrapper[data-fmwp_forum_id="'+i+'"]')).find(".fmwp-forum-sort:visible").val();i.length||(i=r(".fmwp-archive-topics-wrapper .fmwp-topics-wrapper"),p=r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible").val()),"date_desc"===p?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").length?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-pinned:last").length?i.find(".fmwp-topic-row.fmwp-topic-pinned:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-global:last").length?i.find(".fmwp-topic-row.fmwp-topic-global:last").after(o):i.prepend(o):"date_asc"===p&&i.append(o),i.find(".fmwp-forum-no-topics").length&&i.find(".fmwp-forum-no-topics").remove(),i.find(".fmwp-topic-actions-dropdown").length?i.siblings(".fmwp-topics-wrapper-heading").removeClass("fmwp-no-actions-heading"):i.siblings(".fmwp-topics-wrapper-heading").addClass("fmwp-no-actions-heading")}fmwp_set_busy("topic_popup",!1),r(".fmwp-topic-popup-discard:first").trigger("click"),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible");e=r('.fmwp-forum-head[data-fmwp_forum_id="'+a+'"]');(e.length?e.find(".fmwp-forum-sort:visible"):r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible")).trigger("change")},error:function(t){t.errors?r.each(t.errors,function(p){jQuery("#"+t.errors[p].field).addClass("fmwp-error-field").attr("title",t.errors[p].message)}):(console.log(t),r(this).fmwp_notice({message:t,type:"error"})),fmwp_set_busy("topic_popup",!1),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible")}}))}),r(document.body).on("keyup","#fmwptopiccontent",(i=function(p){var t;r(this).parents("#fmwp-topic-popup-editors").hasClass("fmwp-topic-popup-preview-hidden")||fmwp_is_busy("topic_popup_preview")||(t=fmwp_stringToHash(this.value))!=r(this).data("content-hash")&&(r(this).data("content-hash",t),fmwp_set_busy("topic_popup_preview",!0),wp.ajax.send("fmwp_topic_build_preview",{data:{content:this.value,nonce:fmwp_front_data.nonce},success:function(p){r("#fmwptopiccontent-preview").html(p),fmwp_set_busy("topic_popup_preview",!1)},error:function(p){console.log(p),r(this).fmwp_notice({message:p,type:"error"}),fmwp_set_busy("topic_popup_preview",!1)}}))},e=1e3,o=0,function(){var p=this,t=arguments;clearTimeout(o),o=setTimeout(function(){i.apply(p,t)},e||0)}))});
     1jQuery(document).ready(function(r){var i,e,o;r(document.body).on("click","#fmwp-topic-popup-preview-action",function(){var p=r(this).parents("#fmwp-topic-popup-editors");p.hasClass("fmwp-topic-popup-preview-hidden")?(p.removeClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("hide_label")),r("#fmwptopiccontent-preview").html(r("#fmwptopiccontent").val())):(p.addClass("fmwp-topic-popup-preview-hidden"),r(this).html(r(this).data("show_label"))),fmwp_resize_popup()}),r(document.body).on("click",".fmwp-topic-popup-discard",function(){var t;fmwp_is_busy("topic_popup")||(t=r(this).parents("#fmwp-topic-popup-wrapper")).hide(1,function(){t.find("form")[0].reset(),r("#fmwptopiccontent").val(""),r("#fmwptopiccontent-preview").html(""),t.removeClass("fmwp-fullsize");var p=t.find("#fmwp-topic-popup-preview-action");p.html(p.data("hide_label")),t.find("#fmwp-topic-popup-editors").removeClass("fmwp-topic-popup-preview-hidden")})}),r(document.body).on("click",".fmwp-topic-popup-submit",function(p){var s,n,t,i,e,a,c,f;p.preventDefault(),fmwp_is_busy("topic_popup")||((s=r(this)).siblings(".fmwp-ajax-loading").css("visibility","visible").show(),s.css("visibility","hidden"),n=r("#fmwp-topic-popup-wrapper"),p=r(this).parents("form"),t=p.serializeArray(),i="undefined"!=typeof tinymce?tinyMCE.get("fmwptopiccontent").getContent({format:"raw"}):r("#fmwptopiccontent").val(),e={},r.each(t,function(p){"fmwp-topic[content]"===t[p].name?e[t[p].name]=i:e[t[p].name]=t[p].value}),a=e["fmwp-topic[forum_id]"],c=e["fmwp-topic[topic_id]"],f="edit-topic"===e["fmwp-action"]?"fmwp_edit_topic":"fmwp_create_topic",p.find("input, #wp-fmwptopiccontent-wrap").removeClass("fmwp-error-field").removeAttr("title"),e=wp.hooks.applyFilters("fmwp_topic_popup_submitted_data",e,p),fmwp_set_busy("topic_popup",!0),wp.ajax.send(f,{data:e,success:function(t){if("fmwp_edit_topic"==f){var i=n.data("fmwp-target"),p=t,e=c;"forum-page"===i||"topics-page"===i?(o=wp.template("fmwp-topic")(p),r(".fmwp-topics-wrapper").find('.fmwp-topic-row[data-topic_id="'+e+'"]').replaceWith(o)):"topic-page"===i&&(r(".fmwp-topic-title").html(p.title),r(".fmwp-topic-data-content").html(p.content),r(".fmwp-topic-stats.fmwp-tags-stats").length&&(e=wp.template("fmwp-topic-tags-line")(p.tags),r(".fmwp-topic-stats.fmwp-tags-stats").html(e)),wp.hooks.doAction("fmwp_after_edit_topic",p))}else{var o=t,i=a;o=wp.template("fmwp-topic")(o);let p=(i=r('.fmwp-topics-wrapper[data-fmwp_forum_id="'+i+'"]')).find(".fmwp-forum-sort:visible").val();i.length||(i=r(".fmwp-archive-topics-wrapper .fmwp-topics-wrapper"),p=r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible").val()),"date_desc"===p?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").length?i.find(".fmwp-topic-row.fmwp-topic-announcement:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-pinned:last").length?i.find(".fmwp-topic-row.fmwp-topic-pinned:last").after(o):i.find(".fmwp-topic-row.fmwp-topic-global:last").length?i.find(".fmwp-topic-row.fmwp-topic-global:last").after(o):i.prepend(o):"date_asc"===p&&i.append(o),i.find(".fmwp-forum-no-topics").length&&i.find(".fmwp-forum-no-topics").remove(),i.find(".fmwp-topic-actions-dropdown").length?i.siblings(".fmwp-topics-wrapper-heading").removeClass("fmwp-no-actions-heading"):i.siblings(".fmwp-topics-wrapper-heading").addClass("fmwp-no-actions-heading")}fmwp_set_busy("topic_popup",!1),r(".fmwp-topic-popup-discard:first").trigger("click"),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible");e=r('.fmwp-forum-head[data-fmwp_forum_id="'+a+'"]');(e.length?e.find(".fmwp-forum-sort:visible"):r(".fmwp-archive-topics-wrapper").find(".fmwp-topics-sort:visible")).trigger("change")},error:function(t){t.errors?r.each(t.errors,function(p){jQuery("#"+t.errors[p].field).addClass("fmwp-error-field").attr("title",t.errors[p].message)}):(console.log(t),r(this).fmwp_notice({message:t,type:"error"})),fmwp_set_busy("topic_popup",!1),s.siblings(".fmwp-ajax-loading").css("visibility","hidden").hide(),s.css("visibility","visible")}}))}),r(document.body).on("keyup","#fmwptopiccontent",(i=function(p){var t;r(this).parents("#fmwp-topic-popup-editors").hasClass("fmwp-topic-popup-preview-hidden")||fmwp_is_busy("topic_popup_preview")||(t=fmwp_stringToHash(this.value))!=r(this).data("content-hash")&&(r(this).data("content-hash",t),fmwp_set_busy("topic_popup_preview",!0),wp.ajax.send("fmwp_topic_build_preview",{data:{content:this.value,nonce:fmwp_front_data.nonce},success:function(p){r("#fmwptopiccontent-preview").html(p),fmwp_set_busy("topic_popup_preview",!1)},error:function(p){console.log(p),r(this).fmwp_notice({message:p,type:"error"}),fmwp_set_busy("topic_popup_preview",!1)}}))},e=1e3,o=0,function(){var p=this,t=arguments;clearTimeout(o),o=setTimeout(function(){i.apply(p,t)},e||0)}))});
  • forumwp/trunk/forumwp.php

    r3205107 r3306743  
    44 * Plugin URI: https://forumwpplugin.com/
    55 * Description: A full-featured, powerful forum plugin for WordPress
    6  * Version: 2.1.3
     6 * Version: 2.1.4
    77 * Author: ForumWP
     8 * License: GPLv3
     9 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
    810 * Text Domain: forumwp
    911 * Domain Path: /languages
  • forumwp/trunk/includes/ajax/class-forum.php

    r3205107 r3306743  
    7676                'title'            => $forum->post_title,
    7777                'permalink'        => get_permalink( $forum->ID ),
    78                 'author'           => FMWP()->user()->display_name( $author ),
    79                 'author_url'       => FMWP()->user()->get_profile_link( $author->ID ),
    80                 'author_avatar'    => FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ),
     78                'author'           => $author ? FMWP()->user()->display_name( $author ) : '',
     79                'author_url'       => $author ? FMWP()->user()->get_profile_link( $author->ID ) : '',
     80                'author_avatar'    => $author ? FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ) : '',
    8181                'last_upgrade'     => $last_upgrade,
    8282                'strip_content'    => $strip_content,
     
    9292                'is_locked'        => FMWP()->common()->forum()->is_locked( $forum->ID ),
    9393                'is_trashed'       => FMWP()->common()->forum()->is_trashed( $forum->ID ),
     94                'extra_classes'    => '',
    9495            );
    9596
  • forumwp/trunk/includes/ajax/class-reply.php

    r3182324 r3306743  
    5050            $dropdown_actions = FMWP()->common()->reply()->actions_list( $reply );
    5151
    52             $author_url = FMWP()->user()->get_profile_link( $author->ID );
    53 
    54             $slug = FMWP()->user()->maybe_get_slug( $author->ID );
    55 
    5652            $beauty_date = '';
    5753            if ( ! FMWP()->common()->reply()->is_pending( $reply->ID ) ) {
     
    6965                'content'          => nl2br( $reply->post_content ),
    7066                'permalink'        => FMWP()->common()->reply()->get_link( $reply->ID ),
    71                 'author'           => FMWP()->user()->display_name( $author ),
    72                 'author_url'       => $author_url,
    73                 'author_avatar'    => FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ),
     67                'author'           => $author ? FMWP()->user()->display_name( $author ) : '',
     68                'author_url'       => $author ? FMWP()->user()->get_profile_link( $author->ID ) : '',
     69                'author_avatar'    => $author ? FMWP()->user()->get_avatar( $author->ID, 'inline', 60 ) : '',
    7470                'date'             => $date,
    7571                'beauty_date'      => $beauty_date,
     
    8076                'more_answers'     => count( $child ) > 2,
    8177                'total_replies'    => $total_child,
    82                 'mention'          => '@' . $slug,
     78                'mention'          => $author ? '@' . FMWP()->user()->maybe_get_slug( $author->ID ) : '',
    8379                'is_trashed'       => FMWP()->common()->reply()->is_trashed( $reply->ID ),
    8480                'can_edit'         => $can_edit,
    8581                'author_tags'      => FMWP()->common()->reply()->get_author_tags( $reply ),
    86                 'author_card'      => FMWP()->user()->generate_card( $author->ID ),
     82                'author_card'      => $author ? FMWP()->user()->generate_card( $author->ID ) : '',
    8783                'is_locked'        => FMWP()->common()->reply()->is_locked( $reply ),
    88                 'is_author'        => ( is_user_logged_in() && get_current_user_id() === $author->ID ),
     84                'is_author'        => is_user_logged_in() && $author && get_current_user_id() === $author->ID,
    8985                'dropdown_actions' => $dropdown_actions,
    9086                'can_actions'      => count( $dropdown_actions ),
  • forumwp/trunk/includes/class-fmwp-functions.php

    r3205107 r3306743  
    534534        public function get_template_part( $slug, $args = array(), $module = '' ) {
    535535            global $wp_query;
     536            /**
     537             * Fires just before the algorithm for getting ForumWP custom templates.
     538             *
     539             * Note: Allow 3rd party plugins or modules filter template file, arguments, module name from their side.
     540             *
     541             * @since 2.1.4
     542             * @hook fmwp_change_template_part
     543             *
     544             * @param {string} $slug Template name passed by reference.
     545             * @param {array}  $args          Arguments passed for the template by reference.
     546             * @param {string} $module        Module slug passed by reference. (default: '').
     547             */
     548            do_action_ref_array( 'fmwp_change_template_part', array( &$slug, &$args, &$module ) );
    536549
    537550            $query_title = $this->undash( sanitize_title( $slug ) );
  • forumwp/trunk/includes/class-modules.php

    r3161123 r3306743  
    2626         */
    2727        public function __construct() {
    28             add_action( 'forumwp_loaded', array( &$this, 'predefined_modules' ), 0 );
     28            // Register modules here on the early priority and then loading them on the `0` priority in common class.
     29            add_action( 'forumwp_init', array( &$this, 'predefined_modules' ), -1 );
    2930        }
    3031
  • forumwp/trunk/includes/common/class-common.php

    r3205107 r3306743  
    2929            add_action( 'plugins_loaded', array( &$this, 'on_plugins_loaded' ), -19 );
    3030
     31            add_action( 'init', array( $this, 'init' ), 0 );
    3132            // loading modules when forumwp is loaded
    32             add_action( 'forumwp_loaded', array( FMWP()->modules(), 'load_modules' ), 1 );
    33 
    34             add_action( 'init', array( $this, 'init' ), 0 );
     33            add_action( 'forumwp_init', array( FMWP()->modules(), 'load_modules' ), 0 );
    3534
    3635            add_action( 'admin_bar_menu', array( &$this, 'toolbar_links' ), 999 );
     
    549548        }
    550549
    551 
    552550        /**
    553551         *
  • forumwp/trunk/includes/common/class-forum.php

    r3205107 r3306743  
    3737         */
    3838        public function __construct() {
     39            add_action( 'forumwp_init', array( &$this, 'init_variables' ), 9 );
     40
     41            add_action( 'save_post_fmwp_forum', array( &$this, 'save_post' ), 999997 );
     42
     43            add_filter( 'the_posts', array( &$this, 'filter_private_forums' ), 99 );
     44            add_filter( 'posts_where', array( &$this, 'filter_trashed_for_author' ), 10, 2 );
     45
     46            add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
     47        }
     48
     49        /**
     50         * Initialize variables for the class.
     51         */
     52        public function init_variables() {
     53            // Set visibilities.
    3954            $this->visibilities = array(
    4055                'public'  => __( 'Public', 'forumwp' ),
     
    4358            );
    4459
    45             add_action( 'init', array( &$this, 'init_statuses' ) );
    46 
    47             add_action( 'save_post_fmwp_forum', array( &$this, 'save_post' ), 999997 );
    48 
    49             add_filter( 'the_posts', array( &$this, 'filter_private_forums' ), 99 );
    50             add_filter( 'posts_where', array( &$this, 'filter_trashed_for_author' ), 10, 2 );
    51 
    52             add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
     60            // Set statuses.
     61            $this->post_status = array( 'publish' );
     62            if ( is_user_logged_in() ) {
     63                $this->post_status[] = 'trash'; // will be visible for trash author or `manage_fmwp_forums_all`. See `$this->filter_trashed_for_author()`.
     64                if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
     65                    $this->post_status[] = 'private';
     66                    $this->post_status[] = 'pending';
     67                }
     68            }
    5369        }
    5470
     
    129145            if ( $upgrade_last_update ) {
    130146                update_post_meta( $post_ID, 'fmwp_last_update', time() );
    131             }
    132         }
    133 
    134         /**
    135          * Set statuses
    136          */
    137         public function init_statuses() {
    138             $this->post_status = array( 'publish' );
    139 
    140             if ( is_user_logged_in() ) {
    141                 $this->post_status[] = 'trash'; // will be visible for trash author or `manage_fmwp_forums_all`. See `$this->filter_trashed_for_author()`.
    142                 if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
    143                     $this->post_status[] = 'private';
    144                     $this->post_status[] = 'pending';
    145                 }
    146147            }
    147148        }
  • forumwp/trunk/includes/common/class-options.php

    r3161123 r3306743  
    1818         * @var array
    1919         */
    20         private $options = array();
     20        private $options;
    2121
    2222        /**
     
    2929         */
    3030        public function __construct() {
    31             $this->init();
    32             $this->init_pages();
     31            $this->options = get_option( 'fmwp_options', array() ); // Force setting options variable here for getting them everywhere even on early hooks.
     32            add_action( 'forumwp_init', array( $this, 'init_variables' ), 0 );
    3333        }
    3434
     
    3636         * Set variables
    3737         */
    38         public function init() {
    39             $this->options = get_option( 'fmwp_options', array() );
    40         }
    41 
    42         /**
    43          * Set variables
    44          */
    45         public function init_pages() {
     38        public function init_variables() {
    4639            $core_pages = array_keys( FMWP()->config()->get( 'core_pages' ) );
    4740            if ( ! empty( $core_pages ) ) {
  • forumwp/trunk/includes/common/class-reply.php

    r3205107 r3306743  
    3232
    3333            add_action( 'save_post_fmwp_reply', array( &$this, 'save_post' ), 999997, 3 );
    34             add_action( 'init', array( &$this, 'init_statuses' ), 10 );
    3534
    3635            add_filter( 'posts_where', array( &$this, 'filter_pending_for_author' ), 10, 2 );
     
    4039
    4140            add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
     41        }
     42
     43        /**
     44         * Initialize variables for the forum replies.
     45         */
     46        public function init_variables() {
     47            // Set soring types.
     48            $this->sort_by = apply_filters(
     49                'fmwp_replies_sorting',
     50                array(
     51                    'date_asc'  => __( 'Oldest to Newest', 'forumwp' ),
     52                    'date_desc' => __( 'Newest to Oldest', 'forumwp' ),
     53                )
     54            );
     55            // Set statuses.
     56            $this->post_status = array( 'publish' );
     57            if ( is_user_logged_in() ) {
     58                $this->post_status[] = 'pending';
     59                $this->post_status[] = 'trash';
     60            }
    4261        }
    4362
     
    113132        }
    114133
    115         public function init_variables() {
    116             $this->sort_by = apply_filters(
    117                 'fmwp_replies_sorting',
    118                 array(
    119                     'date_asc'  => __( 'Oldest to Newest', 'forumwp' ),
    120                     'date_desc' => __( 'Newest to Oldest', 'forumwp' ),
    121                 )
    122             );
    123         }
    124 
    125134        /**
    126135         * @param int $reply_id
     
    238247
    239248            return $spam;
    240         }
    241 
    242         /**
    243          * Set statuses
    244          */
    245         public function init_statuses() {
    246             $this->post_status = array( 'publish' );
    247             if ( is_user_logged_in() ) {
    248                 $this->post_status[] = 'pending';
    249                 $this->post_status[] = 'trash';
    250             }
    251249        }
    252250
  • forumwp/trunk/includes/common/class-topic.php

    r3205107 r3306743  
    5454            add_filter( 'posts_where', array( &$this, 'filter_pending_for_author' ), 10, 2 );
    5555
    56             add_action( 'init', array( &$this, 'init_statuses' ), 10 );
    57 
    5856            add_action( 'transition_post_status', array( &$this, 'trash' ), 10, 3 );
    5957        }
    6058
    61 
    62         /**
    63          * Set statuses
    64          */
    65         public function init_statuses() {
    66             $this->post_status = array( 'publish' );
    67             if ( is_user_logged_in() ) {
    68                 $this->post_status[] = 'trash';
    69                 $this->post_status[] = 'pending'; //pending can be visible for author
    70                 if ( current_user_can( 'manage_fmwp_topics_all' ) ) {
    71                     $this->post_status[] = 'private';
    72                 }
    73             }
    74         }
    75 
    76 
    77         /**
    78          * @param $where
    79          * @param $wp_query
    80          *
    81          * @return mixed
    82          */
    83         public function filter_pending_for_author( $where, $wp_query ) {
    84             if ( isset( $wp_query->query['post_type'] ) && 'fmwp_topic' === $wp_query->query['post_type'] ) {
    85                 if ( isset( $wp_query->query['post_status'] ) && ( 'pending' === $wp_query->query['post_status'] || ( is_array( $wp_query->query['post_status'] ) && in_array( 'pending', $wp_query->query['post_status'], true ) ) ) ) {
    86                     global $wpdb;
    87                     if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
    88                         $current_user_id = get_current_user_id();
    89 
    90                         $where = str_replace( "{$wpdb->posts}.post_status = 'pending'", "( {$wpdb->posts}.post_status = 'pending' AND {$wpdb->posts}.post_author = '" . $current_user_id . "' )", $where );
    91                         $where = str_replace(
    92                             "{$wpdb->posts}.post_status = 'trash'",
    93                             "( {$wpdb->posts}.post_status = 'trash' AND {$wpdb->posts}.post_author = '$current_user_id' )",
    94                             $where
    95                         );
    96                     }
    97                 }
    98             }
    99 
    100             return $where;
    101         }
    102 
    103 
    104         /**
    105          * Make invisible topics from trashed forums
    106          *
    107          * @param $posts
    108          * @param $query
    109          *
    110          * @return array
    111          */
    112         public function filter_topics_from_hidden_forums( $posts, $query ) {
    113             if ( FMWP()->is_request( 'admin' ) && ! FMWP()->is_request( 'ajax' ) ) {
    114                 return $posts;
    115             }
    116 
    117             $filtered_posts = array();
    118 
    119             //if empty
    120             if ( empty( $posts ) ) {
    121                 return $posts;
    122             }
    123 
    124             foreach ( $posts as $post ) {
    125 
    126                 if ( 'fmwp_topic' !== $post->post_type ) {
    127                     $filtered_posts[] = $post;
    128                     continue;
    129                 }
    130 
    131                 if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
    132                     if ( $this->is_spam( $post ) ) {
    133                         continue;
    134                     }
    135                 }
    136 
    137                 $forum_id = $this->get_forum_id( $post->ID );
    138                 $forum    = get_post( $forum_id );
    139 
    140                 if ( in_array( $forum->post_status, array( 'private', 'pending' ), true ) && current_user_can( 'manage_fmwp_forums_all' ) ) {
    141                     $filtered_posts[] = $post;
    142                     continue;
    143                 }
    144 
    145                 if ( 'publish' === $forum->post_status ) {
    146                     if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
    147                         $filtered_posts[] = $post;
    148                         continue;
    149                     }
    150 
    151                     $visibility = get_post_meta( $forum_id, 'fmwp_visibility', true );
    152                     if ( 'public' === $visibility ) {
    153                         $filtered_posts[] = $post;
    154                     }
    155                 }
    156             }
    157             return $filtered_posts;
    158         }
    159 
    160         /**
    161          * @param int|WP_Post|array $post
    162          *
    163          * @return bool
    164          */
    165         public function is_locked( $post ) {
    166             $locked = false;
    167             if ( is_numeric( $post ) ) {
    168                 $post = get_post( $post );
    169 
    170                 if ( empty( $post ) || is_wp_error( $post ) ) {
    171                     return false;
    172                 }
    173             }
    174 
    175             if ( 'fmwp_topic' === $post->post_type ) {
    176                 $is_locked = get_post_meta( $post->ID, 'fmwp_locked', true );
    177                 $locked    = ! empty( $is_locked );
    178             }
    179 
    180             return $locked;
    181         }
    182 
    183         /**
    184          * @param int|WP_Post|array $post
    185          *
    186          * @return bool
    187          */
    188         public function is_spam( $post ) {
    189             $spam = false;
    190             if ( is_numeric( $post ) ) {
    191                 $post = get_post( $post );
    192 
    193                 if ( empty( $post ) || is_wp_error( $post ) ) {
    194                     return false;
    195                 }
    196             }
    197 
    198             if ( 'fmwp_topic' === $post->post_type ) {
    199                 $is_spam = get_post_meta( $post->ID, 'fmwp_spam', true );
    200                 $spam    = ! empty( $is_spam );
    201             }
    202 
    203             return $spam;
    204         }
    205 
    206 
    207         /**
    208          *
     59        /**
     60         * Initializes variables including statuses, types, status markers, and sorting criteria.
    20961         */
    21062        public function init_variables() {
     
    268120                )
    269121            );
     122            // Set statuses.
     123            $this->post_status = array( 'publish' );
     124            if ( is_user_logged_in() ) {
     125                $this->post_status[] = 'trash';
     126                $this->post_status[] = 'pending'; //pending can be visible for author
     127                if ( current_user_can( 'manage_fmwp_topics_all' ) ) {
     128                    $this->post_status[] = 'private';
     129                }
     130            }
     131        }
     132
     133        /**
     134         * @param $where
     135         * @param $wp_query
     136         *
     137         * @return mixed
     138         */
     139        public function filter_pending_for_author( $where, $wp_query ) {
     140            if ( isset( $wp_query->query['post_type'] ) && 'fmwp_topic' === $wp_query->query['post_type'] ) {
     141                if ( isset( $wp_query->query['post_status'] ) && ( 'pending' === $wp_query->query['post_status'] || ( is_array( $wp_query->query['post_status'] ) && in_array( 'pending', $wp_query->query['post_status'], true ) ) ) ) {
     142                    global $wpdb;
     143                    if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
     144                        $current_user_id = get_current_user_id();
     145
     146                        $where = str_replace( "{$wpdb->posts}.post_status = 'pending'", "( {$wpdb->posts}.post_status = 'pending' AND {$wpdb->posts}.post_author = '" . $current_user_id . "' )", $where );
     147                        $where = str_replace(
     148                            "{$wpdb->posts}.post_status = 'trash'",
     149                            "( {$wpdb->posts}.post_status = 'trash' AND {$wpdb->posts}.post_author = '$current_user_id' )",
     150                            $where
     151                        );
     152                    }
     153                }
     154            }
     155
     156            return $where;
     157        }
     158
     159        /**
     160         * Make invisible topics from trashed forums
     161         *
     162         * @param $posts
     163         * @param $query
     164         *
     165         * @return array
     166         */
     167        public function filter_topics_from_hidden_forums( $posts, $query ) {
     168            if ( FMWP()->is_request( 'admin' ) && ! FMWP()->is_request( 'ajax' ) ) {
     169                return $posts;
     170            }
     171
     172            $filtered_posts = array();
     173
     174            //if empty
     175            if ( empty( $posts ) ) {
     176                return $posts;
     177            }
     178
     179            foreach ( $posts as $post ) {
     180
     181                if ( 'fmwp_topic' !== $post->post_type ) {
     182                    $filtered_posts[] = $post;
     183                    continue;
     184                }
     185
     186                if ( ! current_user_can( 'manage_fmwp_topics_all' ) ) {
     187                    if ( $this->is_spam( $post ) ) {
     188                        continue;
     189                    }
     190                }
     191
     192                $forum_id = $this->get_forum_id( $post->ID );
     193                $forum    = get_post( $forum_id );
     194
     195                if ( in_array( $forum->post_status, array( 'private', 'pending' ), true ) && current_user_can( 'manage_fmwp_forums_all' ) ) {
     196                    $filtered_posts[] = $post;
     197                    continue;
     198                }
     199
     200                if ( 'publish' === $forum->post_status ) {
     201                    if ( current_user_can( 'manage_fmwp_forums_all' ) ) {
     202                        $filtered_posts[] = $post;
     203                        continue;
     204                    }
     205
     206                    $visibility = get_post_meta( $forum_id, 'fmwp_visibility', true );
     207                    if ( 'public' === $visibility ) {
     208                        $filtered_posts[] = $post;
     209                    }
     210                }
     211            }
     212            return $filtered_posts;
     213        }
     214
     215        /**
     216         * @param int|WP_Post|array $post
     217         *
     218         * @return bool
     219         */
     220        public function is_locked( $post ) {
     221            $locked = false;
     222            if ( is_numeric( $post ) ) {
     223                $post = get_post( $post );
     224
     225                if ( empty( $post ) || is_wp_error( $post ) ) {
     226                    return false;
     227                }
     228            }
     229
     230            if ( 'fmwp_topic' === $post->post_type ) {
     231                $is_locked = get_post_meta( $post->ID, 'fmwp_locked', true );
     232                $locked    = ! empty( $is_locked );
     233            }
     234
     235            return $locked;
     236        }
     237
     238        /**
     239         * @param int|WP_Post|array $post
     240         *
     241         * @return bool
     242         */
     243        public function is_spam( $post ) {
     244            $spam = false;
     245            if ( is_numeric( $post ) ) {
     246                $post = get_post( $post );
     247
     248                if ( empty( $post ) || is_wp_error( $post ) ) {
     249                    return false;
     250                }
     251            }
     252
     253            if ( 'fmwp_topic' === $post->post_type ) {
     254                $is_spam = get_post_meta( $post->ID, 'fmwp_spam', true );
     255                $spam    = ! empty( $is_spam );
     256            }
     257
     258            return $spam;
    270259        }
    271260
  • forumwp/trunk/includes/frontend/class-shortcodes.php

    r3205107 r3306743  
    619619                add_action( 'wp_footer', array( &$this, 'login_popup' ), -1 );
    620620            } elseif ( FMWP()->user()->can_create_topic( $args['id'] ) ) {
    621                     // pre-init ajax loader styles
    622                     FMWP()->ajax_loader_styles( 25 );
    623 
    624                     add_action( 'wp_footer', array( &$this, 'topic_popup' ), -1 );
     621                // pre-init ajax loader styles
     622                FMWP()->ajax_loader_styles( 25 );
     623
     624                add_action( 'wp_footer', array( &$this, 'topic_popup' ), -1 );
    625625            }
    626626
     
    967967            $args = shortcode_atts( $default_args, $args );
    968968
     969            /**
     970             * Fires before render User Topics List shortcode.
     971             *
     972             * @since 2.1.4
     973             * @hook fmwp_before_user_topics_shortcode
     974             *
     975             * @param {array} $args Arguments passed into shortcode.
     976             */
     977            do_action( 'fmwp_before_user_topics_shortcode', $args );
     978
    969979            ob_start();
    970980
     
    9931003
    9941004            $args = shortcode_atts( $default_args, $args );
     1005
     1006            /**
     1007             * Fires before render User Replies List shortcode.
     1008             *
     1009             * @since 2.1.4
     1010             * @hook fmwp_before_user_replies_shortcode
     1011             *
     1012             * @param {array} $args Arguments passed into shortcode.
     1013             */
     1014            do_action( 'fmwp_before_user_replies_shortcode', $args );
    9951015
    9961016            ob_start();
  • forumwp/trunk/languages/forumwp.pot

    r3205107 r3306743  
    1 # Copyright (C) 2024 ForumWP
    2 # This file is distributed under the same license as the ForumWP plugin.
     1# Copyright (C) 2025 ForumWP
     2# This file is distributed under the GPLv3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ForumWP 2.1.3\n"
     5"Project-Id-Version: ForumWP 2.1.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/forumwp\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-12-09T20:24:35+00:00\n"
     12"POT-Creation-Date: 2025-05-30T14:15:01+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: forumwp\n"
    1616
     
    4040#: includes/admin/class-columns.php:409
    4141#: includes/admin/class-columns.php:419
    42 #: includes/common/class-reply.php:763
    43 #: includes/common/class-topic.php:515
     42#: includes/common/class-reply.php:761
     43#: includes/common/class-topic.php:504
    4444msgid "Reported"
    4545msgstr ""
     
    5050#: includes/admin/class-columns.php:400
    5151#: includes/admin/class-columns.php:484
    52 #: includes/common/class-topic.php:244
     52#: includes/common/class-topic.php:96
    5353#: templates/js/forum-row.php:41
    5454#: templates/single-forum-info.php:88
     
    6363#: includes/admin/class-columns.php:404
    6464#: includes/admin/class-columns.php:414
    65 #: includes/common/class-reply.php:758
    66 #: includes/common/class-topic.php:513
     65#: includes/common/class-reply.php:756
     66#: includes/common/class-topic.php:502
    6767#: blocks-src/fmwp-topics-list/src/index.js:78
    6868#: includes/blocks/fmwp-topics-list/src/index.js:1
     
    8787#: includes/class-config.php:566
    8888#: includes/class-fmwp-functions.php:185
    89 #: includes/class-fmwp-functions.php:678
    90 #: includes/class-fmwp-functions.php:696
     89#: includes/class-fmwp-functions.php:691
     90#: includes/class-fmwp-functions.php:709
    9191#: includes/frontend/class-profile.php:62
    9292#: templates/archive-forum-header.php:15
     
    145145#: includes/admin/templates/topic/attributes.php:81
    146146#: includes/class-fmwp-functions.php:140
    147 #: includes/common/class-common.php:971
     147#: includes/common/class-common.php:969
    148148#: templates/archive-forum-header.php:21
    149149msgid "Forum"
     
    158158
    159159#: includes/admin/class-columns.php:577
    160 #: includes/class-fmwp-functions.php:682
     160#: includes/class-fmwp-functions.php:695
    161161msgid "Tags"
    162162msgstr ""
     
    203203#: includes/class-config.php:563
    204204#: includes/class-fmwp-functions.php:139
    205 #: includes/class-fmwp-functions.php:641
    206 #: includes/class-fmwp-functions.php:660
    207 #: includes/class-fmwp-functions.php:707
    208 #: includes/class-fmwp-functions.php:724
     205#: includes/class-fmwp-functions.php:654
     206#: includes/class-fmwp-functions.php:673
     207#: includes/class-fmwp-functions.php:720
     208#: includes/class-fmwp-functions.php:737
    209209#: templates/js/forum-category-list.php:20
    210210msgid "Forums"
     
    262262#. translators: %s is a plugin name.
    263263#: includes/admin/class-notices.php:204
     264#, php-format
    264265msgid "To add forum functionality to your website %s needs to create several front-end pages (Forums, Topics, Profile, Registration & Login)."
    265266msgstr ""
     
    279280#. translators: %1$s,%3$s is a plugin name; %2$s,%4$s is a plugin version; %5$s is a upgrade page URL.
    280281#: includes/admin/class-notices.php:277
     282#, php-format
    281283msgid "<strong>%1$s version %2$s</strong> needs to be updated to work correctly.<br />It is necessary to update the structure of the database and options that are associated with <strong>%3$s %4$s</strong>.<br />Please visit \"<a href=\"%5$s\">Upgrade</a>\" page and run the upgrade process."
    282284msgstr ""
     
    288290#. translators: %1$s is a plugin name; %2$s is a plugin version.
    289291#: includes/admin/class-notices.php:302
     292#, php-format
    290293msgid "<strong>%1$s %2$s</strong> Successfully Upgraded"
    291294msgstr ""
     
    293296#. translators: %1$s is a post title; %2$s is a post name (slug).
    294297#: includes/admin/class-notices.php:352
     298#, php-format
    295299msgid "Permalink Conflict! Please change permalink for the <strong>\"%1$s\"</strong> post, the <strong>\"%2$s\"</strong> slug is reserved."
    296300msgstr ""
     
    306310#. translators: %s override templates page link.
    307311#: includes/admin/class-notices.php:417
     312#, php-format
    308313msgid "Your templates are out of date. Please visit <a href=\"%s\">override templates status page</a> and update templates."
    309314msgstr ""
     
    331336#. translators: %s is a page title.
    332337#: includes/admin/class-settings.php:216
     338#, php-format
    333339msgid "%s page"
    334340msgstr ""
     
    404410
    405411#: includes/admin/class-settings.php:334
    406 #: includes/common/class-reply.php:120
    407 #: includes/common/class-topic.php:265
     412#: includes/common/class-reply.php:52
     413#: includes/common/class-topic.php:117
    408414#: blocks-src/fmwp-forum/src/index.js:46
    409415#: blocks-src/fmwp-forums-list/src/index.js:62
     
    418424
    419425#: includes/admin/class-settings.php:335
    420 #: includes/common/class-reply.php:119
    421 #: includes/common/class-topic.php:264
     426#: includes/common/class-reply.php:51
     427#: includes/common/class-topic.php:116
    422428#: blocks-src/fmwp-forum/src/index.js:47
    423429#: blocks-src/fmwp-forums-list/src/index.js:63
     
    577583#. translators: %s is a plan data.
    578584#: includes/admin/class-settings.php:500
     585#, php-format
    579586msgid "%s modules"
    580587msgstr ""
     
    634641#. translators: %s: Last checking templates time.
    635642#: includes/admin/class-settings.php:844
     643#, php-format
    636644msgid "Last update: %s. You could re-check changes manually."
    637645msgstr ""
     
    643651#. translators: %s: Link to the docs article.
    644652#: includes/admin/class-settings.php:853
     653#, php-format
    645654msgid "You may get more details about overriding templates <a href=\"%s\" target=\"_blank\">here</a>."
    646655msgstr ""
     
    660669#. translators: %s is a new plugins version
    661670#: includes/admin/class-upgrade.php:122
     671#, php-format
    662672msgid "%s is a major update, and we highly recommend creating a full backup of your site before updating."
    663673msgstr ""
     
    673683#. translators: %s is the plugin name.
    674684#: includes/admin/class-upgrade.php:227
     685#, php-format
    675686msgid "%s - Upgrade Process"
    676687msgstr ""
     
    678689#. translators: %1$s is the installed version. %2$s is the DB version.
    679690#: includes/admin/class-upgrade.php:233
     691#, php-format
    680692msgid "You have installed <strong>%1$s</strong> version. Your latest DB version is <strong>%2$s</strong>. We recommend creating a backup of your site before running the update process. Do not exit the page before the update process has complete."
    681693msgstr ""
     
    720732#. translators: %s is a count.
    721733#: includes/admin/packages/2.0.1/spam.php:15
     734#, php-format
    722735msgid "Spam <span class=\"count\">(%s)</span>"
    723736msgid_plural "Spam <span class=\"count\">(%s)</span>"
     
    756769#. translators: %s is a count
    757770#: includes/admin/packages/2.0/locked.php:15
     771#, php-format
    758772msgid "Locked <span class=\"count\">(%s)</span>"
    759773msgid_plural "Locked <span class=\"count\">(%s)</span>"
     
    768782#. translators: %s is a count.
    769783#: includes/admin/packages/2.0/solved.php:15
     784#, php-format
    770785msgid "Solved <span class=\"count\">(%s)</span>"
    771786msgid_plural "Solved <span class=\"count\">(%s)</span>"
     
    854869#. translators: %s is a plugin name.
    855870#: includes/admin/templates/settings/settings.php:12
     871#, php-format
    856872msgid "%s - Settings"
    857873msgstr ""
     
    889905msgstr ""
    890906
    891 #: includes/ajax/class-forum.php:211
    892 #: includes/ajax/class-forum.php:245
    893 #: includes/ajax/class-forum.php:280
    894 #: includes/ajax/class-forum.php:310
    895 #: includes/ajax/class-forum.php:337
    896 #: includes/ajax/class-reply.php:444
    897 #: includes/ajax/class-reply.php:562
    898 #: includes/ajax/class-reply.php:623
    899 #: includes/ajax/class-reply.php:659
    900 #: includes/ajax/class-reply.php:696
    901 #: includes/ajax/class-reply.php:806
    902 #: includes/ajax/class-reply.php:840
     907#: includes/ajax/class-forum.php:212
     908#: includes/ajax/class-forum.php:246
     909#: includes/ajax/class-forum.php:281
     910#: includes/ajax/class-forum.php:311
     911#: includes/ajax/class-forum.php:338
     912#: includes/ajax/class-reply.php:440
     913#: includes/ajax/class-reply.php:558
     914#: includes/ajax/class-reply.php:619
     915#: includes/ajax/class-reply.php:655
     916#: includes/ajax/class-reply.php:692
     917#: includes/ajax/class-reply.php:802
     918#: includes/ajax/class-reply.php:836
    903919#: includes/ajax/class-topic.php:495
    904920#: includes/ajax/class-topic.php:616
     
    915931msgstr ""
    916932
    917 #: includes/ajax/class-forum.php:218
    918 #: includes/ajax/class-forum.php:252
    919 #: includes/ajax/class-forum.php:287
    920 #: includes/ajax/class-forum.php:317
    921 #: includes/ajax/class-forum.php:344
     933#: includes/ajax/class-forum.php:219
     934#: includes/ajax/class-forum.php:253
     935#: includes/ajax/class-forum.php:288
     936#: includes/ajax/class-forum.php:318
     937#: includes/ajax/class-forum.php:345
    922938msgid "Forum ID is invalid"
    923939msgstr ""
    924940
    925 #: includes/ajax/class-forum.php:222
     941#: includes/ajax/class-forum.php:223
    926942msgid "You do not have the ability to move this forum to trash"
    927943msgstr ""
    928944
    929 #: includes/ajax/class-forum.php:256
     945#: includes/ajax/class-forum.php:257
    930946msgid "You do not have the ability to restore this forum"
    931947msgstr ""
    932948
    933 #: includes/ajax/class-forum.php:291
     949#: includes/ajax/class-forum.php:292
    934950#: includes/ajax/class-topic.php:812
    935951msgid "You do not have the ability to delete this topic"
    936952msgstr ""
    937953
    938 #: includes/ajax/class-forum.php:298
     954#: includes/ajax/class-forum.php:299
    939955msgid "Forum was deleted successfully."
    940956msgstr ""
     
    962978msgstr ""
    963979
    964 #: includes/ajax/class-reply.php:351
    965 #: includes/ajax/class-reply.php:357
    966 #: includes/ajax/class-reply.php:531
     980#: includes/ajax/class-reply.php:347
     981#: includes/ajax/class-reply.php:353
     982#: includes/ajax/class-reply.php:527
    967983msgid "Invalid reply"
    968984msgstr ""
    969985
    970 #: includes/ajax/class-reply.php:451
     986#: includes/ajax/class-reply.php:447
    971987#: includes/ajax/class-topic.php:906
    972988#: includes/ajax/class-topic.php:934
     
    975991msgstr ""
    976992
    977 #: includes/ajax/class-reply.php:457
     993#: includes/ajax/class-reply.php:453
    978994msgid "You haven't capabilities to make this action"
    979995msgstr ""
    980996
    981 #: includes/ajax/class-reply.php:464
     997#: includes/ajax/class-reply.php:460
    982998msgid "Empty or Invalid Topic ID."
    983999msgstr ""
    9841000
    985 #: includes/ajax/class-reply.php:471
    986 #: includes/ajax/class-reply.php:582
     1001#: includes/ajax/class-reply.php:467
     1002#: includes/ajax/class-reply.php:578
    9871003#: includes/ajax/class-topic.php:440
    9881004#: includes/ajax/class-topic.php:523
     
    9911007
    9921008#. translators: %s is a reply creation delay
    993 #: includes/ajax/class-reply.php:483
     1009#: includes/ajax/class-reply.php:479
     1010#, php-format
    9941011msgid "You cannot leave replies faster than %s seconds"
    9951012msgstr ""
    9961013
    997 #: includes/ajax/class-reply.php:525
     1014#: includes/ajax/class-reply.php:521
    9981015msgid "Invalid reply ID"
    9991016msgstr ""
    10001017
    1001 #: includes/ajax/class-reply.php:535
    1002 #: includes/ajax/class-reply.php:575
     1018#: includes/ajax/class-reply.php:531
     1019#: includes/ajax/class-reply.php:571
    10031020msgid "You do not have the ability to edit this reply"
    10041021msgstr ""
    10051022
    1006 #: includes/ajax/class-reply.php:569
    1007 #: includes/ajax/class-reply.php:630
    1008 #: includes/ajax/class-reply.php:666
    1009 #: includes/ajax/class-reply.php:703
    1010 #: includes/ajax/class-reply.php:813
    1011 #: includes/ajax/class-reply.php:847
     1023#: includes/ajax/class-reply.php:565
     1024#: includes/ajax/class-reply.php:626
     1025#: includes/ajax/class-reply.php:662
     1026#: includes/ajax/class-reply.php:699
     1027#: includes/ajax/class-reply.php:809
     1028#: includes/ajax/class-reply.php:843
    10121029msgid "Reply ID is invalid"
    10131030msgstr ""
    10141031
    1015 #: includes/ajax/class-reply.php:604
     1032#: includes/ajax/class-reply.php:600
    10161033#: includes/ajax/class-topic.php:552
    10171034msgid "Something is wrong with the data"
    10181035msgstr ""
    10191036
    1020 #: includes/ajax/class-reply.php:634
     1037#: includes/ajax/class-reply.php:630
    10211038msgid "You do not have the ability to move this reply to trash"
    10221039msgstr ""
    10231040
    1024 #: includes/ajax/class-reply.php:670
     1041#: includes/ajax/class-reply.php:666
    10251042msgid "You do not have the ability to restore this reply"
    10261043msgstr ""
    10271044
    1028 #: includes/ajax/class-reply.php:707
     1045#: includes/ajax/class-reply.php:703
    10291046msgid "You do not have the ability to delete this reply"
    10301047msgstr ""
    10311048
    1032 #: includes/ajax/class-reply.php:817
     1049#: includes/ajax/class-reply.php:813
    10331050msgid "You do not have the ability to mark this reply as spam"
    10341051msgstr ""
    10351052
    1036 #: includes/ajax/class-reply.php:851
     1053#: includes/ajax/class-reply.php:847
    10371054msgid "You do not have the ability to restore this reply from spam"
    10381055msgstr ""
    10391056
    1040 #: includes/ajax/class-reply.php:874
    1041 #: includes/ajax/class-reply.php:902
    1042 #: includes/ajax/class-reply.php:929
     1057#: includes/ajax/class-reply.php:870
     1058#: includes/ajax/class-reply.php:898
     1059#: includes/ajax/class-reply.php:925
    10431060msgid "Empty Reply ID"
    10441061msgstr ""
    10451062
    1046 #: includes/ajax/class-reply.php:882
     1063#: includes/ajax/class-reply.php:878
    10471064#: includes/ajax/class-topic.php:921
    10481065msgid "Something wrong with reports"
    10491066msgstr ""
    10501067
    1051 #: includes/ajax/class-reply.php:909
    1052 #: includes/ajax/class-reply.php:944
     1068#: includes/ajax/class-reply.php:905
     1069#: includes/ajax/class-reply.php:940
    10531070#: includes/ajax/class-topic.php:949
    10541071#: includes/ajax/class-topic.php:977
     
    10581075#. translators: %s is an author display name
    10591076#: includes/ajax/class-topic.php:84
     1077#, php-format
    10601078msgid "Created by %s"
    10611079msgstr ""
     
    10631081#. translators: %s is a last replies author display name
    10641082#: includes/ajax/class-topic.php:103
     1083#, php-format
    10651084msgid "Last reply by %s"
    10661085msgstr ""
     
    10891108#. translators: %s is a topic delay time
    10901109#: includes/ajax/class-topic.php:452
     1110#, php-format
    10911111msgid "You cannot create topics faster than %s seconds"
    10921112msgstr ""
     
    11391159
    11401160#: includes/ajax/class-user.php:41
    1141 #: includes/common/class-common.php:318
     1161#: includes/common/class-common.php:317
    11421162msgid "Everyone"
    11431163msgstr ""
    11441164
    11451165#: includes/ajax/class-user.php:46
    1146 #: includes/common/class-common.php:315
     1166#: includes/common/class-common.php:314
    11471167msgid "All"
    11481168msgstr ""
     
    11921212#. translators: %s is a plugin name.
    11931213#: includes/class-dependencies.php:75
     1214#, php-format
    11941215msgid "Please check <strong>\"%s\"</strong> plugin's folder name. Correct folder name is <strong>\"forumwp\"</strong>"
    11951216msgstr ""
     
    12121233
    12131234#: includes/class-fmwp-functions.php:145
    1214 #: includes/common/class-common.php:1012
     1235#: includes/common/class-common.php:1010
    12151236msgid "Edit Forum"
    12161237msgstr ""
     
    12631284
    12641285#: includes/class-fmwp-functions.php:186
    1265 #: includes/common/class-common.php:982
     1286#: includes/common/class-common.php:980
    12661287#: templates/archive-topic-header.php:26
    12671288msgid "Topic"
     
    12821303
    12831304#: includes/class-fmwp-functions.php:191
    1284 #: includes/common/class-common.php:1024
     1305#: includes/common/class-common.php:1022
    12851306msgid "Edit Topic"
    12861307msgstr ""
     
    13121333
    13131334#: includes/class-fmwp-functions.php:225
    1314 #: includes/common/class-topic.php:1145
    1315 #: includes/common/class-topic.php:1152
     1335#: includes/common/class-topic.php:1134
     1336#: includes/common/class-topic.php:1141
    13161337#: templates/js/reply-row.php:117
    13171338#: templates/js/reply-row.php:132
     
    14671488msgstr ""
    14681489
    1469 #: includes/class-fmwp-functions.php:612
     1490#: includes/class-fmwp-functions.php:625
    14701491msgid "Home"
    14711492msgstr ""
    14721493
    1473 #: includes/class-fmwp-functions.php:645
     1494#: includes/class-fmwp-functions.php:658
    14741495#: templates/new-forum.php:47
    14751496msgid "Categories"
     
    14811502msgstr ""
    14821503
    1483 #: includes/class-modules.php:38
     1504#: includes/class-modules.php:39
    14841505msgid "Basic"
    14851506msgstr ""
    14861507
    1487 #: includes/class-modules.php:41
     1508#: includes/class-modules.php:42
    14881509msgid "Migration"
    14891510msgstr ""
    14901511
    1491 #: includes/class-modules.php:42
     1512#: includes/class-modules.php:43
    14921513msgid "Ability to migration forums, topics and replies from bbPress"
    14931514msgstr ""
    14941515
    1495 #: includes/common/class-forum.php:40
     1516#: includes/common/class-forum.php:55
    14961517msgid "Public"
    14971518msgstr ""
    14981519
    1499 #: includes/common/class-forum.php:41
     1520#: includes/common/class-forum.php:56
    15001521msgid "Private"
    15011522msgstr ""
    15021523
    1503 #: includes/common/class-forum.php:42
     1524#: includes/common/class-forum.php:57
    15041525msgid "Hidden"
    15051526msgstr ""
    15061527
    1507 #: includes/common/class-forum.php:172
     1528#: includes/common/class-forum.php:173
    15081529msgid "Unlock forum"
    15091530msgstr ""
    15101531
    1511 #: includes/common/class-forum.php:179
     1532#: includes/common/class-forum.php:180
    15121533msgid "Lock forum"
    15131534msgstr ""
    15141535
    1515 #: includes/common/class-forum.php:189
    1516 #: includes/common/class-reply.php:835
    1517 #: includes/common/class-topic.php:590
     1536#: includes/common/class-forum.php:190
     1537#: includes/common/class-reply.php:833
     1538#: includes/common/class-topic.php:579
    15181539msgid "Move to trash"
    15191540msgstr ""
    15201541
    1521 #: includes/common/class-forum.php:205
     1542#: includes/common/class-forum.php:206
    15221543msgid "Restore forum"
    15231544msgstr ""
    15241545
    1525 #: includes/common/class-forum.php:214
     1546#: includes/common/class-forum.php:215
    15261547msgid "Remove forum"
    15271548msgstr ""
     
    15341555#: includes/common/class-mail.php:103
    15351556#: includes/common/class-mail.php:221
     1557#, php-format
    15361558msgid "<code>%s</code> does not exist."
    15371559msgstr ""
     
    15391561#. translators: %s is a topic title
    15401562#. translators: %s is a topic title.
    1541 #: includes/common/class-reply.php:406
     1563#: includes/common/class-reply.php:404
    15421564#: modules/migration/class-init.php:909
     1565#, php-format
    15431566msgid "Reply To: %s"
    15441567msgstr ""
    15451568
    1546 #: includes/common/class-reply.php:749
    1547 #: includes/common/class-topic.php:215
    1548 #: includes/common/class-topic.php:516
     1569#: includes/common/class-reply.php:747
     1570#: includes/common/class-topic.php:67
     1571#: includes/common/class-topic.php:505
    15491572#: blocks-src/fmwp-topics-list/src/index.js:76
    15501573#: includes/blocks/fmwp-topics-list/src/index.js:1
     
    15521575msgstr ""
    15531576
    1554 #: includes/common/class-reply.php:753
    1555 #: includes/common/class-topic.php:511
     1577#: includes/common/class-reply.php:751
     1578#: includes/common/class-topic.php:500
    15561579#: templates/js/forum-row.php:55
    15571580msgid "Trashed"
    15581581msgstr ""
    15591582
    1560 #: includes/common/class-reply.php:826
     1583#: includes/common/class-reply.php:824
    15611584msgid "Edit reply"
    15621585msgstr ""
    15631586
    1564 #: includes/common/class-reply.php:844
    1565 #: includes/common/class-topic.php:599
     1587#: includes/common/class-reply.php:842
     1588#: includes/common/class-topic.php:588
    15661589msgid "Mark as spam"
    15671590msgstr ""
    15681591
    1569 #: includes/common/class-reply.php:853
    1570 #: includes/common/class-topic.php:608
     1592#: includes/common/class-reply.php:851
     1593#: includes/common/class-topic.php:597
    15711594msgid "Isn't spam"
    15721595msgstr ""
    15731596
    1574 #: includes/common/class-reply.php:864
     1597#: includes/common/class-reply.php:862
    15751598msgid "Report reply"
    15761599msgstr ""
    15771600
    1578 #: includes/common/class-reply.php:871
     1601#: includes/common/class-reply.php:869
    15791602msgid "Un-report reply"
    15801603msgstr ""
    15811604
    1582 #: includes/common/class-reply.php:881
     1605#: includes/common/class-reply.php:879
    15831606msgid "Clear reply's reports"
    15841607msgstr ""
    15851608
    1586 #: includes/common/class-reply.php:891
     1609#: includes/common/class-reply.php:889
    15871610msgid "Restore reply"
    15881611msgstr ""
    15891612
    1590 #: includes/common/class-reply.php:900
     1613#: includes/common/class-reply.php:898
    15911614msgid "Remove reply"
    15921615msgstr ""
    15931616
    1594 #: includes/common/class-topic.php:214
     1617#: includes/common/class-topic.php:66
    15951618msgid "Open"
    15961619msgstr ""
    15971620
    1598 #: includes/common/class-topic.php:216
     1621#: includes/common/class-topic.php:68
    15991622#: blocks-src/fmwp-topics-list/src/index.js:77
    16001623#: includes/blocks/fmwp-topics-list/src/index.js:1
     
    16021625msgstr ""
    16031626
    1604 #: includes/common/class-topic.php:222
     1627#: includes/common/class-topic.php:74
    16051628msgid "Normal"
    16061629msgstr ""
    16071630
    1608 #: includes/common/class-topic.php:226
    1609 #: includes/common/class-topic.php:248
     1631#: includes/common/class-topic.php:78
     1632#: includes/common/class-topic.php:100
    16101633msgid "Pinned"
    16111634msgstr ""
    16121635
    1613 #: includes/common/class-topic.php:230
    1614 #: includes/common/class-topic.php:252
     1636#: includes/common/class-topic.php:82
     1637#: includes/common/class-topic.php:104
    16151638msgid "Announcement"
    16161639msgstr ""
    16171640
    1618 #: includes/common/class-topic.php:234
    1619 #: includes/common/class-topic.php:256
     1641#: includes/common/class-topic.php:86
     1642#: includes/common/class-topic.php:108
    16201643msgid "Global"
    16211644msgstr ""
    16221645
    1623 #: includes/common/class-topic.php:266
     1646#: includes/common/class-topic.php:118
    16241647#: blocks-src/fmwp-forum/src/index.js:48
    16251648#: blocks-src/fmwp-topics-list/src/index.js:101
     
    16291652msgstr ""
    16301653
    1631 #: includes/common/class-topic.php:267
     1654#: includes/common/class-topic.php:119
    16321655#: blocks-src/fmwp-forum/src/index.js:49
    16331656#: blocks-src/fmwp-topics-list/src/index.js:102
     
    16371660msgstr ""
    16381661
    1639 #: includes/common/class-topic.php:545
     1662#: includes/common/class-topic.php:534
    16401663msgid "Edit topic"
    16411664msgstr ""
    16421665
    1643 #: includes/common/class-topic.php:554
     1666#: includes/common/class-topic.php:543
    16441667msgid "Pin topic"
    16451668msgstr ""
    16461669
    1647 #: includes/common/class-topic.php:563
     1670#: includes/common/class-topic.php:552
    16481671msgid "Unpin topic"
    16491672msgstr ""
    16501673
    1651 #: includes/common/class-topic.php:572
     1674#: includes/common/class-topic.php:561
    16521675msgid "Lock topic"
    16531676msgstr ""
    16541677
    1655 #: includes/common/class-topic.php:581
     1678#: includes/common/class-topic.php:570
    16561679msgid "Unlock topic"
    16571680msgstr ""
    16581681
    1659 #: includes/common/class-topic.php:618
     1682#: includes/common/class-topic.php:607
    16601683msgid "Report topic"
    16611684msgstr ""
    16621685
    1663 #: includes/common/class-topic.php:625
     1686#: includes/common/class-topic.php:614
    16641687msgid "Un-report topic"
    16651688msgstr ""
    16661689
    1667 #: includes/common/class-topic.php:635
     1690#: includes/common/class-topic.php:624
    16681691msgid "Clear topic's reports"
    16691692msgstr ""
    16701693
    1671 #: includes/common/class-topic.php:651
     1694#: includes/common/class-topic.php:640
    16721695msgid "Restore topic"
    16731696msgstr ""
    16741697
    1675 #: includes/common/class-topic.php:660
     1698#: includes/common/class-topic.php:649
    16761699msgid "Remove topic"
    16771700msgstr ""
    16781701
    1679 #: includes/common/class-topic.php:1152
     1702#: includes/common/class-topic.php:1141
    16801703#: templates/js/reply-row.php:120
    16811704#: templates/js/reply-row.php:135
     
    16851708msgstr ""
    16861709
    1687 #: includes/common/class-topic.php:1156
     1710#: includes/common/class-topic.php:1145
    16881711#: templates/topic.php:288
    16891712#: templates/topic.php:291
     
    17831806#. translators: %s is a forum category name
    17841807#: includes/frontend/class-shortcodes.php:339
     1808#, php-format
    17851809msgid "Forum Category: %s"
    17861810msgstr ""
     
    17881812#. translators: %s is a topic tag name
    17891813#: includes/frontend/class-shortcodes.php:345
     1814#, php-format
    17901815msgid "Topic Tag: %s"
    17911816msgstr ""
     
    18341859#. translators: %1$d and %2$d are from-to migrated forums numbers.
    18351860#: modules/migration/class-init.php:431
     1861#, php-format
    18361862msgid "Forums from %1$d to %2$d are migrated"
    18371863msgstr ""
     
    18391865#. translators: %1$d and %2$d are from-to migrated topics numbers.
    18401866#: modules/migration/class-init.php:595
     1867#, php-format
    18411868msgid "Topics from %1$d to %2$d are migrated"
    18421869msgstr ""
     
    18441871#. translators: %1$d and %2$d are from-to migrated topic tabs numbers.
    18451872#: modules/migration/class-init.php:749
     1873#, php-format
    18461874msgid "Topic tags from %1$d to %2$d are migrated"
    18471875msgstr ""
     
    18491877#. translators: %1$d and %2$d are from-to migrated replies numbers.
    18501878#: modules/migration/class-init.php:817
     1879#, php-format
    18511880msgid "Replies from %1$d to %2$d are migrated"
    18521881msgstr ""
     
    19121941#. translators: %s is the class attribute
    19131942#: templates/forum.php:70
     1943#, php-format
    19141944msgid "Please <a href=\"#\" class=\"%s\" title=\"Login to view\" data-fmwp_popup_title=\"Login to view forum\">login</a> to view this forum"
    19151945msgstr ""
     
    20892119#: templates/profile/main.php:85
    20902120#: templates/user-card.php:66
     2121#, php-format
    20912122msgid "%s topic"
    20922123msgid_plural "%s topics"
     
    20982129#: templates/profile/main.php:92
    20992130#: templates/user-card.php:75
     2131#, php-format
    21002132msgid "%s reply"
    21012133msgid_plural "%s replies"
     
    21062138#: templates/profile/main-mobile.php:64
    21072139#: templates/profile/main.php:100
     2140#, php-format
    21082141msgid "Joined: %s"
    21092142msgstr ""
     
    21372170#. translators: %s is a topic title
    21382171#: templates/reply-popup.php:52
     2172#, php-format
    21392173msgid "Replying to: \"%s\""
    21402174msgstr ""
     
    21702204#. translators: %s is the class attribute
    21712205#: templates/topic.php:124
     2206#, php-format
    21722207msgid "Please <a href=\"#\" class=\"%s\" title=\"Login to view\" data-fmwp_popup_title=\"Login to view topic\">login</a> to view this topic"
    21732208msgstr ""
     
    21752210#. translators: %s is a total replies count
    21762211#: templates/topic.php:160
     2212#, php-format
    21772213msgid "<span id=\"fmwp-replies-total\">%s</span> reply"
    21782214msgid_plural "<span id=\"fmwp-replies-total\">%s</span> replies"
     
    21822218#. translators: %s is a total topics count
    21832219#: templates/topic.php:170
     2220#, php-format
    21842221msgid "<span id=\"fmwp-views-total\">%s</span> view"
    21852222msgid_plural "<span id=\"fmwp-views-total\">%s</span> views"
     
    21892226#. translators: %s is the user display name.
    21902227#: templates/topic.php:221
     2228#, php-format
    21912229msgid "%s Profile"
    21922230msgstr ""
  • forumwp/trunk/readme.txt

    r3205107 r3306743  
    66Requires PHP: 7.0
    77Requires at least: 5.5
    8 Tested up to: 6.7
    9 Stable tag: 2.1.3
     8Tested up to: 6.8
     9Stable tag: 2.1.4
    1010License: GPLv3
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.txt
     
    6161
    6262== Changelog ==
     63
     64= 2.1.4: June 04, 2025 =
     65
     66* Added: Action hooks 'fmwp_change_template_part', 'fmwp_before_user_topics_shortcode', 'fmwp_before_user_replies_shortcode' for 3rd-party integrations.
     67* Fixed: Loading textdomain for compatibility with WordPress 6.7 and 6.8.
     68
     69* Templates required update:
     70  - js/forum-row.php
    6371
    6472= 2.1.3: December 09, 2024 =
  • forumwp/trunk/templates/js/forum-row.php

    r3205107 r3306743  
    55 * This template can be overridden by copying it to your-theme/forumwp/js/forum-row.php
    66 *
    7  * @version 2.1.3
     7 * @version 2.1.4
    88 *
    99 * @var array $fmwp_js_forum_row
     
    1717?>
    1818
    19 <div class="fmwp-forum-row<# if ( <?php echo esc_js( $item ); ?>.is_locked ) { #> fmwp-forum-locked<# } #><# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #> fmwp-forum-trashed<# } #><# if ( Object.keys( <?php echo esc_js( $item ); ?>.dropdown_actions ).length === 0 ) { #> fmwp-forum-no-actions<# } #>" data-forum_id="{{{<?php echo esc_js( $item ); ?>.forum_id}}}" data-trashed="<# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #>1<# } #>">
     19<div class="fmwp-forum-row<# if ( <?php echo esc_js( $item ); ?>.is_locked ) { #> fmwp-forum-locked<# } #><# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #> fmwp-forum-trashed<# } #><# if ( Object.keys( <?php echo esc_js( $item ); ?>.dropdown_actions ).length === 0 ) { #> fmwp-forum-no-actions<# } #> {{{<?php echo esc_js( $item ); ?>.extra_classes}}}" data-forum_id="{{{<?php echo esc_js( $item ); ?>.forum_id}}}" data-trashed="<# if ( <?php echo esc_js( $item ); ?>.is_trashed ) { #>1<# } #>">
    2020    <div class="fmwp-forum-row-lines">
    2121
Note: See TracChangeset for help on using the changeset viewer.