Yoast\WP\SEO\Helpers
Indexing_Helper::should_show_optimization_button
Returns whether the SEO optimization button should show.
Метод класса: Indexing_Helper{}
Хуков нет.
Возвращает
true|false. Whether the SEO optimization button should show.
Использование
$Indexing_Helper = new Indexing_Helper(); $Indexing_Helper->should_show_optimization_button();
Код Indexing_Helper::should_show_optimization_button() Indexing Helper::should show optimization button Yoast 27.4
public function should_show_optimization_button() {
// Gets the amount of unindexed objects in the site.
$unindexed_count = $this->get_filtered_unindexed_count();
// If the amount of unidexed posts is <10 don't show configuration button.
if ( $unindexed_count <= 10 ) {
return false;
}
// If the amount of unidexed posts is >10, but the total amount of unidexed posts is ≤4% of the total amount of objects in the site, don't show configuration button.
if ( $this->get_unindexed_percentage( $unindexed_count ) <= 4 ) {
return false;
}
return true;
}