Yoast\WP\SEO\Helpers
Robots_Txt_Helper::add_allow()
Add an allow rule for a specific user agent if it does not exist yet.
Метод класса: Robots_Txt_Helper{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Robots_Txt_Helper = new Robots_Txt_Helper(); $Robots_Txt_Helper->add_allow( $user_agent, $path );
- $user_agent(строка) (обязательный)
- The user agent to add the allow rule to.
- $path(строка) (обязательный)
- The path to add as a allow rule.
Код Robots_Txt_Helper::add_allow() Robots Txt Helper::add allow Yoast 24.1
public function add_allow( $user_agent, $path ) { $user_agent_container = $this->robots_txt_user_agents->get_user_agent( $user_agent ); $user_agent_container->add_allow_directive( $path ); }