PHP 8.2.31
Preview: wordpress-post-widget.php Size: 3.71 KB
/home/nshryvcy/himaltourism.com/wp-content/plugins/jetpack/modules/widgets/wordpress-post-widget.php

<?php
/**
 * Plugin Name: Display Recent WordPress Posts Widget
 * Description: Displays recent posts from a WordPress.com or Jetpack-enabled self-hosted WordPress site.
 * Version: 1.0
 * Author: Brad Angelcyk, Kathryn Presner, Justin Shreve, Carolyn Sonnek
 * Author URI: https://automattic.com
 * License: GPL2
 * Text Domain: jetpack
 *
 * @package automattic/jetpack
 */

/**
 * Disable direct access/execution to/of the widget code.
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require __DIR__ . '/wordpress-post-widget/class.jetpack-display-posts-widget-base.php';
require __DIR__ . '/wordpress-post-widget/class.jetpack-display-posts-widget.php';

add_action( 'widgets_init', 'jetpack_display_posts_widget' );
/**
 * Registers widget Jetpack_Display_Posts_Widget
 */
function jetpack_display_posts_widget() {
	register_widget( 'Jetpack_Display_Posts_Widget' );
}

/**
 * Cron tasks
 */

add_filter( 'cron_schedules', 'jetpack_display_posts_widget_cron_intervals' ); // phpcs:ignore WordPress.WP.CronInterval.CronSchedulesInterval

/**
 * Adds 10 minute running interval to the cron schedules.
 *
 * @param array $current_schedules Currently defined schedules list.
 *
 * @return array
 */
function jetpack_display_posts_widget_cron_intervals( $current_schedules ) {

	/**
	 * Only add the 10 minute interval if it wasn't already set.
	 */
	if ( ! isset( $current_schedules['minutes_10'] ) ) {
		$current_schedules['minutes_10'] = array(
			'interval' => 10 * MINUTE_IN_SECONDS,
			'display'  => 'Every 10 minutes',
		);
	}

	return $current_schedules;
}

/**
 * Execute the cron task
 */
add_action( 'jetpack_display_posts_widget_cron_update', 'jetpack_display_posts_update_cron_action' );
/**
 * Run the Jetpack_Display_Posts_Widget cron task.
 */
function jetpack_display_posts_update_cron_action() {
	$widget = new Jetpack_Display_Posts_Widget();
	$widget->cron_task();
}

/**
 * Handle activation procedures for the cron.
 *
 * `updating_jetpack_version` - Handle cron activation when Jetpack gets updated. It's here
 *                              to cover the first cron activation after the update.
 *
 * `jetpack_activate_module_widgets` - Activate the cron when the Extra Sidebar widgets are activated.
 *
 * `activated_plugin` - Activate the cron when Jetpack gets activated.
 */
add_action( 'updating_jetpack_version', 'jetpack_display_posts_widget_conditionally_activate_cron' );
add_action( 'jetpack_activate_module_widgets', 'Jetpack_Display_Posts_Widget::activate_cron' );
add_action( 'activated_plugin', 'jetpack_conditionally_activate_cron_on_plugin_activation' );

/**
 * Executed when Jetpack gets activated. Tries to activate the cron if it is needed.
 *
 * @param string $plugin_file_name The plugin file that was activated.
 */
function jetpack_conditionally_activate_cron_on_plugin_activation( $plugin_file_name ) {
	if ( plugin_basename( JETPACK__PLUGIN_FILE ) === $plugin_file_name ) {
		jetpack_display_posts_widget_conditionally_activate_cron();
	}
}

/**
 * Activates the cron only when needed.
 *
 * @see Jetpack_Display_Posts_Widget::should_cron_be_running
 */
function jetpack_display_posts_widget_conditionally_activate_cron() {
	$widget = new Jetpack_Display_Posts_Widget();
	if ( $widget->should_cron_be_running() ) {
		$widget->activate_cron();
	}

	unset( $widget );
}

/**
 * End of cron activation handling.
 */

/**
 * Handle deactivation procedures where they are needed.
 *
 * If Extra Sidebar Widgets module is deactivated, the cron is not needed.
 *
 * If Jetpack is deactivated, the cron is not needed.
 */
add_action( 'jetpack_deactivate_module_widgets', 'Jetpack_Display_Posts_Widget::deactivate_cron_static' );
register_deactivation_hook( plugin_basename( JETPACK__PLUGIN_FILE ), 'Jetpack_Display_Posts_Widget::deactivate_cron_static' );

Directory Contents

Dirs: 18 × Files: 28

Name Size Perms Modified Actions
authors DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
flickr DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
gallery DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
goodreads DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
instagram DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
milestone DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
top-posts DIR
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
- drwxr-xr-x 2023-04-04 05:35:20
Edit Download
9.10 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
5.39 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
10.51 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
24.20 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
17.95 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
165 B lrw-r--r-- 2023-04-04 05:35:20
Edit Download
4.07 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
15.30 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
7.31 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
16.19 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
8.25 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
6.45 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
1.23 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
15.41 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
12.32 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
8.39 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
4.29 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
346 B lrw-r--r-- 2023-04-04 05:35:20
Edit Download
11.08 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
10.50 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
21.88 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
20.85 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
10.78 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
26.71 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
2.20 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
19.90 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
6.47 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download
3.71 KB lrw-r--r-- 2023-04-04 05:35:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).