Plugin Directory

Changeset 715221


Ignore:
Timestamp:
05/19/2013 12:30:42 PM (13 years ago)
Author:
tkrivickas
Message:

IMPR: renamed 'Menu item updater' to 'API Sync', added an additional hook to menu update

Location:
live-stream-badger/trunk
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • live-stream-badger/trunk/live-stream-badger-plugin.php

    r713017 r715221  
    1818include_once LSB_PLUGIN_BASE . 'stream-status-widget.php';
    1919include_once LSB_PLUGIN_BASE . 'shortcode/class-embedded-stream.php';
    20 include_once LSB_PLUGIN_BASE . 'scheduler/class-menu-item-updater.php';
     20include_once LSB_PLUGIN_BASE . 'scheduler/class-api-sync.php';
    2121
    2222// Register widget
     
    3535
    3636//
    37 // Register updater to start on activation/ stop on deactivation
     37// Hook synchronization with APIs to certain actions
    3838//
    39 $lsb_menu_item_updater = new LSB_Menu_Item_Updater();
    40 add_action( 'lsb_update_all_stream_status', array( $lsb_menu_item_updater, 'updateAll' ) );
     39$lsb_api_sync = new LSB_API_Sync();
     40add_action( 'lsb_update_all_stream_status', array( $lsb_api_sync, 'updateAll' ) ); // Scheduled action (5 minutes)
     41add_action( 'wp_update_nav_menu', array( $lsb_api_sync, 'updateAll' ) );           // When an administrator updates any menu
    4142
    4243register_activation_hook( __FILE__, 'lsb_activation' );
  • live-stream-badger/trunk/scheduler/class-api-sync.php

    r714835 r715221  
    1414 * 'Watching now' count is stored in $nav_menu_item->description.
    1515 */
    16 class LSB_Menu_Item_Updater {
     16class LSB_API_Sync {
    1717
    1818    function updateAll() {
Note: See TracChangeset for help on using the changeset viewer.