Php 在管理员页面Wordpress中显示受密码保护的页面密码

Php 在管理员页面Wordpress中显示受密码保护的页面密码,php,wordpress,password-protection,Php,Wordpress,Password Protection,我在Wordpress的管理区有一个页面,我打算让管理员能够更改(任何)受密码保护页面的密码 现在我已经试过了1) 2)而这 <?php $the_post = get_post( 3772 ); echo ("$the_post->post_password"); ?> 我得到的是: 致命错误:无法重新声明\u post\u密码()(以前在/home/mysite/public\u html/mysite/wp admin/includes/template.php

我在Wordpress的管理区有一个页面,我打算让管理员能够更改(任何)受密码保护页面的密码

现在我已经试过了1)


2)而这

<?php
$the_post = get_post( 3772 );
echo ("$the_post->post_password");
?>

我得到的是:

致命错误:无法重新声明\u post\u密码()(以前在/home/mysite/public\u html/mysite/wp admin/includes/template.php:1521中声明)[**这是我从中获得该声明的地方]

1-给我错误,因为它已经声明了

2-什么也不做

我所要做的就是从
wp db
post\u password
(未加密)中显示页面的密码。管理员可以在屏幕上看到页面的密码,如:页面(页面名称)密码为:xxxxxx

我不想让登录的
用户看到这一点-只有管理员才能看到这一点。管理员可以从界面(我创建的页面)更改密码,或者从同一页面链接到密码


如何从数据库获取密码以显示在页面上?如果可能,请使用echo$the_post->post_password;而不是echo($the_post->post_password);…您给出的方式不是一种非常安全的存储明文密码的方式。使用了Rahul S.的答案,它成功了!…我在受保护的页面上有一个表单,请求访问密码(在受保护的密码字段之前)*这只显示在未访问密码时,我将字符串添加到自动发送给此人的电子邮件中(当他们请求pwd访问时)并从[$the_post->post_password]自动填充它-这也可以,耶。现在我需要一种方法,可以使用输入字段将pwd更改为postID和post_password
<?php
$the_post = get_post( 3772 );
echo ("$the_post->post_password");
?>