Plugin Directory

Changeset 3481583


Ignore:
Timestamp:
03/13/2026 12:05:48 AM (3 weeks ago)
Author:
sflwa
Message:

Small code tweak for a widget filter

Location:
ticket-status-sync-for-fluentsupport-to-mainwp
Files:
14 added
3 edited

Legend:

Unmodified
Added
Removed
  • ticket-status-sync-for-fluentsupport-to-mainwp/trunk/class/class-ticket-status-sync-for-fluentsupport-to-mainwp-admin.php

    r3458357 r3481583  
    2828    }
    2929
    30     /**
    31      * AJAX Fetch Logic (Stays the same, updates log option)
    32      */
    3330    public function ajax_fetch_tickets() {
    3431        check_ajax_referer( 'ticket-status-sync-for-fluentsupport-to-mainwp-nonce', 'security' );
     
    8885    }
    8986
    90     /**
    91      * RENDERS NEW SYNC LOG TAB
    92      */
    9387    public function render_log_tab() {
    9488        $log = get_option( 'mainwp_fluentsupport_sync_log', 'No log data yet.' );
     
    189183        <?php
    190184    }
     185
     186    /**
     187     * Widgets screen options.
     188     *
     189     * @param array $input Input.
     190     *
     191     * @return array $input Input.
     192     */
     193    public function widgets_screen_options( $input ) {
     194        $input['advanced-fluentsupport-tickets-widget'] = __( 'FluentSupport Tickets', 'ticket-status-sync-for-fluentsupport-to-mainwp' );
     195        return $input;
     196    }
    191197}
  • ticket-status-sync-for-fluentsupport-to-mainwp/trunk/readme.txt

    r3475076 r3481583  
    33Plugin URI: https://github.com/sflwa/fs-mainwp
    44Description: Integrates FluentSupport ticket data from a single "Support Site" into the MainWP Dashboard.
    5 Version: 1.2.6
     5Version: 1.2.7
    66Author: South Florida Web Advisors
    77Author URI: https://sflwa.net
     
    99Requires PHP: 7.4
    1010Tested up to: 6.9
    11 Stable tag: 1.2.6
     11Stable tag: 1.2.7
    1212License: GPLv2 or later
    1313
     
    4848== Changelog ==
    4949
     50= 1.2.7 ==
     51* Added / Fixed - Checkbox for Page setup to hide widget
     52
    5053= 1.2.6 =
    5154* Added Sort & Order by to Ticket Query to match requirement from FluentSupport
  • ticket-status-sync-for-fluentsupport-to-mainwp/trunk/ticket-status-sync-for-fluentsupport-to-mainwp.php

    r3475076 r3481583  
    44 * Plugin URI:  https://github.com/sflwa/ticket-status-sync-for-fluentsupport-to-mainwp
    55 * Description: Integrates FluentSupport ticket data from a single "Support Site" into the MainWP Dashboard.
    6  * Version:     1.2.6
     6 * Version:     1.2.7
    77 * Author:      South Florida Web Advisors
    88 * Author URI:  https://sflwa.net
     
    3939
    4040    protected $plugin_handle    = 'ticket-status-sync-for-fluentsupport-to-mainwp';
    41     protected $software_version = '1.2.5';
     41    protected $software_version = '1.2.9';
    4242
    4343    public function __construct() {
     
    5252        add_action( 'mainwp_fluentsupport_sync_tickets_cron', array( $this, 'mainwp_fluentsupport_sync_tickets_cron' ) );
    5353
    54         // NEW: Auto-refresh schedule on plugin update
    5554        add_action( 'admin_init', array( $this, 'check_version_and_refresh_cron' ) );
    5655
     
    7170    }
    7271
    73     /**
    74      * Ensures the cron is refreshed automatically when users update the plugin.
    75      */
    7672    public function check_version_and_refresh_cron() {
    7773        $db_version = get_option( 'mainwp_fluentsupport_version', '1.0.0' );
    7874        if ( version_compare( $db_version, $this->software_version, '<' ) ) {
    79             $this->activate(); // Re-runs the cron scheduling logic
     75            $this->activate();
    8076            update_option( 'mainwp_fluentsupport_version', $this->software_version );
    8177        }
     
    114110        }
    115111        add_filter( 'mainwp_getmetaboxes', array( $this, 'hook_get_metaboxes' ) );
     112        add_filter( 'mainwp_widgets_screen_options', array( MainWP_FluentSupport_Admin::get_instance(), 'widgets_screen_options' ), 10, 1 );
     113
    116114        MainWP_FluentSupport_Admin::get_instance();
    117115        MainWP_FluentSupport_Overview::get_instance();
     
    133131        if ( ! empty( $url ) && ! empty( $user ) && ! empty( $pass ) ) {
    134132            $result = MainWP_FluentSupport_Utility::api_sync_tickets( $url, $user, $pass );
    135            
    136             // LOG THE STATUS FOR DEBUGGING
    137133            $status = $result['success'] ? 'Success: ' . $result['synced'] . ' tickets.' : 'Error: ' . $result['error'];
    138134            update_option( 'mainwp_fluentsupport_sync_log', current_time( 'mysql' ) . ' - ' . $status );
     
    156152
    157153    public function hook_get_metaboxes( $metaboxes ) {
     154        if ( ! is_array( $metaboxes ) ) {
     155            $metaboxes = array();
     156        }
     157
    158158        $metaboxes[] = array(
    159159            'id'            => 'fluentsupport-tickets-widget',
Note: See TracChangeset for help on using the changeset viewer.