IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    WordPress 更改文章密码保护后显示的提示内容

    Hacper\'s Blog发表于 2015-06-13 10:43:59
    love 0
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    
    /**
     * WordPress 更改文章密码保护后显示的提示内容
     * http://www.wpdaxue.com/change-password-protected-text.html
     */
    function password_protected_change( $content ) {
        global $post;
        if ( ! empty( $post->post_password ) && stripslashes( $_COOKIE['wp-postpass_'.COOKIEHASH] ) != $post->post_password ) {
            $output = '
     
            
    <form action="' . get_option( 'siteurl' ) . '/wp-pass.php" method="post"> '.\_\_( "这是一篇受密码保护的文章,您需要提供访问密码:" ).' <label for="post_password">密码:</label> <input class="input" name="post_password" size="20" type="password"></input><input .="" class="button" name="Submit" type="submit" value="' . __( "></input></form> '; return $output; } else { return $content; } } add\_filter( 'the\_content','password\_protected\_change' );
     
    


沪ICP备19023445号-2号
友情链接