Changeset 3465976
- Timestamp:
- 02/20/2026 05:56:20 PM (42 hours ago)
- Location:
- a1-tools/trunk
- Files:
-
- 2 edited
-
a1-tools.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
a1-tools/trunk/a1-tools.php
r3462867 r3465976 4 4 * Plugin URI: https://tools.a-1chimney.com 5 5 * Description: Connects your WordPress site to the A1 Tools platform for centralized management of contact information, social media links, and business details. 6 * Version: 1.4.1 26 * Version: 1.4.13 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 … … 21 21 22 22 // Plugin constants. 23 define( 'A1TOOLS_VERSION', '1.4.1 2' );23 define( 'A1TOOLS_VERSION', '1.4.13' ); 24 24 define( 'A1TOOLS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 25 25 define( 'A1TOOLS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); … … 126 126 // SHORTCODES 127 127 // ============================================================================ 128 129 /** 130 * Process A1 Tools shortcodes inside HTML attributes (href, src, etc.). 131 * 132 * WordPress does not run do_shortcode() inside HTML attributes. This filter 133 * finds occurrences like href="tel:[a1tools_var key="phone_primary"]" 134 * or href="mailto:[a1tools_var ...]" and resolves them before normal rendering. 135 * 136 * @since 1.4.13 137 * @param string $content Post content. 138 * @return string Content with shortcodes resolved inside attributes. 139 */ 140 function a1tools_process_shortcodes_in_attributes( $content ) { 141 // Match href="...anything with [a1tools_ shortcode..." (handles HTML-encoded quotes too) 142 $content = preg_replace_callback( 143 '/(?<=href=["\'])([^"\']*\[a1tools_[^\]]*\][^"\']*)/i', 144 function ( $matches ) { 145 // Decode HTML entities so shortcode parser can read the attributes 146 $decoded = html_entity_decode( $matches[1], ENT_QUOTES, 'UTF-8' ); 147 // Process any shortcodes found inside the href value 148 return do_shortcode( $decoded ); 149 }, 150 $content 151 ); 152 153 return $content; 154 } 155 add_filter( 'the_content', 'a1tools_process_shortcodes_in_attributes', 7 ); 156 add_filter( 'widget_text', 'a1tools_process_shortcodes_in_attributes', 7 ); 128 157 129 158 /** … … 381 410 * Get SVG markup for icons not available in Font Awesome 5. 382 411 * 383 * @since 1.4.1 2412 * @since 1.4.13 384 413 * @param string $icon_key The SVG icon key (e.g. 'svg-x'). 385 414 * @return string SVG markup or empty string. … … 395 424 * Get icon HTML (SVG or Font Awesome <i> tag). 396 425 * 397 * @since 1.4.1 2426 * @since 1.4.13 398 427 * @param string $icon Icon class or SVG key. 399 428 * @return string HTML markup for the icon. -
a1-tools/trunk/readme.txt
r3462867 r3465976 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 1.4.1 26 Stable tag: 1.4.13 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 151 151 152 152 == Changelog == 153 154 = 1.4.13 = 155 * Fixed shortcodes not resolving inside link href attributes (e.g., tel:[a1tools_var key="phone_primary"]) 156 * Added content filter to process A1 Tools shortcodes in href values before rendering 153 157 154 158 = 1.4.12 =
Note: See TracChangeset
for help on using the changeset viewer.