-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
Release/4.7
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace AC\Admin\ScreenOption; | ||
|
||
use AC\Admin\Preference; | ||
use AC\Admin\ScreenOption; | ||
|
||
class ListScreenSource extends ScreenOption | ||
{ | ||
|
||
private const KEY = 'show_tools_list_screen_source'; | ||
|
||
private $preference; | ||
|
||
public function __construct(Preference\ScreenOptions $preference) | ||
{ | ||
$this->preference = $preference; | ||
} | ||
|
||
public function is_active(): bool | ||
{ | ||
return 1 === $this->preference->get(self::KEY); | ||
} | ||
|
||
public function render(): string | ||
{ | ||
ob_start(); | ||
?> | ||
|
||
<label for="ac-list-screen-source" data-ac-screen-option="<?= self::KEY ?>"> | ||
<input id="ac-list-screen-source" type="checkbox" <?php | ||
checked($this->is_active()); ?>> | ||
<?= __('List Screen Source', 'codepress-admin-columns') ?> | ||
</label> | ||
<?php | ||
return ob_get_clean(); | ||
} | ||
|
||
} |