Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@5ecd0e0 from refs/heads/release/5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Feb 14, 2024
1 parent af8af28 commit 73fbf9f
Show file tree
Hide file tree
Showing 6 changed files with 18,694 additions and 0 deletions.
47 changes: 47 additions & 0 deletions blocks/core-categories/README.md
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.
56 changes: 56 additions & 0 deletions blocks/core-categories/core-categories.php
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,
),
);
}

}
Loading

0 comments on commit 73fbf9f

Please sign in to comment.