function links_remove () { // Подключаем DOM parser include_once('simple_html_dom.php'); // Лучше объявить массив один раз, вне циклов $links_mass = array( 'site.com' ); $args = array ('numberposts' => -1); // -1 означает все записи $allposts = get_posts( $args ); foreach( $allposts as $post ) { $id = $post->ID; $content = $post->post_content; $html = str_get_html($content); // получаем структуру DOM контента // Находим все ссылки в контенте foreach($html->find('a') as $element) { // сравниваем со ссылками в массиве foreach($links_mass as $link) { if (strpos($element->href, $link) !== false) { // есть такая ссылка, убираем в элементе все, кроме текста ссылки $element->outertext = $element->innertext; } } } $post->post_content = (string) $html->save(); // модифицируем контент wp_update_post( $post ); // обновляем пост } } add_action ('init', 'links_remove'); This type of - Заметки опытного строителя

This type of

04.05.2017 | комментариев 0 | раздел: Стены

OJSC MK Krangeks today is considered one of the largest manufacturers of this type of technology, the history of the plant’s existence has almost eighty -five years and for all these years tens of thousands of excavators have gone from the conveyor, who still work in all the ends of a huge country. The company sets before itself quite achievable goals — to develop and publish new, most popular models of special equipment, to create worthy nesting to Western analogues of various types of excavators, to make their products popular abroad and of course — to support the competitiveness of the company among Russian consumers.

Оставить комментарий

Текст сообщения:

Имя:

E-mail:

Капча загружается...