mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-03 11:11:30 +08:00
修复:去除额外的测试代码
This commit is contained in:
parent
dd5babdc31
commit
63c2b06b7e
1 changed files with 1 additions and 8 deletions
|
@ -176,7 +176,7 @@ if ( ! class_exists( 'WP_CHINA_YES' ) ) {
|
|||
*/
|
||||
add_filter( 'pre_http_request', function ( $preempt, $r, $url ) {
|
||||
if ( ( ! stristr( $url, 'api.wordpress.org' ) && ! stristr( $url, 'downloads.wordpress.org' ) ) || get_option( 'wpapi' ) == 3 ) {
|
||||
return false;
|
||||
return $preempt;
|
||||
}
|
||||
if ( get_option( 'wpapi' ) == 1 ) {
|
||||
$url = str_replace( 'api.wordpress.org', 'api.litepress.cn', $url );
|
||||
|
@ -403,10 +403,3 @@ if ( ! class_exists( 'WP_CHINA_YES' ) ) {
|
|||
|
||||
( new WP_CHINA_YES )->init();
|
||||
}
|
||||
|
||||
add_filter( 'the_content', function ( $content ) {
|
||||
$pattern = "/<img(.*?)src=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
|
||||
$replacement = '<a href=$2$3.$4$5 rel="lightbox"><img$1href=$2$3.$4$5 rel="lightbox"$6></a>';
|
||||
|
||||
return preg_replace( $pattern, $replacement, $content );
|
||||
} );
|
Loading…
Add table
Add a link
Reference in a new issue