@WebforSelf

Как найти настройку в админ панели Wordpress?

Есть сайт на шаблоне

https://myhometheme.zendesk.com/hc/en-us/articles/...

Шаблон недвижимости и в нем есть вывод связанной недвижимости.

spoiler
<?php
/* @var \MyHomeCore\Estates\Elements\Related_Properties_Estate_Element $myhome_estate_element */
global $myhome_estate_element;
/* @var \MyHomeCore\Estates\Estate_Writer $myhome_Estate */
global $myhome_estate;
$myhome_related_properties = $myhome_estate->get_related_properties();

if ( count( $myhome_related_properties ) ) :
	?>
	<section class="mh-estate__related">

		<?php if ( $myhome_estate_element->has_label() ) : ?>
			<h3 class="mh-estate__section__heading"><?php echo esc_html( $myhome_estate_element->get_label() ); ?></h3>
		<?php endif; ?>

		<div class="mh-grid">

			<?php foreach ( $myhome_related_properties as $myhome_related_estate ) : ?>

				<div class="mh-grid__1of3">
					<article
						class="mh-estate-vertical <?php echo esc_attr( $myhome_related_estate->get_attribute_classes() ); ?>"
					>
						<?php if ( My_Home_Theme()->layout->favorite_enabled() ) : ?>
							<add-to-favorite
								class="myhome-add-to-favorite"
								:property-id="<?php echo esc_attr( $myhome_related_estate->get_ID() ); ?>"
							></add-to-favorite>
						<?php endif; ?>

						<a href="<?php echo esc_url( $myhome_related_estate->get_link() ); ?>"
						   title="<?php echo esc_attr( $myhome_related_estate->get_name() ); ?>"
						   class="mh-thumbnail"
							<?php if ( \MyHomeCore\Estates\Estate::is_new_tab() ) : ?>
								target="_blank"
							<?php endif; ?>
						>
							<div class="mh-thumbnail__inner">
								<?php if ( $myhome_related_estate->has_image() ) :
									\MyHomeCore\Common\Image::the_image(
										$myhome_related_estate->get_image_id(),
										'standard',
										$myhome_related_estate->get_name()
									);
								endif; ?>
							</div>

							<?php if ( $myhome_related_estate->is_featured() ) : ?>
								<div class="mh-thumbnail__featured">
									<i class="fa fa-star"></i>
								</div>
							<?php endif; ?>

							<?php
							$myhome_related_estate_offer_types = $myhome_related_estate->get_offer_type();
							if ( ! empty( $myhome_related_estate_offer_types ) ) : ?>
								<div class="mh-caption">

									<?php foreach ( $myhome_related_estate->get_offer_type() as $offer_type ) : ?>
										<?php if ( $offer_type->get_option( 'has_label' ) ) : ?>
											<div
												class="mh-caption__inner"
												style="background-color: <?php echo esc_attr( $offer_type->get_option( 'bg_color' ) ); ?>; color: <?php echo esc_attr( $offer_type->get_option( 'color' ) ); ?>"
											>
												<?php echo esc_html( $offer_type->get_name() ); ?>
											</div>
										<?php endif; ?>
									<?php endforeach; ?>

								</div>
							<?php endif; ?>

						</a>

						<div class="mh-estate-vertical__content">
							<h3 class="mh-estate-vertical__heading">
								<a href="<?php echo esc_url( $myhome_related_estate->get_link() ); ?>"
								   title="<?php echo esc_attr( $myhome_related_estate->get_name() ); ?>"
									<?php if ( \MyHomeCore\Estates\Estate::is_new_tab() ) : ?>
										target="_blank"
									<?php endif; ?>
								>
									<?php echo esc_html( $myhome_related_estate->get_name() ); ?>
								</a>
							</h3>

							<address class="mh-estate-vertical__subheading">
								<?php echo esc_html( $myhome_related_estate->get_address() ); ?>
							</address>

							<?php if ( $myhome_related_estate->has_price() ) : ?>
								<div class="mh-estate-vertical__primary">
									<?php foreach ( $myhome_related_estate->get_prices() as $myhome_related_estate_price ) : ?>
										<div <?php if ( $myhome_related_estate_price->is_range() ) : ?>class="mh-price__range" <?php endif; ?>>
											<?php echo esc_html( $myhome_related_estate_price->get_formatted() ); ?>
										</div>
									<?php endforeach;; ?>
								</div>
							<?php endif; ?>

						</div>
					</article>
				</div>

			<?php endforeach; ?>
		</div>
	</section>
<?php
endif;


Сама функция вывода связанных товаров
spoiler
* @return Estates
	 */
	public function get_related_properties() {
		$related_by = array();

		foreach ( Attribute_Factory::get_text() as $attribute ) {
			if ( ! empty( \MyHomeCore\My_Home_Core()->settings->props[ 'mh-related-by__' . $attribute->get_ID() ] ) ) {
				$related_by[] = $attribute->get_ID();
			}
		}

		$estate_factory = new Estate_Factory();
		foreach ( $this->estate->get_attributes() as $estate_attribute ) {
			if ( in_array( $estate_attribute->attribute->get_ID(), $related_by ) ) {
				$estate_factory->add_filter( $estate_attribute->get_filter() );
			}
		}

		if ( ! empty( \MyHomeCore\My_Home_Core()->settings->props['mh-related_related-limit'] ) ) {
			$limit = intval( \MyHomeCore\My_Home_Core()->settings->props['mh-related_related-limit'] );
		} else {
			$limit = 6;
		}
		$estate_factory->set_limit( $limit );
		$estate_factory->set_estates__not_in( array( $this->get_ID() ) );

		return $estate_factory->get_results();
	}


Вопрос, как найти в админке где регулируется выбор по которую собирается массив связанных объектов.
  • Вопрос задан
  • 65 просмотров
Решения вопроса 1
@WebforSelf Автор вопроса
Отбой нашел по в админке по поиску "mh-related-by" по class
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
Kozack
@Kozack Куратор тега WordPress
Thinking about a11y
Это зависит от темы. И может быть реализовано сотней способов. Всё на усмотрение разработчика темы. Собственно ему этот вопрос и нужно задавать.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы