-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See pewresearch/pewresearch-org@5ecd0e0 from refs/heads/release/5.0
- Loading branch information
1 parent
af8af28
commit 73fbf9f
Showing
6 changed files
with
18,694 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Categories | ||
Contributors: Pew Research Center | ||
Tags: block | ||
Tested up to: 6.4 | ||
Stable tag: 0.1.0 | ||
License: GPL-2.0-or-later | ||
License URI: https://www.gnu.org/licenses/gpl-2.0.html | ||
|
||
|
||
|
||
## Description | ||
|
||
This is the long description. No limit, and you can use Markdown (as well as in the following sections). | ||
|
||
For backwards compatibility, if this section is missing, the full length of the short description will be used, and | ||
Markdown parsed. | ||
|
||
## Instructions | ||
|
||
This section describes how to use the block. | ||
|
||
## Frequently Asked Questions | ||
|
||
= A question that someone might have = | ||
|
||
An answer to that question. | ||
|
||
### What about foo bar? | ||
|
||
Answer to foo bar dilemma. | ||
|
||
## Screenshots | ||
|
||
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). | ||
2. This is the second screen shot | ||
3. You can store screenshots in a .docs folder in this block directory... | ||
|
||
## Changelog | ||
|
||
= 0.1.0 = | ||
* Release | ||
|
||
## Developer Notes | ||
|
||
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated | ||
blocks where more information needs to be conveyed that doesn't fit into the categories of "description" or | ||
"installation." Arbitrary sections will be shown below the built-in sections outlined above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
namespace PRC\Platform\Blocks; | ||
use MatthiasMullie\Minify; | ||
|
||
/** | ||
* Block Name: Categories | ||
* Requires at least: 6.4 | ||
* Requires PHP: 8.1 | ||
* Author: Pew Research Center | ||
* | ||
* @package prc-block | ||
*/ | ||
|
||
class Core_Categories { | ||
public static $block_name = 'core/categories'; | ||
|
||
public function __construct($loader) { | ||
$this->init($loader); | ||
} | ||
|
||
public function init($loader = null) { | ||
if ( null !== $loader ) { | ||
$loader->add_action('init', $this, 'register_columns_style'); | ||
} | ||
} | ||
|
||
/** | ||
* Register the block's assets. | ||
* @hook init | ||
*/ | ||
public function register_columns_style() { | ||
ob_start(); | ||
?> | ||
.wp-block-categories.is-style-columns { | ||
columns: 2; | ||
column-gap: 1em; | ||
padding: 0; | ||
} | ||
.wp-block-categories.is-style-columns li { | ||
list-style: none; | ||
} | ||
<?php | ||
$style = ob_get_clean(); | ||
$minifier = new Minify\CSS($style); | ||
$style = $minifier->minify(); | ||
register_block_style( | ||
self::$block_name, | ||
array( | ||
'name' => 'columns', | ||
'label' => 'Columns', | ||
'inline_style' => $style, | ||
), | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.