public function get_field_slug() { if (preg_match('/\\[|\\]/', $this->slug)) { $slug = preg_replace('/\\[|\\]/', '.', $this->slug); $slug = str_replace('..', '.', $slug); return substr($slug, 0, -1); } return $this->slug; }
/** * Get property value. * * @param Papi_Core_Conditional_Rule $rule * * @return mixed */ private function get_value(Papi_Core_Conditional_Rule $rule) { if (papi_doing_ajax()) { $source = $rule->get_source(); $meta_id = papi_get_meta_id(); $entry_type = papi_get_entry_type_by_meta_id($meta_id); if (!papi_is_empty($source) && $entry_type instanceof Papi_Entry_Type !== false) { if (papi_is_property($entry_type->get_property($rule->slug))) { return $this->get_deep_value($rule->slug, $source); } } } if (!papi_is_empty($rule->get_source())) { return $this->get_deep_value($rule->slug, $rule->get_source()); } $slug = $rule->get_field_slug(); $type = papi_get_meta_type(); $value = papi_get_field($slug, null, $type); return $this->get_deep_value($slug, $value); }