Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@067fc6d from refs/heads/main
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed May 15, 2024
1 parent 3f6634b commit 0d7695b
Show file tree
Hide file tree
Showing 2,371 changed files with 1,010,377 additions and 1,296 deletions.
Binary file removed .DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

<div id="main">


<h1 class="page-title">Source: block-area-modules/class-block-area-modules.php</h1>










<section>
<article>
<pre class="prettyprint source linenums"><code>&lt;?php
Expand Down Expand Up @@ -280,8 +280,6 @@ <h1 class="page-title">Source: block-area-modules/class-block-area-modules.php</
unset($block_module_query_args['tax_query']);
}

do_action('qm/debug', 'Block Area Query Args' . print_r($block_module_query_args, true));

return $block_module_query_args;
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

<div id="main">


<h1 class="page-title">Source: facets/blocks/facets-context-provider/facets-context-provider.php</h1>










<section>
<article>
<pre class="prettyprint source linenums"><code>&lt;?php
Expand Down Expand Up @@ -128,7 +128,7 @@ <h1 class="page-title">Source: facets/blocks/facets-context-provider/facets-cont
public function render_block_callback($attributes, $content, $block) {
// Store the facets data in global app state.
// Hmmm this function may not concatenate correctly on VIP filesystem. We may need to use a different method.
\wp_store(array(
\wp_initial_state(array(
'state' => array(
'facetsContextProvider' => $block->context['facetsContextProvider'],
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file removed .docs/.DS_Store
Binary file not shown.
24 changes: 24 additions & 0 deletions .docs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"opts": {
"template": "node_modules/wp-hookdoc/template",
"destination": ".docs-built",
"readme": "./README.md",
"recurse": true,
"tutorials": "./.docs/tutorials"
},
"source": {
"includePattern": ".+\\.(php|inc)?$"
},
"plugins": [
"node_modules/wp-hookdoc/plugin",
"plugins/markdown"
],
"markdown": {
"idInHeadings": true
},
"templates": {
"default": {
"layoutFile": ".docs/layout.tmpl"
}
}
}
44 changes: 44 additions & 0 deletions .docs/layout.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?js= title ?> - PRC Platform Core Docs</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
<link type="text/css" rel="stylesheet" href="style.css">
</head>

<body<?js if (title === 'Home') { ?> class="home"<?js } ?>>

<div id="main">

<?js if (title !== 'Home') { ?>
<h1 class="page-title"><?js= title ?></h1>
<?js } ?>

<?js= content ?>

<footer>
<a href="https://platform.pewresearch.org/">platform.pewresearch.org</a> &bull;
<a href="https://github.com/pewresearch/">Pew Research Center on GitHub</a>
</footer>


</div>

<nav>
<?js= this.nav ?>
</nav>

<br class="clear">

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
17 changes: 17 additions & 0 deletions .docs/pre-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs');
const path = require('path');

const sourceDir = path.join(__dirname, '../includes');
const targetDir = path.join(__dirname, '/tutorials');

fs.readdirSync(sourceDir).forEach(dir => {
const sourceFile = path.join(sourceDir, dir, 'README.md');
const targetFile = path.join(targetDir, `${dir}.md`);

if (fs.existsSync(sourceFile)) {
fs.copyFileSync(sourceFile, targetFile);
console.log(`Copied ${sourceFile} to ${targetFile}`);
}
});

console.log("Done! These files have been copied into .docs/tutorials for inclusion in the docs build.");
12 changes: 12 additions & 0 deletions .docs/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
nav {
display: flex;
flex-direction: column;
}

nav h3:first-of-type, nav ul:first-of-type {
order: 2;
}

nav h3:nth-of-type(2), nav ul:nth-of-type(2) {
order: 3;
}
3 changes: 3 additions & 0 deletions .docs/tutorials/block-area-modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Block Area Modules

This system is comprimised of two parts, the `Block Area` and the `Block Module`. Block Modules go into Block Areas, Block Areas are placed in the theme. Additionally a `Block Area Context Provider` is available to provide context of the Story Item ID's inside a Block Area to the primary `core/query` block on page.
4 changes: 4 additions & 0 deletions .docs/tutorials/block-utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## PRC Platform Block Utils

These should be primitive low level utilities, pass in some data get something different out the other end, quickly and effeciently.
For every PHP util you create you MUST create an analogous JS util, for every JS util you create you MUST create an analogous PHP util.
Empty file added .docs/tutorials/embeds.md
Empty file.
3 changes: 3 additions & 0 deletions .docs/tutorials/facets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PRC Facets

This plugin interfaces with FacetWP setting options, facet types, and handling rendering of facets.
13 changes: 13 additions & 0 deletions .docs/tutorials/multisite-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PRC Multisite Migration "Collapse"

This plugin handles the migration schema and mapping for the 2023 Pew Research Center multisite migration. We will be migratin 11 of 13 networks sites into one new network site. This new network site will be the canonical "pewresearch.org".

Going forward these are the expected site ids and slug at launch:
ID: `20`
slug: `pewresearch-org`

This class uses prc-distributor for handling its integration into 10up/distributor.
10up/distributor is used for the network push infrastructure and relies heavily on the hooks and filters afforded to us. That class also establishes a post migration auto-push functionality that we will continue to use post migration for `decoded (18)`.

## Version 2.0
This is now being re-tooled to update migrated content and to pull updates from the sources site into the migration site instead of push from the source sites onto the migration site.
3 changes: 3 additions & 0 deletions .docs/tutorials/post-report-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Post Report Package

Handles "Reports" packaging. Child posts "multi section" and "report materials" along with passing all this information down to child posts correctly.
16 changes: 16 additions & 0 deletions .docs/tutorials/staff-bylines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Staff Bylines System

"Staff Bylines" provides a novel system for handling staff listing pages, staff/author pages, and byline and or acknowledgement attribution on posts; with hooks into Yoast and Parse.ly. Bylines are stored as a custom taxonomy, and staff are stored as a custom post type. This allows for a great deal of flexibility in how the data is used and displayed.

See PRC-Block-Library for Gutenberg blocks that can be used to display staff bylines and provide staff listing pages via the `prc-block/staff-query` block.

To access the data provided by the interfaces here in your theme, you can use the following functions:

```php
// Get the staff byline for a post
$bylines = new Bylines($post_id);
$bylines->format('string'); // Returns a simple string: "By Jane Doe, John Smith, and Jill Doe"
$bylines->format('html'); // Returns a string of HTML: "By <a href="/staff/jane-doe/">Jane Doe</a>, <a href="/staff/john-smith/">John Smith</a>, and <a href="/staff/jill-doe/">Jill Doe</a>"
$bylines->format('array'); // Returns an array of staff objects: [ { key: "jane-doe", termId: 123 }, { key: "john-smith", termId: 456 }, { key: "jill-doe", termId: 789 } ]
```

53 changes: 53 additions & 0 deletions .docs/tutorials/term-data-store.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Term Data Store
Create a one-to-one relationships between posts and terms and keep them in sync.
Forked from 10up.
This version includes stricter binding between post type and taxonomy utilizing term id and post id binding.

## How to Use

### 1. Register a custom post type:

```php
$post_type_name = 'show_pt';
$post_type_options = array();

register_post_type(
$post_type_name, $post_type_options
);
```

### 2. Register a taxonomy:

```php
$taxonomy_name = 'show_tax';
$taxonomy_options = array();
$post_types = array( 'post' );

register_taxonomy(
$taxonomy_name, $post_types, $taxonomy_options
);
```

### 3. Create the relationship between the post type and taxonomy:

```php
\TDS\add_relationship( $post_type_name, $taxonomy_name );
```

### 4. Create a post or term:

Creating a post named "The Tick" in the post type will create a corresponding term named "The Tick" in the taxonomy. The reverse will happen if you create a term in the taxonomy.

## Unit Tests

TDS has a full suite of unit tests to verify expected behavior. To run them, you'll first need to install the composer dependencies:

```sh
composer update
```

Once you have those installed, run phpunit:

```sh
vendor/bin/phpunit
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static .docs content to Pages
name: Deploy static ./.docs content to GitHub Pages

on:
# Runs on pushes targeting the default branch
Expand Down
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Hidden System Files
[Tt]humbs.db
[Dd]esktop.ini
.DS_Store
*.DS_store
.DS_store?
node_modules
node_modules/
.sass-cache
.npmrc

# VS Code
.vscode/*
!.vscode/settings.json
!.vscode/launch.json

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Yarn v2
.pnp.*
.yarn/*
*.yarn/
*/*/.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Testing
artifacts/
6 changes: 0 additions & 6 deletions .wp-env.json

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# prc-platform-core
Core data models, post types, taxonomies, and functionality for the Pew Research Center DXP. Streamline development and ensure consistency across projects with custom post types for research data, taxonomies for categorizing content, and utility functions. Use as a foundation for custom WordPress sites.
# PRC Platform Core

This plugin is intended to be installed in `/mu-plugins` or on WordPress VIP environments `/client-mu-plugins`.
See docs...
2 changes: 0 additions & 2 deletions class-prc-platform-core.php

This file was deleted.

17 changes: 0 additions & 17 deletions composer.json

This file was deleted.

Loading

0 comments on commit 0d7695b

Please sign in to comment.