Website : phonehp.ir
backdoor
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Home
Console
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
nehpir
/
public_html
/
wp-content
/
plugins
/
woocommersa
/
includes
/
Core
/
SEO
/
Filename :
MetaManager.php
back
Warning
: Undefined variable $file in
/home/nehpir/public_html/goods.php
on line
545
Copy
<?php namespace WooCommersa\Core\SEO; if (!defined('ABSPATH')) exit; use WooCommersa\Services\SEOContentGenerator; class MetaManager { private $provider; public function __construct($provider) { $this->provider = $provider; } public function update($post_id, array $data) { $updated = false; if (isset($data['title'])) { $this->provider->update_meta($post_id, 'title', sanitize_text_field($data['title'])); $updated = true; } if (isset($data['description'])) { $this->provider->update_meta($post_id, 'description', sanitize_textarea_field($data['description'])); $updated = true; } if (isset($data['keywords'])) { $this->provider->update_meta($post_id, 'keywords', sanitize_text_field($data['keywords'])); $updated = true; } if (isset($data['robots'])) { $this->provider->update_robots($post_id, $data['robots']); $updated = true; } if (isset($data['faq_schema'])) { // Always save to our master key first update_post_meta($post_id, 'faq_schema_data', (array)$data['faq_schema']); $this->provider->update_faq_schema($post_id, (array) $data['faq_schema']); $updated = true; } if ($updated) { $this->invalidate_cache($post_id); do_action('woocommersa_seo_meta_updated', $post_id, $data); do_action('save_post', $post_id, get_post($post_id), true); } return $updated; } public function apply_template($post_id, $title_tpl, $desc_tpl) { $product = wc_get_product($post_id); if (!$product) return false; $updates = []; if (!empty($title_tpl)) { $updates['title'] = SEOContentGenerator::parse_template($title_tpl, $product); } if (!empty($desc_tpl)) { $updates['description'] = SEOContentGenerator::parse_template($desc_tpl, $product); } if (!empty($updates)) { return $this->update($post_id, $updates); } return false; } public function get($post_id, $field = 'all') { if ($field === 'all') { return [ 'title' => $this->provider->get_meta($post_id, 'title'), 'description' => $this->provider->get_meta($post_id, 'description'), 'keywords' => $this->provider->get_meta($post_id, 'keywords'), 'robots' => $this->provider->get_robots($post_id), 'faq_schema' => $this->provider->get_faq_schema($post_id) ]; } if ($field === 'robots') return $this->provider->get_robots($post_id); if ($field === 'faq_schema') return $this->provider->get_faq_schema($post_id); return $this->provider->get_meta($post_id, $field); } private function parse_template($template, $product) { return SEOContentGenerator::parse_template($template, $product); } private function invalidate_cache($post_id) { wp_cache_delete($post_id, 'post_meta'); clean_post_cache($post_id); } }