itsource

워드프레스에서 get_terms와 get_the_terms의 차이점은 무엇입니까?

mycopycode 2023. 2. 26. 09:44
반응형

워드프레스에서 get_terms와 get_the_terms의 차이점은 무엇입니까?

당신의 도움이 필요해요.

WordPress에서 get_terms와 get_therms의 차이점은 무엇입니까?

예를 들어 get_the_terms가 첨부되어 있는 카테고리 세트를 제공한다는 것은 알고 있습니다만, 실제로 get_terms가 무엇을 하는지, get_terms와 어떻게 다른지 이해할 수 없습니다.

모두에게 감사를 표합니다.

WordPress Codex에서 다음을 찾을 수 있습니다.

get_the_module의 경우: "게시판에 첨부된 분류법의 용어를 가져옵니다." http://codex.wordpress.org/Function_Reference/get_the_terms

get_terms의 경우: "분류법 또는 분류법 목록에서 용어를 검색합니다.http://codex.wordpress.org/Function_Reference/get_terms

따라서 get_the_terms()는 투고에 부가된 용어(카테고리 등)를 취득하고 get_terms()는 분류법(카테고리 분류법 내의 카테고리 등)을 취득합니다.예를 들어 get_terms('category')는 WordPress 사이트에 추가한 모든 카테고리를 반환합니다.

보다 실용적인 이해를 위해 get_terms를 루프 외부에서 사용할 수 있지만 get_terms는 루프 내에서만 사용할 수 있습니다.

get_the_terms에서는 특정 post_id로 용어를 가져올 수 있지만 get_terms에서는 post_id(즉, post) 집합의 값을 얻을 수 있습니다.

언급URL : https://stackoverflow.com/questions/24925297/what-is-the-difference-between-get-terms-and-get-the-terms-in-wordpress

반응형