jqh 5 лет назад
Родитель
Сommit
8a7db7d642
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      src/Grid/Filter/Presenter/Select.php

+ 5 - 1
src/Grid/Filter/Presenter/Select.php

@@ -178,7 +178,7 @@ SCRIPT;
     protected function loadRemoteOptions($url, $parameters = [], $options = [])
     {
         $ajaxOptions = [
-            'url' => $url.'?'.http_build_query($parameters),
+            'url' => admin_url($url.'?'.http_build_query($parameters)),
         ];
         $configs = array_merge([
             'allowClear'  => true,
@@ -225,6 +225,8 @@ JS;
             'minimumInputLength' => 1,
         ], $this->config);
 
+        $resourceUrl = admin_url($resourceUrl);
+
         $configs = json_encode($configs);
         $configs = substr($configs, 1, strlen($configs) - 2);
 
@@ -301,6 +303,8 @@ JS;
     {
         $class = $this->getElementClass();
 
+        $resourceUrl = admin_url($resourceUrl);
+
         $script = <<<JS
 $(document).off('change', ".{$class}");
 $(document).on('change', ".{$class}", function () {