وردپرس

Term rules oddity | WordPress.org


I don’t think “is_post_type” is working correctly for term restrictions.

Consider the following pair of restrictions:

  • 1 Internal Pages
    • General: Logged in users
    • Protection: Redirect
    • Content: “Content is Page” AND “Content is Not Home Page”
  • 2 Term
    • General: Logged in users of a role, say “Author”
    • Protection: Redirect
    • Content: “Content is selected Tag = xxx”

I have a page that triggers a query involving a post_tags. When I’m logged in as a role other than “Author” I would expect the Tag xxx to be removed from the query – because of restriction 2. However, restriction 2 never gets tested. The query matches against restriction 1!

When “content_is_post_type” for “page” is called to test first part of restriction 1 for context “terms” it goes through the default branch which calls is_post_type which succeeds.

I think the switch in “content_is_post_type” needs the following additional case statement:

case 'terms':
return false;

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا