Changeset 3318981
- Timestamp:
- 06/27/2025 10:17:01 PM (9 months ago)
- Location:
- hey-notify
- Files:
-
- 8 edited
- 1 copied
-
tags/2.1.1 (copied) (copied from hey-notify/trunk)
-
tags/2.1.1/hey-notify.php (modified) (1 diff)
-
tags/2.1.1/includes/events/page/class-page-hook.php (modified) (1 diff)
-
tags/2.1.1/includes/services/class-slack.php (modified) (5 diffs)
-
tags/2.1.1/readme.txt (modified) (2 diffs)
-
trunk/hey-notify.php (modified) (1 diff)
-
trunk/includes/events/page/class-page-hook.php (modified) (1 diff)
-
trunk/includes/services/class-slack.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hey-notify/tags/2.1.1/hey-notify.php
r3128398 r3318981 20 20 } 21 21 22 define( 'HEY_NOTIFY_VERSION', '2.1. 0' );22 define( 'HEY_NOTIFY_VERSION', '2.1.1' ); 23 23 define( 'HEY_NOTIFY_PLUGIN_FILE', __FILE__ ); 24 24 define( 'HEY_NOTIFY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
hey-notify/tags/2.1.1/includes/events/page/class-page-hook.php
r3128398 r3318981 25 25 */ 26 26 public function page_draft( $post ) { 27 28 27 if ( empty( $post ) || ! is_object( $post ) ) { 29 28 return; -
hey-notify/tags/2.1.1/includes/services/class-slack.php
r3115121 r3318981 32 32 \add_action( 'hey_notify_send_message_slack', array( $this, 'send' ), 10, 3 ); 33 33 \add_action( 'admin_init', array( $this, 'settings' ) ); 34 \add_filter( 'hey_notify_slack_settings_core', array( $this, 'get_core_settings' ), 10, 1 ); 34 35 35 36 // Filters. … … 171 172 172 173 /** 174 * Get service settings 175 * 176 * @param object $data Data. 177 * @return boolean|array 178 */ 179 public function get_core_settings( $data ) { 180 181 if ( ! is_object( $data ) || ! isset( $data->ID ) ) { 182 return false; 183 } 184 185 return array( 186 'webhook_url' => \get_post_meta( $data->ID, '_hey_notify_slack_webhook', true ), 187 ); 188 } 189 190 /** 173 191 * Add the service 174 192 * … … 193 211 */ 194 212 private function sanitize( $value ) { 213 $value = $value ?? ''; 195 214 $value = str_replace( '&', '&', $value ); 196 215 $value = str_replace( '<', '<', $value ); … … 302 321 } 303 322 304 $body = array(); 305 306 $body['attachments'][] = array( 307 'color' => $settings['color'], 308 'blocks' => $blocks, 309 ); 310 311 if ( '' !== $settings['username'] ) { 312 $body['username'] = $settings['username']; 313 } 314 315 if ( '' !== $settings['icon'] ) { 316 if ( filter_var( $settings['icon'], FILTER_VALIDATE_URL ) ) { 317 $body['icon_url'] = $settings['icon']; 318 } else { 319 $icon_url = \wp_get_attachment_image_url( $settings['icon'], array( 250, 250 ) ); 320 if ( false !== $icon_url ) { 321 $body['icon_url'] = $icon_url; 322 } 323 } 324 } 323 $body = array(); 324 $body['blocks'] = $blocks; 325 325 326 326 return $body; … … 336 336 */ 337 337 public function send( $message, $trigger, $data ) { 338 339 338 $settings = \apply_filters( "hey_notify_slack_settings_{$trigger}", $data ); 340 339 -
hey-notify/tags/2.1.1/readme.txt
r3128404 r3318981 3 3 Tags: notifications, alert, slack, discord, email 4 4 Requires at least: 4.3 5 Tested up to: 6. 65 Tested up to: 6.8 6 6 Requires PHP: 7.2 7 Stable tag: 2.1. 07 Stable tag: 2.1.1 8 8 License: GPLv2 or later 9 9 License URI: http://ww.gnu.org/licenses/gpl-2.0.html … … 77 77 == Changelog == 78 78 79 = 2.1.1 = 80 * Fixed an issue that caused Slack notifications to not send. 81 79 82 = 2.1.0 = 80 83 * Microsoft Teams support has been removed due to changes with Office 365 connectors. -
hey-notify/trunk/hey-notify.php
r3128398 r3318981 20 20 } 21 21 22 define( 'HEY_NOTIFY_VERSION', '2.1. 0' );22 define( 'HEY_NOTIFY_VERSION', '2.1.1' ); 23 23 define( 'HEY_NOTIFY_PLUGIN_FILE', __FILE__ ); 24 24 define( 'HEY_NOTIFY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
hey-notify/trunk/includes/events/page/class-page-hook.php
r3128398 r3318981 25 25 */ 26 26 public function page_draft( $post ) { 27 28 27 if ( empty( $post ) || ! is_object( $post ) ) { 29 28 return; -
hey-notify/trunk/includes/services/class-slack.php
r3115121 r3318981 32 32 \add_action( 'hey_notify_send_message_slack', array( $this, 'send' ), 10, 3 ); 33 33 \add_action( 'admin_init', array( $this, 'settings' ) ); 34 \add_filter( 'hey_notify_slack_settings_core', array( $this, 'get_core_settings' ), 10, 1 ); 34 35 35 36 // Filters. … … 171 172 172 173 /** 174 * Get service settings 175 * 176 * @param object $data Data. 177 * @return boolean|array 178 */ 179 public function get_core_settings( $data ) { 180 181 if ( ! is_object( $data ) || ! isset( $data->ID ) ) { 182 return false; 183 } 184 185 return array( 186 'webhook_url' => \get_post_meta( $data->ID, '_hey_notify_slack_webhook', true ), 187 ); 188 } 189 190 /** 173 191 * Add the service 174 192 * … … 193 211 */ 194 212 private function sanitize( $value ) { 213 $value = $value ?? ''; 195 214 $value = str_replace( '&', '&', $value ); 196 215 $value = str_replace( '<', '<', $value ); … … 302 321 } 303 322 304 $body = array(); 305 306 $body['attachments'][] = array( 307 'color' => $settings['color'], 308 'blocks' => $blocks, 309 ); 310 311 if ( '' !== $settings['username'] ) { 312 $body['username'] = $settings['username']; 313 } 314 315 if ( '' !== $settings['icon'] ) { 316 if ( filter_var( $settings['icon'], FILTER_VALIDATE_URL ) ) { 317 $body['icon_url'] = $settings['icon']; 318 } else { 319 $icon_url = \wp_get_attachment_image_url( $settings['icon'], array( 250, 250 ) ); 320 if ( false !== $icon_url ) { 321 $body['icon_url'] = $icon_url; 322 } 323 } 324 } 323 $body = array(); 324 $body['blocks'] = $blocks; 325 325 326 326 return $body; … … 336 336 */ 337 337 public function send( $message, $trigger, $data ) { 338 339 338 $settings = \apply_filters( "hey_notify_slack_settings_{$trigger}", $data ); 340 339 -
hey-notify/trunk/readme.txt
r3128404 r3318981 3 3 Tags: notifications, alert, slack, discord, email 4 4 Requires at least: 4.3 5 Tested up to: 6. 65 Tested up to: 6.8 6 6 Requires PHP: 7.2 7 Stable tag: 2.1. 07 Stable tag: 2.1.1 8 8 License: GPLv2 or later 9 9 License URI: http://ww.gnu.org/licenses/gpl-2.0.html … … 77 77 == Changelog == 78 78 79 = 2.1.1 = 80 * Fixed an issue that caused Slack notifications to not send. 81 79 82 = 2.1.0 = 80 83 * Microsoft Teams support has been removed due to changes with Office 365 connectors.
Note: See TracChangeset
for help on using the changeset viewer.