Changeset 3477390
- Timestamp:
- 03/08/2026 11:35:20 AM (4 weeks ago)
- Location:
- floyi
- Files:
-
- 26 added
- 3 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/admin (added)
-
tags/1.0.2/admin/class-floyi-admin.php (added)
-
tags/1.0.2/admin/index.php (added)
-
tags/1.0.2/assets (added)
-
tags/1.0.2/assets/css (added)
-
tags/1.0.2/assets/css/admin.css (added)
-
tags/1.0.2/assets/css/index.php (added)
-
tags/1.0.2/assets/index.php (added)
-
tags/1.0.2/assets/js (added)
-
tags/1.0.2/assets/js/admin.js (added)
-
tags/1.0.2/assets/js/index.php (added)
-
tags/1.0.2/floyi.php (added)
-
tags/1.0.2/includes (added)
-
tags/1.0.2/includes/class-floyi-api.php (added)
-
tags/1.0.2/includes/class-floyi-capabilities.php (added)
-
tags/1.0.2/includes/class-floyi-publisher.php (added)
-
tags/1.0.2/includes/class-floyi-security.php (added)
-
tags/1.0.2/includes/class-floyi-settings.php (added)
-
tags/1.0.2/includes/class-floyi-webhook-queue.php (added)
-
tags/1.0.2/includes/index.php (added)
-
tags/1.0.2/index.php (added)
-
tags/1.0.2/languages (added)
-
tags/1.0.2/languages/index.php (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/uninstall.php (added)
-
trunk/floyi.php (modified) (2 diffs)
-
trunk/includes/class-floyi-publisher.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
floyi/trunk/floyi.php
r3474122 r3477390 4 4 * Plugin URI: https://floyi.com/wordpress-plugin 5 5 * Description: Connect your WordPress site to Floyi for seamless content publishing from your topical authority platform. 6 * Version: 1.0. 16 * Version: 1.0.2 7 7 * Author: Floyi 8 8 * Author URI: https://floyi.com … … 23 23 24 24 // Plugin constants 25 define('FLOYI_CONNECT_VERSION', '1.0. 1');25 define('FLOYI_CONNECT_VERSION', '1.0.2'); 26 26 define('FLOYI_CONNECT_PLUGIN_DIR', plugin_dir_path(__FILE__)); 27 27 define('FLOYI_CONNECT_PLUGIN_URL', plugin_dir_url(__FILE__)); -
floyi/trunk/includes/class-floyi-publisher.php
r3463064 r3477390 18 18 19 19 /** 20 * Sanitize post content while preserving link attributes like target and rel. 21 * 22 * WordPress's wp_kses_post() strips target="_blank" from <a> tags by default. 23 * This method extends the allowed HTML to preserve those attributes so that 24 * "open in new tab" settings from the Floyi editor survive publishing. 25 * 26 * @param string $content HTML content to sanitize. 27 * @return string Sanitized HTML with target/rel preserved on links. 28 */ 29 private static function sanitize_content($content) { 30 $allowed = wp_kses_allowed_html('post'); 31 // Ensure <a> tags can carry target and rel attributes 32 if (isset($allowed['a'])) { 33 $allowed['a']['target'] = true; 34 $allowed['a']['rel'] = true; 35 } 36 return wp_kses($content, $allowed); 37 } 38 39 /** 20 40 * Create a new post. 21 41 * … … 36 56 $post_data = array( 37 57 'post_title' => sanitize_text_field($params['title']), 38 'post_content' => isset($params['content']) ? wp_kses_post($params['content']) : '',58 'post_content' => isset($params['content']) ? self::sanitize_content($params['content']) : '', 39 59 'post_status' => isset($params['status']) ? sanitize_key($params['status']) : 'draft', 40 60 'post_type' => isset($params['type']) ? sanitize_key($params['type']) : 'post', … … 134 154 135 155 if (isset($params['content'])) { 136 $post_data['post_content'] = wp_kses_post($params['content']);156 $post_data['post_content'] = self::sanitize_content($params['content']); 137 157 } 138 158 -
floyi/trunk/readme.txt
r3474122 r3477390 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 125 125 == Changelog == 126 126 127 = 1.0.2 = 128 * Preserve link target and rel attributes when publishing from Floyi (fixes "open in new tab" links losing target="_blank" after publishing) 129 127 130 = 1.0.1 = 128 131 * Added webhook notification for permanent post deletions so Floyi cleans up publish records … … 146 149 == Upgrade Notice == 147 150 151 = 1.0.2 = 152 Fixes link attributes (target, rel) being stripped when publishing content to WordPress. 153 148 154 = 1.0.1 = 149 155 Fixes publish record cleanup when posts are permanently deleted from WordPress.
Note: See TracChangeset
for help on using the changeset viewer.