??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/am1atec.co.uk/wp-content/plugins/surerank/inc/functions/update.php
⬅ Kembali
<?php
/**
* Update
*
* @package surerank
* @since 0.0.1
*/
namespace SureRank\Inc\Functions;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
use WP_Error;
/**
* Update
*
* @since 1.0.0
*/
class Update {
/**
* Update post meta
* This function will update post meta
*
* @param int $post_id Post ID.
* @param string $meta_key Meta key.
* @param array<string, mixed>|array<int, string>|string|int $meta_value Meta value.
*
* @since 1.0.0
* @return bool|int
*/
public static function post_meta( $post_id, $meta_key, $meta_value ) {
return update_post_meta( $post_id, $meta_key, $meta_value );
}
/**
* Update term meta
* This function will update post meta
*
* @param int $term_id Post ID.
* @param mixed $meta_key Meta key.
* @param mixed $meta_value Meta value.
*
* @since 1.0.0
* @return bool|int|WP_Error
*/
public static function term_meta( $term_id, $meta_key, $meta_value ) {
return update_term_meta( $term_id, $meta_key, $meta_value );
}
/**
* Update user meta
* This function will update user meta
*
* @param int $user_id User ID.
* @param mixed $meta_key Meta key.
* @param mixed $meta_value Meta value.
*
* @since 1.9.0
* @return bool|int
*/
public static function user_meta( $user_id, $meta_key, $meta_value ) {
return update_user_meta( $user_id, $meta_key, $meta_value );
}
/**
* Update the option.
*
* @param string $option_name Option name.
* @param mixed $option_value Option value.
* @param bool $autoload Whether to autoload the option.
* @since 1.0.0
* @return bool
*/
public static function option( $option_name, $option_value, $autoload = false ) {
// Main settings should always be autoloaded — read on every page.
if ( defined( 'SURERANK_SETTINGS' ) && SURERANK_SETTINGS === $option_name ) {
$autoload = true;
}
$result = update_option( $option_name, $option_value, $autoload );
// Clear settings cache when the main settings option is updated.
if ( defined( 'SURERANK_SETTINGS' ) && SURERANK_SETTINGS === $option_name ) {
Settings::clear_cache();
}
return $result;
}
/**
* Update SEO Checks WP Posts.
*
* @param int $post_id Post ID.
* @param array<string, mixed> $seo_checks SEO Checks.
* @since 1.0.0
* @return bool
*/
public static function post_seo_checks( $post_id, $seo_checks ) {
$existing_seo_checks = get_post_meta( $post_id, SURERANK_SEO_CHECKS, true );
$existing_seo_checks = is_array( $existing_seo_checks ) ? $existing_seo_checks : [];
$final_seo_checks = array_filter( array_merge( $existing_seo_checks, $seo_checks ) );
self::post_meta( $post_id, SURERANK_SEO_CHECKS, $final_seo_checks );
self::post_meta( $post_id, SURERANK_SEO_CHECKS_LAST_UPDATED, time() );
return true;
}
/**
* Update SEO Checks for taxonomies.
*
* @param int $term_id Term ID.
* @param array<string, mixed> $seo_checks SEO Checks.
* @since 1.0.0
* @return bool
*/
public static function taxonomy_seo_checks( $term_id, $seo_checks ) {
$existing_seo_checks = get_term_meta( $term_id, SURERANK_SEO_CHECKS, true );
$existing_seo_checks = is_array( $existing_seo_checks ) ? $existing_seo_checks : [];
$final_seo_checks = array_filter( array_merge( $existing_seo_checks, $seo_checks ) );
self::term_meta( $term_id, SURERANK_SEO_CHECKS, $final_seo_checks );
self::term_meta( $term_id, SURERANK_SEO_CHECKS_LAST_UPDATED, time() );
return true;
}
/**
* Update SEO Checks for users.
*
* @param int $user_id User ID.
* @param array<string, mixed> $seo_checks SEO Checks.
* @since 1.9.0
* @return bool
*/
public static function user_seo_checks( $user_id, $seo_checks ) {
$existing_seo_checks = get_user_meta( $user_id, SURERANK_SEO_CHECKS, true );
$existing_seo_checks = is_array( $existing_seo_checks ) ? $existing_seo_checks : [];
$final_seo_checks = array_filter( array_merge( $existing_seo_checks, $seo_checks ) );
self::user_meta( $user_id, SURERANK_SEO_CHECKS, $final_seo_checks );
self::user_meta( $user_id, SURERANK_SEO_CHECKS_LAST_UPDATED, time() );
return true;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 api-utils.php
php
6.6 KB
2026-06-21 06:40
🐘 cache.php
php
18.6 KB
2026-06-21 06:40
🐘 compat.php
php
7.5 KB
2026-06-21 06:40
🐘 cron.php
php
3.3 KB
2026-06-21 06:40
🐘 defaults.php
php
14.2 KB
2026-06-21 06:40
🐘 get.php
php
6.8 KB
2026-06-21 06:40
🐘 helper.php
php
22.1 KB
2026-06-21 06:40
🐘 modified-date-lock.php
php
2.5 KB
2026-06-21 06:40
🐘 requests.php
php
1.9 KB
2026-06-21 06:40
🐘 rest-observation.php
php
2.8 KB
2026-06-21 06:40
🐘 sanitize.php
php
5 KB
2026-06-21 06:40
🐘 send-json.php
php
1.3 KB
2026-06-21 06:40
🐘 settings.php
php
24.2 KB
2026-06-21 06:40
🐘 update.php
php
4.2 KB
2026-06-21 06:40
🐘 utils.php
php
2.5 KB
2026-06-21 06:40
🐘 validate.php
php
2.3 KB
2026-06-21 06:40
🐘 variables.php
php
3.7 KB
2026-06-21 06:40