diff --git a/composer.json b/composer.json index 595caf6..ceca4e2 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "A WordPress Plugin for integrating with TouchPoint Church Management Software.", "license": "AGPL-3.0-or-later", "type": "wordpress-plugin", - "version": "0.0.36", + "version": "0.0.37", "keywords": [ "wordpress", "wp", diff --git a/i18n/TouchPoint-WP.pot b/i18n/TouchPoint-WP.pot index 76ea0c4..a748c21 100644 --- a/i18n/TouchPoint-WP.pot +++ b/i18n/TouchPoint-WP.pot @@ -1,15 +1,15 @@ -# Copyright (C) 2023 James K +# Copyright (C) 2024 James K # This file is distributed under the AGPLv3+. msgid "" msgstr "" -"Project-Id-Version: TouchPoint WP 0.0.36\n" +"Project-Id-Version: TouchPoint WP 0.0.37\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/TouchPoint-WP\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-10-22T18:00:47+00:00\n" +"POT-Creation-Date: 2024-02-07T14:00:10+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.8.1\n" "X-Domain: TouchPoint-WP\n" diff --git a/package.json b/package.json index dfe4f2a..c4f224c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "touchpoint-wp", - "version": "0.0.36", + "version": "0.0.37", "description": "A WordPress Plugin for integrating with TouchPoint Church Management Software.", "directories": { "doc": "docs" diff --git a/src/TouchPoint-WP/Involvement.php b/src/TouchPoint-WP/Involvement.php index 43566a8..6b1233a 100644 --- a/src/TouchPoint-WP/Involvement.php +++ b/src/TouchPoint-WP/Involvement.php @@ -605,7 +605,7 @@ private static function computeCommonOccurrences(array $meetings = [], array $sc { try { $siteTz = wp_timezone(); - $now = new DateTimeImmutable(null, $siteTz); + $now = new DateTimeImmutable("now", $siteTz); } catch (Exception $e) { return null; } @@ -2116,7 +2116,7 @@ final protected static function updateInvolvementPostsForType( $postsToKeep = []; try { - $now = new DateTimeImmutable(null, $siteTz); + $now = new DateTimeImmutable("now", $siteTz); $aYear = new DateInterval('P1Y'); $nowPlus1Y = $now->add($aYear); unset($aYear); diff --git a/src/TouchPoint-WP/Partner.php b/src/TouchPoint-WP/Partner.php index e97d3ad..2b0e7d7 100644 --- a/src/TouchPoint-WP/Partner.php +++ b/src/TouchPoint-WP/Partner.php @@ -405,8 +405,8 @@ public static function updateFromTouchPoint(bool $verbose = false) wp_set_post_terms($post->ID, $category, TouchPointWP::TAX_GP_CATEGORY, false); } - // Title & Slug - if ($post->post_title != $title) { // only update if there's a change. Otherwise, urls increment. + // Title & Slug -- slugs should only be updated if there's a reason, like a title change. Otherwise, they increment. + if ($post->post_title != $title || str_contains($post->post_name, "__trashed")) { $post->post_title = $title; $post->post_name = ''; // Slug will regenerate; } diff --git a/src/TouchPoint-WP/Report.php b/src/TouchPoint-WP/Report.php index 5d1eea6..9f7c089 100644 --- a/src/TouchPoint-WP/Report.php +++ b/src/TouchPoint-WP/Report.php @@ -599,11 +599,11 @@ public static function updateCron(): void /** * Handle which data should be converted to JSON. Used for posting to the API. * - * @return mixed data which can be serialized by json_encode + * @return object data which can be serialized by json_encode */ - public function jsonSerialize() + public function jsonSerialize(): object { - return [ + return (object)[ 'name' => $this->name, 'type' => $this->type, 'p1' => $this->p1 diff --git a/src/TouchPoint-WP/TouchPointWP.php b/src/TouchPoint-WP/TouchPointWP.php index 880f456..e2ccd44 100644 --- a/src/TouchPoint-WP/TouchPointWP.php +++ b/src/TouchPoint-WP/TouchPointWP.php @@ -33,7 +33,7 @@ class TouchPointWP /** * Version number */ - public const VERSION = "0.0.36"; + public const VERSION = "0.0.37"; /** * The Token diff --git a/src/python/WebApi.py b/src/python/WebApi.py index 4ca213e..17198d0 100644 --- a/src/python/WebApi.py +++ b/src/python/WebApi.py @@ -5,7 +5,7 @@ import linecache import sys -VERSION = "0.0.36" +VERSION = "0.0.37" sgContactEvName = "Contact" diff --git a/src/templates/involvement-single.php b/src/templates/involvement-single.php index 22168cc..e13461e 100644 --- a/src/templates/involvement-single.php +++ b/src/templates/involvement-single.php @@ -56,16 +56,16 @@ hierarchical) { - $children = get_children([ + $single_children = get_children([ 'post_parent' => $inv->post_id, 'orderby' => 'title', 'order' => 'ASC', 'post_type' => $postType ]); - if (count($children) > 0) { + if (count($single_children) > 0) { echo "
"; } - foreach ($children as $post) { + foreach ($single_children as $post) { /** @var WP_Post $post */ $loadedPart = get_template_part('list-item', 'involvement-list-item'); if ($loadedPart === false) { @@ -73,7 +73,7 @@ require TouchPointWP::$dir . "/src/templates/parts/involvement-list-item.php"; } } - if (count($children) > 0) { + if (count($single_children) > 0) { echo "
"; } } ?> diff --git a/touchpoint-wp.php b/touchpoint-wp.php index 568c8b2..c23ced2 100644 --- a/touchpoint-wp.php +++ b/touchpoint-wp.php @@ -14,7 +14,7 @@ Plugin URI: https://github.com/tenthpres/touchpoint-wp Update URI: https://github.com/tenthpres/touchpoint-wp Description: A WordPress Plugin for integrating with TouchPoint Church Management Software. -Version: 0.0.36 +Version: 0.0.37 Author: James K Author URI: https://github.com/jkrrv License: AGPLv3+