• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Callables::init_listeners() – Initialize callables action listeners.

You appear to be a bot. Output may be restricted

Description

Initialize callables action listeners.

Usage

Callables::init_listeners( $callable );

Parameters

$callable
( callable ) required – Action handler callable.

Returns

void

Source

File name: jetpack/vendor/automattic/jetpack-sync/src/modules/class-callables.php


Lines:

1 to 24 of 24
  public function init_listeners( $callable ) {
    add_action( 'jetpack_sync_callable', $callable, 10, 2 );
    add_action( 'current_screen', array( $this, 'set_plugin_action_links' ), 9999 ); // Should happen very late.

    foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS as $option ) {
      add_action( "update_option_{$option}", array( $this, 'unlock_sync_callable' ) );
      add_action( "delete_option_{$option}", array( $this, 'unlock_sync_callable' ) );
    }

    foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS_NEXT_TICK as $option ) {
      add_action( "update_option_{$option}", array( $this, 'unlock_sync_callable_next_tick' ) );
      add_action( "delete_option_{$option}", array( $this, 'unlock_sync_callable_next_tick' ) );
    }

    // Provide a hook so that hosts can send changes to certain callables right away.
    // Especially useful when a host uses constants to change home and siteurl.
    add_action( 'jetpack_sync_unlock_sync_callable', array( $this, 'unlock_sync_callable' ) );

    // get_plugins and wp_version
    // gets fired when new code gets installed, updates etc.
    add_action( 'upgrader_process_complete', array( $this, 'unlock_plugin_action_link_and_callables' ) );
    add_action( 'update_option_active_plugins', array( $this, 'unlock_plugin_action_link_and_callables' ) );
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 10 December 2020

Primary Sidebar

Information

Function name: Callables::init_listeners
Class ref: Callables
Plugin ref: Jetpack
Version: 9.2
Sourcefile: vendor/automattic/jetpack-sync/src/modules/class-callables.php
File ref: vendor/automattic/jetpack-sync/src/modules/class-callables.php
Deprecated?: No
API Letters: C,I,L

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites