Skip to content

Commit

Permalink
bump version to 0.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheyenbrock committed Mar 7, 2024
1 parent d95f869 commit 46a2588
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 10 deletions.
14 changes: 7 additions & 7 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in an actual WordPress site where you can play around with it!
> **Note**
> You don't need to create an account to be able to create a new local Wordpress instance
Once you have a WordPress website running, click "Go to site folder" to open your installation in Finder.
Once you have a WordPress website running, click "Go to site folder" to open your installation in Finder.
You can drag & drop this folder into your shell of choice to get the path pasted. Then navigate to the actual WordPress installation in `app/public`

```sh
Expand All @@ -25,7 +25,7 @@ WordPress site is located:
ln -s /path/to/this/repo/wp-stellate ./wp-content/plugins/wp-stellate
```

Next, open up the WP Admin panel and log in with the credentials you entered during WordPress installation.
Next, open up the WP Admin panel and log in with the credentials you entered during WordPress installation.
On the left, navigate to "Plugins" and add a new one. Search for "GraphQL" and install the "WPGraphQL" plugin and activate it.

Now you should see in the left navigation a "GraphQL" section that contains a sub-item called "Caching". In there, configure the service name and purging token to use.
Expand Down Expand Up @@ -70,10 +70,10 @@ rm -rf my-folder/trunk/*
cp /path/to/wp-stellate/* my-folder/trunk
```

Before moving on, make sure that the stable version in the `readme.txt` file
Before moving on, make sure that the stable version in the `readme.txt` file
is set to the version you're about to create.

Move into the folder that contains the SVN repository and add all the files
Move into the folder that contains the SVN repository and add all the files
you just changed:

```sh
Expand All @@ -87,16 +87,16 @@ svn add trunk/*
> There is no "staging area" like in git and all changes to existing files will be synced in the command below by copying to a new tag.
To create the new tag, copy the trunk into a new folder in `tags`. We
strive to use semantic versioning, so replace `x`, `y`, and `z` with
strive to use semantic versioning, so replace `x`, `y`, and `z` with
the approproate numbers.

```sh
svn copy trunk tags/x.y.z
```

Now you can commit the changes. This will also push the commit to the remote
SVN repository, so you need to authorize. Pass the username `stellatehq` via
the `--username` flag and enter the password when promted. You can find these
SVN repository, so you need to authorize. Pass the username `stellatehq` via
the `--username` flag and enter the password when promted. You can find these
credentials in our shared 1Password.

```sh
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Tags: Stellate, GraphQL, WPGraphQL, API, Caching, Edge, Performance
Requires at least: 5.0
Tested up to: 6.4.0
Requires PHP: 7.1
Stable tag: 0.1.6
Stable tag: 0.1.7
License: GPL-3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
38 changes: 36 additions & 2 deletions wp-stellate.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Description: Stellate for your WordPress GraphQL API
* Author: Stellate
* Author URI: https://stellate.co
* Version: 0.1.6
* Version: 0.1.7
* Requires at least: 5.0
* Tested up to: 6.4.0
* Requires PHP: 7.1
Expand All @@ -16,7 +16,7 @@
*
* @package Stellate
* @author Stellate
* @version 0.1.6
* @version 0.1.7
*/

/**
Expand All @@ -28,6 +28,25 @@
}


/**
* TEMP: Add custom post type
*/
add_action( 'init', function() {
register_post_type( 'product', [
'show_ui' => true, # whether you want the post_type to show in the WP Admin UI. Doesn't affect WPGraphQL Schema.
'labels' => [
//@see https://developer.wordpress.org/themes/functionality/internationalization/
'menu_name' => __( 'Products', 'your-textdomain' ), # The label for the WP Admin. Doesn't affect the WPGraphQL Schema.
],
'hierarchical' => true, # set to false if you don't want parent/child relationships for the entries
'show_in_graphql' => true, # Set to false if you want to exclude this type from the GraphQL Schema
'graphql_single_name' => 'product',
'graphql_plural_name' => 'products', # If set to the same name as graphql_single_name, the field name will default to `all${graphql_single_name}`, i.e. `allDocument`.
'public' => true, # set to false if entries of the post_type should not have public URIs per entry
'publicly_queryable' => true, # Set to false if entries should only be queryable in WPGraphQL by authenticated requests
] );
} );


/**
* Register the settings
Expand Down Expand Up @@ -503,6 +522,9 @@ function stellate_purge_all()
*/
function stellate_call_admin_api($query, $variables)
{
stellate_log($query);
stellate_log($variables);

$service_name = get_option('stellate_service_name');
$token = get_option('stellate_purging_token');

Expand Down Expand Up @@ -541,3 +563,15 @@ function stellate_call_admin_api($query, $variables)

return null;
}

function stellate_log( $msg, $name = '' )
{
// Print the name of the calling function if $name is left empty
$trace=debug_backtrace();
$name = ( '' == $name ) ? $trace[1]['function'] : $name;

$error_dir = '/Users/thomasheyenbrock/Local Sites/wpstellatedev/app/public/wp-content/stellate-plugin.log';
$msg = print_r( $msg, true );
$log = $name . " | " . $msg . "\n";
error_log( $log, 3, $error_dir );
}

0 comments on commit 46a2588

Please sign in to comment.