Changeset 678745
- Timestamp:
- 03/09/2013 05:17:37 PM (13 years ago)
- Location:
- root-relative-urls/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
sb_root_relative_urls.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
root-relative-urls/trunk/readme.txt
r678692 r678745 4 4 Tags: url, links, admin, multisite, content, permalinks, migration, absolute urls 5 5 Requires at least: 3.2.1 6 Tested up to: 3. 2.16 Tested up to: 3.5.1 7 7 Stable tag: trunk 8 8 … … 109 109 == Changelog == 110 110 111 = 2.2 = 112 * Feature: Added blacklist entry for disabling root relative urls are specific pages. This is to help with third party plugins 113 * Bug fix: Added filter to prevent processing of email urls to root relative 114 111 115 = 2.1 = 112 116 * Bug fix: really fixed path undefined notice for urls :( why @ symbol didn't work is beyond me. I couldn't reproduce the issue, but this was faster than debugging it. -
root-relative-urls/trunk/sb_root_relative_urls.php
r678692 r678745 9 9 Author: Marcus E. Pope, marcuspope 10 10 Author URI: http://www.marcuspope.com 11 Version: 2. 111 Version: 2.2 12 12 13 13 Copyright 2011 Marcus E. Pope (email : me@marcuspope.com) … … 36 36 //generally displays urls throughout the admin area as root relative instead of absolute 37 37 38 //Normally we inject root relative urls when possible, especially for content creation 38 39 static $massage = false; 39 40 … … 181 182 182 183 static function init() { 184 185 add_action('admin_init', array( 'MP_WP_Root_Relative_URLS', 'admin_settings_init' )); 186 187 //Here we check the url blacklist to disable proper root relative urls, this helps with certain 3rd party 188 //plugins / certain clients for rss feeds 189 $cur_url = MP_WP_Root_Relative_URLS::dynamic_absolute_url(@$_SERVER['REQUEST_URI']); 190 if (stripos(get_option('emc2_blacklist_urls'), $cur_url) !== false) { 191 //for blacklists, create a dynamic but full absolute url instead 192 self::$massage = true; 193 } 194 183 195 //Setup all hooks / filters for either dynamically replacing the host part of a URL with the current host 184 196 //or for stripping the scheme + host + port altogether … … 243 255 'rss2_ns', 244 256 'rss2_comments_ns', 245 'rdf_ns' 257 'rdf_ns', 258 'wp_mail' 246 259 ), 247 260 array( … … 332 345 ) 333 346 ); 334 335 } 347 } 348 349 //The following sets up an admin config page 350 static function admin_settings_init() { 351 352 //give this setting its own section on the General page 353 add_settings_section('emc2_blacklist_urls', 'Root Relative Blacklist', array('MP_WP_Root_Relative_URLS', 'render_setting_section'), 'general'); 354 355 add_settings_field('emc2_blacklist_urls', 'Root Relative Blacklist URLs', 356 array('MP_WP_Root_Relative_URLS', 'render_setting_input'), //render callback 357 'general', //page 358 'emc2_blacklist_urls', //section 359 array( 360 'label_for' => 'emc2_blacklist_urls' 361 ) 362 ); 363 364 register_setting('general', 'emc2_blacklist_urls'); 365 } 366 367 static function render_setting_section($t) { 368 //add description of section to page 369 echo "<p>Enter URLs you do not want processed by Root Relative URL Plugin.<br/>- Only put one URL per line, you can enter as many urls as you'd like.<br/>- You can use partial URLs, no wildcards needed, but be careful about unintentionally matching a post title.<br/>- The full URL in the browser will be used to check against these entries so you can disable root relative urls for your entire production site simply by putting your production url in this field.<br/>- To disable processing for RSS feeds you would use <span style='background-color: #e8f6fd;'>http://www.mysite.com/?feed</span> to capture all rss, atomic and comment feeds, only you'd replace www.mysite.com with your production URL.</p>"; 370 } 371 372 static function render_setting_input($attr) { 373 //Display a list of option boxes for specifying the new line insertion behavior 374 $options = get_option('emc2_blacklist_urls'); 375 ?> 376 <textarea id="emc2_blacklist_urls" name="emc2_blacklist_urls" style="width: 70%; min-width: 25em;" rows="20"><?php echo esc_attr($options); ?></textarea> 377 <?php 378 } 379 336 380 }
Note: See TracChangeset
for help on using the changeset viewer.