Skip to content

Commit

Permalink
Merge branch 'main' of github.com:arnowelzel/timed-content
Browse files Browse the repository at this point in the history
  • Loading branch information
arnowelzel committed Jan 29, 2024
2 parents 01a968b + c6fe97d commit c45933f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
3 changes: 1 addition & 2 deletions js/timed-content-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jQuery( document ).ready(
jQuery( "#timed_content_rule_recurrence_duration_num_repeat_div" ).css( "display", "block" );
}
}
).trigger( "change" );timed_content_rule_exceptions_dates_picker

).trigger( "change" );
jQuery( "#timed_content_rule_exceptions_dates" ).on(
"dblclick",
"option",
Expand Down
19 changes: 10 additions & 9 deletions lib/class-timedcontentplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function __construct() {
add_filter( 'manage_' . TIMED_CONTENT_RULE_TYPE . '_posts_columns', array( $this, 'add_desc_column_head' ) );
add_filter( 'pre_get_posts', array( $this, 'timed_content_pre_get_posts' ) );
add_filter( 'post_updated_messages', array( $this, 'timed_content_rule_updated_messages' ), 1 );
add_filter( 'dashboard_glance_items', array( $this, 'add_rules_count' ) );

add_action( 'init', array( $this, 'init' ), 2 );
add_action( 'wp_head', array( $this, 'add_header_code' ), 1 );
Expand All @@ -38,7 +39,6 @@ function __construct() {
add_action( 'wp_ajax_timedContentPluginGetTinyMCEDialog', array( $this, 'timed_content_plugin_get_tinymce_dialog' ), 1 );
add_action( 'wp_ajax_timedContentPluginGetRulePeriodsAjax', array( $this, 'timed_content_plugin_get_rule_periods_ajax' ), 1 );
add_action( 'wp_ajax_timedContentPluginGetScheduleDescriptionAjax', array( $this, 'timed_content_plugin_get_schedule_description_ajax' ), 1 );
add_action( 'dashboard_glance_items', array( $this, 'add_rules_count' ) );
add_action( 'admin_head', array( $this, 'add_post_type_icons' ), 1 );

add_shortcode( TIMED_CONTENT_SHORTCODE_CLIENT, array( $this, 'client_show_html' ) );
Expand Down Expand Up @@ -1792,9 +1792,9 @@ function add_post_type_icons() {
content: '\e601';
}

#dashboard_right_now li.<?php echo TIMED_CONTENT_RULE_TYPE; ?>-count a:before {
#dashboard_right_now a.<?php echo TIMED_CONTENT_RULE_TYPE; ?>-count:before {
font-family: 'timed-content-dashicons' !important;
content: '\e601';
content: '\e601' !important;
}

.mce-i-timed_content:before {
Expand Down Expand Up @@ -2072,6 +2072,7 @@ function add_desc_column_content( $column_name, $post_id ) {
* Display a count of Timed Content rules in the Dashboard's Right Now widget
*/
function add_rules_count() {
$items = [];
if ( ! post_type_exists( TIMED_CONTENT_RULE_TYPE ) ) {
return;
}
Expand All @@ -2085,12 +2086,11 @@ function add_rules_count() {
'timed-content'
);
if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
echo "<a href='edit.php?post_type=" . TIMED_CONTENT_RULE_TYPE . "'>"
. '<li class="' . TIMED_CONTENT_RULE_TYPE . '-count">'
$items[] = '<a class="'.TIMED_CONTENT_RULE_TYPE.'-count" href="edit.php?post_type=' . TIMED_CONTENT_RULE_TYPE . '">'
. $num
. ' '
. $text
. '</a></li>';
. '</a>';
}

if ( $num_posts->pending > 0 ) {
Expand All @@ -2102,14 +2102,15 @@ function add_rules_count() {
'timed-content'
);
if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
echo "<a href='edit.php?post_status=pending&post_type=" . TIMED_CONTENT_RULE_TYPE . "'>"
. '<li class="' . TIMED_CONTENT_RULE_TYPE . '-count">'
$items[] = '<a class="'.TIMED_CONTENT_RULE_TYPE.'-count" href="edit.php?post_status=pending&post_type=' . TIMED_CONTENT_RULE_TYPE . '">'
. $num
. ' '
. $text
. '</a></li>';
. '</a>';
}
}

return $items;
}

/**
Expand Down
14 changes: 12 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: kjvtough, awelzel
Tags: marketing, marketing tool, post, page, date, time, timer, timed, show, hide, content, schedule, display
Requires at least: 3.8
Tested up to: 6.4
Stable tag: 2.78
Stable tag: 2.80
License: GPL2

Plugin to show or hide portions of a Page or Post based on specific date/time characteristics.
Expand Down Expand Up @@ -62,10 +62,20 @@ If you want to use Timed Content with Gutenberg you have to add a "Classic" bloc

== Changelog ==

= 2.78 =
= 2.80 =

* Updated compatibility information for WordPress.

= 2.79 =

* Fix backend code for admin dashboard "right now" output of timed content rule links.

= 2.78 =

* Fixed a JavaScript error message in the backend UI.

= 2.77 =

* Updated compatibility information for WordPress.

= 2.76 =
Expand Down
6 changes: 5 additions & 1 deletion timed-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
Plugin URI: http://wordpress.org/plugins/timed-content/
Description: Plugin to show or hide portions of a Page or Post based on specific date/time characteristics. These actions can either be processed either server-side or client-side, depending on the desired effect.
Author: K. Tough, Arno Welzel, Enrico Bacis
Version: 2.78
Version: 2.80
Author URI: http://wordpress.org/plugins/timed-content/
*/
defined( 'ABSPATH' ) or die();

require 'lib/class-customfieldsinterface.php';
require 'lib/class-timedcontentplugin.php';

<<<<<<< HEAD
define( 'TIMED_CONTENT_VERSION', '2.78' );
=======
define( 'TIMED_CONTENT_VERSION', '2.79' );
>>>>>>> c6fe97ddd336962c5af08a4ec9e4784aa4126b1d
define( 'TIMED_CONTENT_SLUG', 'timed-content' );
define( 'TIMED_CONTENT_PLUGIN_URL', plugins_url() . '/' . TIMED_CONTENT_SLUG );
define( 'TIMED_CONTENT_SHORTCODE_CLIENT', 'timed-content-client' );
Expand Down

0 comments on commit c45933f

Please sign in to comment.