/home/techb158/public_html/wp-content/plugins/kirki/app/Supports
Edit: /home/techb158/public_html/wp-content/plugins/kirki/app/Supports/ContentManager.php (2448B)
where('meta_key', with_prefix('cm_fields'))
->first();
if (empty($fields)) {
return [];
}
return $fields->meta_value ? $fields->meta_value : [];
}
/**
* Validate a post slug against reserved words and WordPress rules.
*
* @param int $post_id
* @param string $post_type
* @param string $post_name
* @return bool
*/
public static function validate_slug(int $post_id, string $post_type, string $post_name)
{
if (in_array($post_name, static::RESERVED_SLUG_WORDS, true)) {
return false;
}
$post_query = Post::where('post_type', $post_type)
->where('post_name', $post_name);
if (!empty($post_id)) {
$post_query->where('ID', '!=', $post_id);
}
$post = $post_query->first();
return empty($post);
}
/**
* Build the child post type value for a parent collection.
*
* @param int $post_parent
* @return string
*/
public static function get_child_post_post_type_value($post_parent)
{
return with_prefix('cm_' . $post_parent);
}
/**
* Build the child post meta key for a parent collection field.
*
* @param int $post_parent
* @param string $field_id
* @return string
*/
public static function get_child_post_meta_key_using_field_id($post_parent, $field_id)
{
return with_prefix('cm_field_' . $post_parent . '_' . $field_id);
}
}