forked from wpengine/wp-graphql-content-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Joe Fusco <[email protected]>
- Loading branch information
1 parent
f9648a9
commit b945bb6
Showing
7 changed files
with
450 additions
and
1 deletion.
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,5 @@ | ||
# WPGraphQL Content Blocks | ||
|
||
## 0.1.0 | ||
|
||
- Proof of concept. |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# WP Block GraphQL Plugin | ||
# WPGraphQL Content Blocks | ||
|
||
WordPress plugin that extends WPGraphQL to support querying (Gutenberg) Blocks as data. |
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,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": {} | ||
} |
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,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 ); | ||
} |
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,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 |
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,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'; |