Skip to content

Commit

Permalink
Scaffold directory structure
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Fusco <[email protected]>
  • Loading branch information
josephfusco committed Nov 9, 2022
1 parent f9648a9 commit b945bb6
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WPGraphQL Content Blocks

## 0.1.0

- Proof of concept.
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# WP Block GraphQL Plugin
# WPGraphQL Content Blocks

WordPress plugin that extends WPGraphQL to support querying (Gutenberg) Blocks as data.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "wpengine/wp-graphql-content-blocks",
"description": "Plugin that extends WPGraphQL to support querying (Gutenberg) Blocks as data.",
"type": "project",
"minimum-stability": "stable",
"require-dev": {}
}
34 changes: 34 additions & 0 deletions includes/utilities/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* Various utility functions used through the Faust plugin.
*
* @package WPGraphQLContentBlocks
*/

namespace WPGraphQLContentBlocks\Utilities;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Converts string to camelCase. Added to ensure that fields are compliant with the GraphQL spec.
*
* @param string $str The string to be converted to camelCase.
* @param array $preserved_chars The characters to preserve.
*
* @credit http://www.mendoweb.be/blog/php-convert-string-to-camelcase-string/
*
* @return string camelCase'd string
*/
function camelcase( $str, $preserved_chars = array() ) {
/* Convert non-alpha and non-numeric characters to spaces. */
$str = preg_replace( '/[^a-z0-9' . implode( '', $preserved_chars ) . ']+/i', ' ', $str );
$str = trim( $str );

/* Uppercase the first character of each word. */
$str = ucwords( $str );
$str = str_replace( ' ', '', $str );

return lcfirst( $str );
}
34 changes: 34 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
=== WPGraphQL Content Blocks ===
Contributors: blakewpe, chriswiegman, joefusco, matthewguywright, TeresaGobble, thdespou, wpengine
Tags: faustjs, faust, headless, decoupled
Requires at least: 5.7
Tested up to: 6.1
Stable tag: 0.8.0
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Extends WPGraphQL to support querying (Gutenberg) Blocks as data.

== Description ==

Extends WPGraphQL to support querying (Gutenberg) Blocks as data.

== Installation ==

1. Search for the plugin in WordPress under "Plugins -> Add New".
2. Click the “Install Now” button, followed by "Activate".

That's it! For more information on getting started with headless WordPress, see [Getting Started with Faust](https://faustjs.org/docs/tutorial/dev-env-setup).

== Frequently Asked Questions ==

== Screenshots ==

== Changelog ==

= 0.1.0 =

### Minor Changes

- Proof of concept
30 changes: 30 additions & 0 deletions wp-graphql-content-blocks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Plugin Name: WPGraphQL Content Blocks
* Description: Extends WPGraphQL to support querying (Gutenberg) Blocks as data.
* Author: WP Engine
* Author URI: https://wpengine.com/
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wp-graphql-content-blocks
* Domain Path: /languages
* Version: 0.1.0
* Requires PHP: 7.2
* Requires at least: 5.7
*
* @package WPGraphQLContentBlocks
*/

namespace WPGraphQLContentBlocks;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

define( 'WPGRAPHQL_CONTENT_BLOCKS_FILE', __FILE__ );
define( 'WPGRAPHQL_CONTENT_BLOCKS_DIR', dirname( __FILE__ ) );
define( 'WPGRAPHQL_CONTENT_BLOCKS_URL', plugin_dir_url( __FILE__ ) );
define( 'WPGRAPHQL_CONTENT_BLOCKS_PATH', plugin_basename( WPGRAPHQL_CONTENT_BLOCKS_FILE ) );
define( 'WPGRAPHQL_CONTENT_BLOCKS_SLUG', dirname( plugin_basename( WPGRAPHQL_CONTENT_BLOCKS_FILE ) ) );

require WPGRAPHQL_CONTENT_BLOCKS_DIR . '/includes/utilities/functions.php';

0 comments on commit b945bb6

Please sign in to comment.