هذه الفكرة هي فقط لحماية أقسام معينة من موضوعي من العملاء المتحمسين. أرغب في إضافة صفحات ، موجودة في الواجهة الأمامية ويمكن إضافتها إلى القائمة (باستخدام Wordpress 3.0 api) ولكن الصفحة غير موجودة في مربع الحوار "Pages" في لوحة المشرف ، وبالتالي لا يمكن للمستخدم تحريرها.
يمكنك ربط في template_redirect مثل هذا:
function custom_template_redirect() {
global $wp;
if ($wp->query_vars['pagename'] == 'my-page-slug') { // check the page slug
status_header(200); // a 404 code will not be returned in the HTTP headers if the page does not exists
include(TEMPLATEPATH . "/test.php"); // include the corresponding template
die();
}
}
add_action( 'template_redirect', 'custom_template_redirect' );