![皮皮奶可可爱了啦 粉魅魔 [111P] 唯美写真-第1张](http://img.relitu.cc/c/10/000102712953838431706607542eebjvyvtpselsaqoiwyabqpsmcqx2030943628owpyodntiscnjtcgcd1409776222.jpg)
![皮皮奶可可爱了啦 粉魅魔 [111P] 唯美写真-第2张](http://img.relitu.cc/c/10/000102812450774661465453897rynxectdknxsjwshqirlnbaujfgh1524441435lkhlkparwvlnwketqc0304895409.jpg)
![皮皮奶可可爱了啦 粉魅魔 [111P] 唯美写真-第3张](http://img.relitu.cc/c/10/000102919564760251861644388urpnfrcrcdqqaxnxglukeutiikjr0558403411hotmhivklvrxoutagm1875190924.jpg)
<?php /*********** ** ** @晨星博客开发主题扩展代码放置区 ** @添加方法: ** @1、 从下一行开始,放置您复制的代码; ** @2、 注意代码中符号的格式,php代码全部用半角符号,全角会报错; ** @3、 禁止使用windows记事本编辑改php文件; ** **********************************************/ /////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // 以下是主题的一些默认参数,如果默认值不能满足您的需求可以通过修改来实现部分效果 // // // /////////////////////////////////////////////////////////////////////////////////////////////////////////// if ( !defined( 'CX_USERS_SYSTEM' ) ) define('CX_USERS_SYSTEM', 'on');//是否启用会员系统 if ( !defined( 'CX_AUTO_POST' ) ) define('CX_AUTO_POST', 5);//图片超过5个自动分页 if ( !defined( 'CX_AUTO_LUNBO' ) ) define('CX_AUTO_LUNBO', 3);//幻灯片轮播图数量 if ( !defined( 'CX_PAGE_NUM' ) ) define('CX_PAGE_NUM', 3);//定义分页当前页码前后显示数量 if ( !defined( 'CX_DT_NUM' ) ) define('CX_DT_NUM', 5);//单图模式下文章分页数量 if ( !defined( 'CX_AJAX_NUM' ) ) define('CX_AJAX_NUM', 5);//单图模式ajax自动加载分页数量 if ( !defined( 'CX_IMAGES_NUM' ) ) define('CX_IMAGES_NUM', 3);//图片预加载多少张 if ( !defined( 'CX_BQTJ' ) ) define('CX_BQTJ',0); if ( !defined( 'CX_DT_NUMTOW' ) ) define('CX_DT_NUMTOW',10); /////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // 以下功能不常用,非特色需求请勿开启! // // // /////////////////////////////////////////////////////////////////////////////////////////////////////////// //add_filter('the_content', 'page_glmt_cx');//过滤分页符 //add_filter( 'site_url', 'cx_remove_root' );//站内后台相关链接使用相对路径 /////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // 以下修改可能导致主题运行不正常或后台设置项失效 ,该区域不建议大家做任何修改 // // // /////////////////////////////////////////////////////////////////////////////////////////////////////////// add_filter( 'max_srcset_image_width', 'cx_srcset_image_width' );//禁用自适应图像 add_filter('pre_option_link_manager_enabled','__return_true'); //添加链接功能 add_action('admin_print_scripts', 'my_quicktags');//添加短代码按钮 add_action('widgets_init','unregister_rss_widget');//禁用默认小工具 update_option('image_default_link_type', 'none');//图片默认无连接 add_filter('show_admin_bar', '__return_false');//禁用工具栏 add_action('delete_post', 'delete_chenxing_meta_fields');//删除文章时删除自定义字段 function cx_srcset_image_width($width){ return 1; } /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /* 发布文章自动设置字段 /* -------------------------------- */ add_action('publish_post', 'add_custom_field_automatically', 10, 2 ); add_action( 'publish_picture', 'add_custom_field_automatically', 10, 2 ); function add_custom_field_automatically($post_ID) { global $wpdb; if(!wp_is_post_revision($post_ID)) { $random = 0; $random2 = 0; if(option_off('cx_fujia_views')) $random = mt_rand(500, 2000); if(option_off('cx_fujia__ding')) $random2 = mt_rand(5, 20); add_post_meta($post_ID, 'views', $random, true); add_post_meta($post_ID, 'bigfa_ding', $random2, true); add_post_meta($post_ID, 'chenxing_post_collects', 0, true); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // 以下是主题伪静态规则,适用于/%category%/%post_id%.html样式,如果使用其他样式需要修改以下规则 // // // /////////////////////////////////////////////////////////////////////////////////////////////////////////// add_filter('http_request_args','http_request_args_rest',10,1); function http_request_args_rest($r){ $r['sslverify'] = false; $r['timeout'] = 120; return $r; } //扩展代码放到上面一行 .end // 拦截流氓机器人恶意搜索刷数据库日志 function filter_search_keywords($query) { if ($query->is_search && !is_admin()) { $search_query = get_search_query(); $black_list = array('发票', '开票', '溦', '葳', '微信', '加微'); foreach ($black_list as $bad_word) { if (strpos($search_query, $bad_word) !== false) { wp_die('请文明搜索!', '拒绝恶意注入', array('response' => 403)); } } } return $query; } add_action('pre_get_posts', 'filter_search_keywords');
评论