# solid-post-likes/trunk/controllers/SolidPostLikesSetter.php

Solid Post Likes, version trunk. 30 lines.

- Page: https://pluginprobe.com/plugins/solid-post-likes/trunk/code/controllers/SolidPostLikesSetter.php
- Raw: https://pluginprobe.com/plugins/solid-post-likes/trunk/raw/controllers/SolidPostLikesSetter.php
- Modified: 2026-07-15T21:25:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/solid-post-likes/trunk/code/controllers/SolidPostLikesSetter.php#L10-L20`.

```php
<?php
namespace OACS\SolidPostLikes\Controllers;

use OACS\SolidPostLikes\Controllers\SolidPostLikesStore as Store;

if ( ! defined( 'WPINC' ) ) {die;}

//** This sets the manual post like count via admin settings "Set Likes" */

class SolidPostLikesSetter
{
	public function oacs_spl_set_like_count()
		{
			$post_id                           = intval(carbon_get_theme_option( 'oacs_spl_set_like_count_post' ));
			$oacs_spl_set_like_count_setting   = intval(carbon_get_theme_option( 'oacs_spl_set_like_count' ));

			if (!empty($post_id) && isset($oacs_spl_set_like_count_setting)) {
				// Stored as an offset over the per-like rows so future likes/unlikes
				// keep counting from the admin's number.
				$store = new Store;
				$store->set_manual_count($post_id, $oacs_spl_set_like_count_setting);
				carbon_set_theme_option('oacs_spl_set_like_count_post', '');
				carbon_set_theme_option('oacs_spl_set_like_count', '');
				return;
			}
			return ;
		}

}

```
