Расширенные пользовательские поля остаются на странице после удаления - PullRequest
0 голосов
/ 04 октября 2019

У меня проблема с удалением моих расширенных пользовательских полей. Когда я удаляю их через редактор, они остаются на реальном сайте.

Я пытался очистить весь возможный кеш несколько раз, но это не помогло. Я также пытался связаться со службой поддержки ACF, они сказали, что это проблема в коде, и они не могут помочь, ниже приведен код PHP для страницы.

Это код от разработчика, который ранее работал над этим проектом и имеет совершенно другой способ работы с ACF по сравнению со мной, так что это очень запутанно.

Я боролся за некоторыхдней, пожалуйста, helppppp. Заранее всем спасибо.

<code> <?php /* Template Name: Gallery Template */ ?>

<?php get_header();
  global $post; ?>
<style type="text/css">
  .pdf-items img {
    min-height: 236px;
  }

  .hero {
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-image: url(/wp-content/uploads/2019/08/gallery09-min.jpg);
    background-position-y: center;
  }
</style>
<style type="text/css">
  .Schedules-section .pdf-items img {
    height: 478px !important;
  }

  .page-id-13293 .hero.ha-waypoint.parallax-section.parallax-background {
    margin-top: -70px;
  }

  .ui-tabs-nav {
    text-align: center;
  }

  .ui-tabs-nav li {
    display: inline-block;
    border: 1px solid #D33E13;
    padding: 10px 20px;
  }

  .ui-tabs-nav li a {
    font-size: 14px;
    text-transform: uppercase;
    color: #888888;
    outline: none;
    text-decoration: none;
  }

  .ui-tabs-nav li.ui-state-active a {
    color: #ffffff;
    font-family: "ralewaymedium", Helvetica, Arial, sans-serif;
  }

  .ui-tabs-nav li.ui-state-active {
    color: #fff;
    background: #F15523;
  }

  .tabs-inside .ui-tabs-nav li.ui-state-active {
    background: rgba(0, 31, 91, 1);
  }

  .tabs-inside .ui-tabs-nav li {
    border: 1px solid rgba(0, 31, 91, 1);
  }

  .hidden-items {
    display: none;
  }

  .item-title {
    text-align: center;
    font-family: "ralewayregular", Helvetica Neue, Helvetica, Arial, sans-serif;
    display: block;
    color: rgba(0, 0, 0, 1);
    padding: 0 10px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    padding-bottom: 20px;
    min-height: 100px;
  }

  .wrap {
    margin: 60px auto 70px;
  }

  .moreAction {
    text-align: center;
    border: 1px solid #D33E13;
    padding: 10px 20px;
    color: #fff;
    background: #F15523;
    text-decoration: none;
    display: inline-block;
    margin: 0 auto;
    margin-top: 20px;
    text-transform: uppercase;
    border-radius: 4px;
  }

  .moreAction:hover,
  .moreAction:focus,
  .moreAction:active {
    color: #ffffff;
    text-decoration: none;
  }

  @media (max-width: 991px) {
    .item-title {
      min-height: 95px;
    }
  }

  @media (max-width: 767px) {
    .mobile-view {
      width: 50%;
      float: left;
      margin-bottom: 20px;
    }
  }

  @media (max-width: 625px) {
    .mobile-view {
      width: 100%;
      text-align: center;
      margin-bottom: 20px;
    }

    .mobile-view .item-title {
      width: 80%;
      margin: 0 auto;
      padding-top: 20px;
    }
  }

  #header-section {
    background-color: rgba(255, 255, 255, 9);
  }
</style>
<?php 
$_SECTIONS[0]['name'] = 'PHOTOS';
$_SECTIONS[1]['name'] = 'VIDEOS';
$_SECTIONS[2]['name'] = 'DOWNLOADS';
$_SECTIONS[0]['items'][0] = array('sec_title' => 'PROJECTS' , 'image' => 'https://aalshipping.com/wp-content/gallery/aal-fremantle-discharging-railway-equipment-in-singapore-from-nansha-china/IMG-20180727-WA0004.jpg', 'title' => 'AAL Fremantle - Discharging Railway Equipment in Singapore from Nansha, China');
$_SECTIONS[0]['items'][1] = array('sec_title' => 'CARGO PROFILE' , 'image' => 'https://aalshipping.com/wp-content/gallery/aal-fremantle-discharging-railway-equipment-in-singapore-from-nansha-china/IMG-20180727-WA0004.jpg', 'title' => 'AAL Fremantle - Discharging Railway Equipment in Singapore from Nansha, China');
$_SECTIONS[0]['items'][2] = array('sec_title' => 'VESSELS' , 'image' => 'https://aalshipping.com/wp-content/gallery/aal-fremantle-discharging-railway-equipment-in-singapore-from-nansha-china/IMG-20180727-WA0004.jpg', 'title' => 'AAL Fremantle - Discharging Railway Equipment in Singapore from Nansha, China');
// $_SECTIONS[0]['items']['image'] = 'https://aalshipping.com/wp-content/gallery/aal-fremantle-discharging-railway-equipment-in-singapore-from-nansha-china/IMG-20180727-WA0004.jpg';
// $_SECTIONS[0]['items']['title'] = 'AAL Fremantle - Discharging Railway Equipment in Singapore from Nansha, China';
// $_SECTIONS[2]['items']['sec_title'] = 'VESSELS';
?>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.3.5/jquery.fancybox.min.js"></script>
</div>
</div>
<section id="ut-hero" class="hero ha-waypoint parallax-section parallax-background fixed"
  data-animate-up="ha-header-hide" data-animate-down="ha-header-hide" style="background-position: 50% 16px;">
  <div class="grid-container">
    <!-- hero holder -->
    <div class="hero-holder grid-100 mobile-grid-100 tablet-grid-100 ut-hero-style-2" style="opacity: 1;">
      <div class="hero-inner" style="text-align:center;">
        <div class="hth">
          <h1 class="hero-title">Gallery</h1>
        </div>
        <div class="hdb"><span class="hero-description-bottom">
            <a data-id="1" class="hero-btn default tosection" href="javascript:void(0);">PHOTOS</a>
            <a data-id="2" class="hero-second-btn default tosection" href="javascript:void(0);">VIDEOS</a>
            <a data-id="3" class="hero-second-btn default tosection" href="javascript:void(0);">DOWNLOADS</a></span>
        </div>
      </div>
    </div><!-- close hero-holder -->
  </div>
  <div data-section="top" class="ut-scroll-up-waypoint"></div>
</section>
<div id="main-content" class="wrap ha-waypoint" data-animate-up="ha-header-hide" data-animate-down="ha-header-small">
  <div class="row">
    <div class="container">
      <div class="col-md-12">
        <?php

    $_GALLERY_ITEMS = get_field("tabs_title", $post->ID);
      // if (isset($_GET['alex'])) {
      //    echo '<pre>';
      //    print_r($_GALLERY_ITEMS);
      //    echo '
';//} $ counter = 1;$ tabs_counter = 1;foreach ($ _GALLERY_ITEMS as $ gitem) {$ section. = ' '. $ gitem ['tabs_title']. '';$ section_html. = '«;if (! empty ($ gitem ['tabs_repeater_inside'])) {$ counter_ = 1;$ inscounter = 1;$ section_html. = '';foreach ($ gitem ['tabs_repeater_inside'] как $ insitems) {$ more_btn = str_replace ('', '_', $ insitems ['section_header_titles']);$ itemsc = 1;if (! empty ($ insitems ['section_titles'])) {$ section_html. = '«;$ section_html. = '«;foreach ($ insitems ['section_titles'] как $ item) {if ($ item ['item_video_url']! = '') {$ url = explode ('watch? v =', $ item ['item_video_url']);if ($ itemsc <= 3) {$ section_html. = '</iframe> '. $ Item [' item_title '].' ';} else {if (isset ($ _ GET ['clear_cache'])) {$ items = ' '. $ Item [' item_title '].' ';$ _ARRAY_IMAGES [$ more_btn .'- '. $ Itemsc] [' html '] = $ items;}}} else if ($ item ['item_pdf']! = '') {if ($ itemsc <= 3) {$ section_html. = '<a href="'.$item['item_pdf']['url'].'" title="'.$item['item_pdf']['title'].'">'.$item['item_image']['title'].' '. $ Item [' item_title '].' ';} else {if (isset ($ _ GET ['clear_cache'])) {$ items = ''.$item['item_image']['title'].' '. $ Item [' item_title '].' ';$ _ARRAY_IMAGES [$ more_btn .'- '. $ Itemsc] [' html '] = $ items;}}} else {if ($ itemsc <= 3) {$ section_html. = '<img src="'.$item['item_image']['sizes']['galleryv2'].'"> '. $ Item [' item_title '].' «;for ($ i = 1; $ i <= $ item ['total_image']; $ i ++) {// $ section_html. = ' <img src="/wp-content/uploads/'.$item['images_folder'].'/image'.$i.'.jpg">';$ section_html. = ' ';} $ section_html. = '';} else {if (isset ($ _ GET ['clear_cache'])) {$ items = 'image '. $ Item [' item_title '].' «;for ($ i = 1; $ i <= $ item ['total_image']; $ i ++) {// $ section_html. = ' <img src="/wp-content/uploads/'.$item['images_folder'].'/image'.$i.'.jpg">';$ items. = ' ';} $ items. = '';$ _ARRAY_IMAGES [$ more_btn .'- '. $ Itemsc] [' html '] = $ items;}}} $ itemsc ++;} $ section_html. = '';$ section_html. = ' Загрузить еще ';$ section_html. = '';} $ inscounter ++;} $ section_html. = '';$ counter ++;} $ section_html. = '';$ counter ++;$ tabs_counter ++;} if (isset ($ _ GET ['clear_cache'])) {$ file = fopen ('/ home / australa / public_html / gallery.json', 'w');fwrite ($ file, json_encode ($ _ ARRAY_IMAGES));fclose ($ файла);}?>
    jQuery (function () {jQuery ("# ​​tabs, #tabss"). Tabs ();});jQuery (document) .ready (function () {jQuery (". moreAction"). click (function () {var counter, array, split, i, total, x, images, start, images_clear; array = jQuery (this).attr ('data-item'); split = array.split ("-"); counter = + split [1] + 3; total = jQuery ('.' + split [0] + '-total'). val (); start = (+ split [1] + 1); if (total> counter) {jQuery (this) .attr ('data-item', '' + split [0] + '-' + counter +'');} else {jQuery (this) .hide ();} jQuery.getJSON ("/ gallery.json", функция (json) {for (i = start; i <= counter; i ++) {x = split[0] + '-' + i; if (json [x]! = Null) {images + = json [x] ['html'];}} images_clear = images.replace ("undefined", "");jQuery ('.' + split [0] + '-section'). append (images_clear);});});});jQuery ('. tosection'). click (function () {var id = jQuery (this) .attr ('data-id');jQuery ('. active-tab-' + id) .click ();jQuery ("html, body"). animate ({scrollTop: jQuery ('# tabs'). offset (). top - 300}, 1200);});</script>
    ...