Skip to content

Commit

Permalink
chore: reorganize some code
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenn00dle committed Feb 20, 2024
1 parent d88c134 commit 60c07dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 4 additions & 0 deletions includes/hub/class-node.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* Class to represent one Node of the netowrk
*/
class Node {
/**
* HUB_NODES_SYNCED_OPTION for network nodes.
*/
const HUB_NODES_SYNCED_OPTION = 'newspack_hub_nodes_synced';

/**
* The WP_Post object for this Node
Expand Down
6 changes: 0 additions & 6 deletions includes/hub/class-nodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@
* Class to handle Nodes post type
*/
class Nodes {

/**
* POST_TYPE_SLUG for Newsletter Lists.
*/
const POST_TYPE_SLUG = 'newspack_hub_nodes';

/**
* HUB_NODES_SYNCED_OPTION for network nodes.
*/
const HUB_NODES_SYNCED_OPTION = 'newspack_hub_nodes_synced';

/**
* Initialize this class and register hooks
*
Expand Down
5 changes: 2 additions & 3 deletions includes/node/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

use Newspack_Network\Admin;
use Newspack_Network\Crypto;
use Newspack_Network\Hub\Node;
use Newspack_Network\Hub\Nodes;
use Newspack_Network\Hub\Node as Hub_Node;

/**
* Class to handle Node settings page
Expand Down Expand Up @@ -372,7 +371,7 @@ private static function render_webhooks_requests() {
* @return void
*/
public static function admin_bar_menu( $wp_admin_bar ) {
$nodes_data = get_option( Nodes::HUB_NODES_SYNCED_OPTION, [] );
$nodes_data = get_option( Hub_Node::HUB_NODES_SYNCED_OPTION, [] );
$nodes_data[] = [
'id' => 0,
'url' => self::get_hub_url(),
Expand Down

0 comments on commit 60c07dd

Please sign in to comment.