Plugin Directory

Changeset 2586107

Timestamp:
08/20/2021 05:06:34 PM (3 years ago)
Author:
bradparbs
Message:

Update to version 1.1.0 from GitHub

Location:
schedules
Files:
2 deleted
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • schedules/tags/1.1.0/readme.txt

    r2547681 r2586107  
    11=== Schedules ===
    2 Contributors: bradparbs
     2Contributors: bradparbs
    33Tags: posts, schedule, scheduled, content, calendar, widget, dashboard
    44Requires at least: 5.2
    5 Tested up to: 5.7.2
    6 Stable tag: 1.0.0
     5Tested up to: 5.
     6Stable tag: 1..0
    77License: GPLv2 or later
    88Requires PHP: 5.6
     
    1313
    1414Quickly and easily view all your scheduled posts.
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
  • schedules/tags/1.1.0/schedules.php

    r2547681 r2586107  
    33 * Plugin Name: Schedules
    44 * Description: Quickly and easily view all your scheduled posts.
    5  * Version:     1.0.0
     5 * Version:     1..0
    66 * Author:      Brad Parbs
    77 * Author URI:  https://bradparbs.com/
     
    1717use WP_Query;
    1818
    19 defined( 'ABSPATH' ) || die();
     19);
    2020
    21 // Add new dashboard widget with list of scheduled posts.
    22 add_action(
    23     'wp_dashboard_setup',
    24     function () {
    25         wp_add_dashboard_widget( 'scheduled', '<span><span class="dashicons dashicons-clock" style="padding-right: 10px"></span>' . esc_attr__( 'Scheduled' ) . '</span>', __NAMESPACE__ . '\\dashboard_widget' );
    26     }
    27 );
     21/**
     22 * Add new dashboard widget with list of scheduled posts.
     23 */
     24function add_dashboard_widget() {
     25    $name = sprintf(
     26        '<span><span class="dashicons %s" style="padding-right: 10px"></span>%s</span>',
     27        apply_filters( 'schedules_widget_icon', 'dashicons-clock' ),
     28        apply_filters( 'schedules_widget_title', esc_attr__( 'Scheduled', 'schedules' ) )
     29    );
     30
     31    wp_add_dashboard_widget( 'schedules', $name, __NAMESPACE__ . '\\dashboard_widget' );
     32}
    2833
    2934/**
     
    3136 */
    3237function dashboard_widget() {
    33     $posts = new \WP_Query(
    34         [
    35             'post_type'      => get_post_types(),
    36             'post_status'    => 'future',
    37             'orderby'        => 'date',
    38             'order'          => 'ASC',
    39             'posts_per_page' => 25,
    40             'no_found_rows'  => true,
    41         ]
    42     );
     38    $post_types = apply_filters( 'schedules_post_types_to_show', get_post_types() );
     39    $query_args = apply_filters( 'schedules_widget_query_args', [
     40        'post_type'      => $post_types,
     41        'post_status'    => 'future',
     42        'orderby'        => 'date',
     43        'order'          => 'ASC',
     44        'posts_per_page' => 25,
     45        'no_found_rows'  => true,
     46    ] );
    4347
    44     $scheduled = [];
    45 
    46     if ( $posts->have_posts() ) {
    47         while ( $posts->have_posts() ) {
    48             $posts->the_post();
    49 
    50             $scheduled[] = [
    51                 'ID'      => get_the_ID(),
    52                 'title'   => get_the_title(),
    53                 'date'    => gmdate( 'F j, g:ia', get_the_time( 'U' ) ),
    54                 'preview' => get_preview_post_link(),
    55             ];
    56         }
    57     }
     48    $posts     = new WP_Query( $query_args );
     49    $scheduled = get_scheduled_posts( $posts );
    5850
    5951    printf(
     
    6658    );
    6759}
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
    6891/**
    6992 * Display scheduled posts in widget.
  • schedules/trunk/readme.txt

    r2547681 r2586107  
    11=== Schedules ===
    2 Contributors: bradparbs
     2Contributors: bradparbs
    33Tags: posts, schedule, scheduled, content, calendar, widget, dashboard
    44Requires at least: 5.2
    5 Tested up to: 5.7.2
    6 Stable tag: 1.0.0
     5Tested up to: 5.
     6Stable tag: 1..0
    77License: GPLv2 or later
    88Requires PHP: 5.6
     
    1313
    1414Quickly and easily view all your scheduled posts.
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
  • schedules/trunk/schedules.php

    r2547681 r2586107  
    33 * Plugin Name: Schedules
    44 * Description: Quickly and easily view all your scheduled posts.
    5  * Version:     1.0.0
     5 * Version:     1..0
    66 * Author:      Brad Parbs
    77 * Author URI:  https://bradparbs.com/
     
    1717use WP_Query;
    1818
    19 defined( 'ABSPATH' ) || die();
     19);
    2020
    21 // Add new dashboard widget with list of scheduled posts.
    22 add_action(
    23     'wp_dashboard_setup',
    24     function () {
    25         wp_add_dashboard_widget( 'scheduled', '<span><span class="dashicons dashicons-clock" style="padding-right: 10px"></span>' . esc_attr__( 'Scheduled' ) . '</span>', __NAMESPACE__ . '\\dashboard_widget' );
    26     }
    27 );
     21/**
     22 * Add new dashboard widget with list of scheduled posts.
     23 */
     24function add_dashboard_widget() {
     25    $name = sprintf(
     26        '<span><span class="dashicons %s" style="padding-right: 10px"></span>%s</span>',
     27        apply_filters( 'schedules_widget_icon', 'dashicons-clock' ),
     28        apply_filters( 'schedules_widget_title', esc_attr__( 'Scheduled', 'schedules' ) )
     29    );
     30
     31    wp_add_dashboard_widget( 'schedules', $name, __NAMESPACE__ . '\\dashboard_widget' );
     32}
    2833
    2934/**
     
    3136 */
    3237function dashboard_widget() {
    33     $posts = new \WP_Query(
    34         [
    35             'post_type'      => get_post_types(),
    36             'post_status'    => 'future',
    37             'orderby'        => 'date',
    38             'order'          => 'ASC',
    39             'posts_per_page' => 25,
    40             'no_found_rows'  => true,
    41         ]
    42     );
     38    $post_types = apply_filters( 'schedules_post_types_to_show', get_post_types() );
     39    $query_args = apply_filters( 'schedules_widget_query_args', [
     40        'post_type'      => $post_types,
     41        'post_status'    => 'future',
     42        'orderby'        => 'date',
     43        'order'          => 'ASC',
     44        'posts_per_page' => 25,
     45        'no_found_rows'  => true,
     46    ] );
    4347
    44     $scheduled = [];
    45 
    46     if ( $posts->have_posts() ) {
    47         while ( $posts->have_posts() ) {
    48             $posts->the_post();
    49 
    50             $scheduled[] = [
    51                 'ID'      => get_the_ID(),
    52                 'title'   => get_the_title(),
    53                 'date'    => gmdate( 'F j, g:ia', get_the_time( 'U' ) ),
    54                 'preview' => get_preview_post_link(),
    55             ];
    56         }
    57     }
     48    $posts     = new WP_Query( $query_args );
     49    $scheduled = get_scheduled_posts( $posts );
    5850
    5951    printf(
     
    6658    );
    6759}
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
    6891/**
    6992 * Display scheduled posts in widget.
Note: See TracChangeset for help on using the changeset viewer.