Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
Added new capabilities filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcobb committed Jan 7, 2018
1 parent d70873f commit f214234
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Church Community Builder Core API

## A WordPress Plugin that syncs your church data

CCB Core API is a WordPress plugin that has one simple job: It **synchronizes** your church data from [Church Community Builder](https://www.churchcommunitybuilder.com/) into your WordPress database as [Custom Post Types](https://codex.wordpress.org/Post_Types#Custom_Post_Types), [Custom Taxonomies](https://codex.wordpress.org/Taxonomies#Custom_Taxonomies), and [Post Meta](https://codex.wordpress.org/Custom_Fields).

## Who should use this?

This plugin is geared toward Developers, Designers, and Site Administrators who are familiar with customizing WordPress templates. While it does a great job of synchronizing the data, you'll still need to alter your theme in order to take *advantage* of the data.

## What's included?

Out of the box, there are two complete integrations:

### Public Groups

This integration will synchronize any groups that are both _publicly listed_ and _active_ from the Church Community Builder `group_profiles` service to a Custom Post Type named `ccb_core_groups`.

### Public Calendar (Events)

This integration will synchronize all events from the Church Community Builder `public_calendar_listing` service to a Custom Post Type named `ccb_core_calendar`.

## Features

* **Auto Synchronize** - Set it and forget it! The plugin works in the background, never interrupting you or your visitors.
* **Secure** - Your credentials are encrypted, and so is the connection with the Church Community Builder API.
* **WordPress Standards** - The plugin follows WordPress coding standards and best practices, so it's easy to extend and build upon.
* **Free** - Free as in "speech" or free as in "beer"? Yes! It's [GPLv2 licensed](https://tldrlegal.com/license/gnu-general-public-license-v2). Don't you love open source?

## Customizing & Extending

* Setup additional integrations with other Church Community Builder API services.
* Write your own plugin that builds upon this one.
* Customize the existing integrations (Groups & Events).

<center>**[The Wiki](https://github.com/jaredcobb/ccb-core/wiki) has more information and code samples.**</center>

## General Usage

General usage information (setting up the plugin and customizing your theme) can be found in the [usage docs](https://www.wpccb.com/documentation/).
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Provides a core integration to the Church Community Builder API.

Church Community Builder Core API *synchronizes* your church data to WordPress [custom post types](https://codex.wordpress.org/Custom_Post_Types).

This plugin is geared toward developers (or advanced WordPress users who aren't afraid to get into a little bit of code).
This plugin is geared toward Developers, Designers, and Site Administrators who aren't afraid to get into a little bit of code.

Find out more at [https://www.wpccb.com](https://www.wpccb.com).
Find out more at [https://www.wpccb.com](https://www.wpccb.com) and [https://github.com/jaredcobb/ccb-core](https://github.com/jaredcobb/ccb-core).

= Why Use This Plugin? =

Expand Down
11 changes: 10 additions & 1 deletion includes/class-ccb-core-settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ public function __construct( $page_id ) {
* @return void
*/
public function render_page() {
if ( ! current_user_can( 'manage_options' ) ) {

/**
* Defines the capability that is required for the user
* to access the settings page.
*
* @since 1.0.0
*
* @param string $capability The capability required to access the page.
*/
if ( ! current_user_can( apply_filters( 'ccb_core_settings_capability', 'manage_options' ) ) ) {
wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'ccb-core' ) );
}
?>
Expand Down
12 changes: 10 additions & 2 deletions includes/class-ccb-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,15 @@ public function initialize_settings_menu() {
add_menu_page(
__( 'Church Community Builder Core API', 'ccb-core' ),
__( 'CCB Core API', 'ccb-core' ),
'manage_options',
/**
* Defines the capability that is required for the user
* to access the settings page.
*
* @since 1.0.0
*
* @param string $capability The capability required to access the page.
*/
apply_filters( 'ccb_core_settings_capability', 'manage_options' ),
'ccb_core_settings',
'__return_null',
'dashicons-update',
Expand All @@ -176,7 +184,7 @@ public function initialize_settings_menu() {
'ccb_core_settings',
$page['page_title'],
$page['page_title'],
'manage_options',
apply_filters( 'ccb_core_settings_capability', 'manage_options' ),
$page_id,
[
$settings_page,
Expand Down

0 comments on commit f214234

Please sign in to comment.