Sorry-WP Went Whacky. I Need Examples of Using the “option_xxx” Filter.
-
For some reason, the posting went nuts, so you are graced with three copies of an empty post.
Here’s what I was trying to say:
—
My last query got demoted from a support question (probably because it deserved to be).I got some good feedback, but now I am stuck.
I normally look for example code to shine a cluelight upon my moronity, but there seems to be a dearth of examples for this.
I wrote a plugin, as recommended, and set up a filter, as recommended, but the filter function is never called, which leads me to believe that there is some problem with the way I set it up. I can’t see the forest for the trees. This is as simple a plugin as it gets, yet it doesn’t work.
Any ideas?
The Code:
<?php /* Plugin Name: localhosts Plugin URI: https://... Description: Makes things local, for testing. Version: 1.0 */ function GetMainURI( $ret ) { if ( preg_match ( '|10\.211\.55\.2|', $_SERVER['REQUEST_URI'] ) ) { $ret = "https://10.211.55.2/.../public_html/main"; } elseif ( preg_match ( '|127\.0\.0\.1|', $_SERVER['REQUEST_URI'] ) || preg_match ( '|localhost|', $_SERVER['REQUEST_URI'] ) ) { $ret = "https://localhost/.../public_html/main"; } return $ret; } add_filter ( 'option_home', 'GetMainURI' ); add_filter ( 'option_siteurl', 'GetMainURI' ); ?>
- The topic ‘Sorry-WP Went Whacky. I Need Examples of Using the “option_xxx” Filter.’ is closed to new replies.