// очищаем кэш
wc_delete_product_transients($product_id);
$meta_basename = basename($url_add).PHP_EOL ;
$absolute_del = $SDR . '/wor/wp-content/uploads/pop/'.$meta_basename ;
unlink($absolute_del);
'key' => 'выбор_разделов',
'value' => 12 или 'value'=> array('12','13')
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => - 1,
'meta_query' => array(
array(
'key' => '_visibility',
'value' => array( 'catalog', 'visible' ),
'compare' => 'IN'
)
),
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'term_id', //This is optional, as it defaults to 'term_id'
'terms' => array( 673, 578, 338 ),
'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
)
)
);
'---------------------------------------------------------------------------------------
' Module : CTimeCounter
' DateTime : 25.12.2017 00:25
' Author : Mike Woodhouse
' Purpose : Класс таймера для подсчета времени работы кода
'
' Sub test()
' Dim tc As New CTimeCounter
' tc.StartCounter
' Тестируемый код
' Debug.Print tc.TimeElapsed
' End Sub
'
'---------------------------------------------------------------------------------------
Option Explicit
Private Type LARGE_INTEGER
lowpart As Long
highpart As Long
End Type
#If VBA7 Then
Private Declare PtrSafe Function getTickCount Lib "kernel32" Alias "QueryPerformanceCounter" (cyTickCount As LARGE_INTEGER) As Long
Private Declare PtrSafe Function getFrequency Lib "kernel32" Alias "QueryPerformanceFrequency" (cyFrequency As LARGE_INTEGER) As Long
#Else
Private Declare Function getTickCount Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long
Private Declare Function getFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long
#End If
Private m_CounterStart As LARGE_INTEGER
Private m_CounterEnd As LARGE_INTEGER
Private m_crFrequency As Double
Private Const TWO_32 = 4294967296# ' = 256# * 256# * 256# * 256#
'
Private Function LI2Double(LI As LARGE_INTEGER) As Double
Dim Low As Double
Low = LI.lowpart
If Low < 0 Then
Low = Low + TWO_32
End If
LI2Double = LI.highpart * TWO_32 + Low
End Function
Private Sub Class_Initialize()
Dim PerfFrequency As LARGE_INTEGER
getFrequency PerfFrequency
m_crFrequency = LI2Double(PerfFrequency)
End Sub
Public Sub StartCounter()
getTickCount m_CounterStart
End Sub
Property Get TimeElapsed() As Double
Dim crStart As Double
Dim crStop As Double
getTickCount m_CounterEnd
crStart = LI2Double(m_CounterStart)
crStop = LI2Double(m_CounterEnd)
TimeElapsed = (1000# * (crStop - crStart)) / m_crFrequency
End Property
obj_WorkSheet.Cells()
Такое обращение в ячейке, даже без доступа к БД, при наличии 300к обращений, уже будет тормозить Ваш Excel. Собирайте все в 2х мерный массив и присваивайте одним присваиванием