This file contains hidden or 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
$current_user = wp_get_current_user(); | |
$current_user_roles = $current_user->roles; | |
if ( in_array( 'administrator', $current_user_roles, true ) ) { | |
// Show the Review. | |
} |
This file contains hidden or 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
public static function external_user_redirect( $redirect_to, $requested_redirect_to, $user ) { | |
// Is there a user registered to check? Otherwise simply redirect. | |
if ( isset( $user->roles ) && is_array( $user->roles ) ) { | |
// Does this user belong to the internal group? | |
if ( UserManagement::is_user_internal( $user ) ) { | |
// This will redirect them to WP-Admin. | |
return $redirect_to; | |
} elseif ( ! empty( $requested_redirect_to ) ) { | |
// External User with redirect. | |
return $requested_redirect_to; |
This file contains hidden or 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
SELECT | |
* | |
FROM | |
wp_posts | |
INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id | |
LEFT JOIN ( | |
SELECT | |
wp_posts.ID | |
FROM | |
wp_posts |
This file contains hidden or 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
<?php | |
/** | |
* Logic activates / deactivates the plugin. | |
* | |
* @package compeer-matching-plugin | |
*/ | |
namespace ScorpioTek; | |
class PluginActivation { |
This file contains hidden or 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
var placeSearch, autocomplete; | |
var componentForm = { | |
postal_code: 'short_name' | |
}; | |
jQuery(document).ready(function($){ | |
$(document).on('can_embed_loaded', function() { | |
$('#postcode').prop('id', 'postal_code'); | |
$('#form-street').prop('id', 'autocomplete'); | |
$('#postal_code').prop('disabled', 'true'); |
This file contains hidden or 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
<?php | |
/** | |
* Encapsulates the field creation of the announcement custom post type. | |
* | |
* @package compeer | |
* @since 0.0.6.3.3 | |
*/ | |
namespace Compeer; |
This file contains hidden or 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
<?php | |
function compeer_content_types_init() { | |
/** Other functions hidden for brevity */ | |
register_post_type( 'announcement', generate_compeer_cpt_options( 'announcement', 'announcements', 'announcements', 'dashicons-rss', true, true ) ); | |
} | |
add_action( 'init', 'compeer_content_types_init' ); | |
/** |
This file contains hidden or 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
$args = array( | |
'post_type' => 'volunteer', | |
'posts_per_page' => '10', | |
'button_label' => 'Load More', | |
'button_loading_label' => 'Loading...', | |
'scroll' => 'false', | |
'post__in' => implode( ',', $unmatched_volunteers->posts ), | |
'repeater' => 'template_1', | |
'id' => 'participant_listing', | |
); |
This file contains hidden or 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
add_filter( 'pms_submenu_page_capability', 'pmsc_allow_editors_to_view_pages', 20, 2 ); | |
function pmsc_allow_editors_to_view_pages( $capability, $menu_slug ){ | |
if( $menu_slug == 'pms-payments-page' || $menu_slug == 'pms-members-page' || $menu_slug === 'pms-reports-page' || $menu_slug === 'pms-export-page' ) | |
return 'pms_edit_capability'; | |
return $capability; | |
} | |
add_filter( 'pms_export_capability', 'pmsc_change_export_capability'); |
This file contains hidden or 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
public function test_one_off_trigger_vol_police_report_five_days_prior_expiry_notify_area_coordinator() { | |
// Create the pending trigger. | |
$notifications = array( | |
'all_area_coordinators', | |
); | |
$trigger_id = $this->create_trigger_post( 'one_off', 'volunteer', '_police_report_expiry_date', 'ACTUALDATE', $notifications ); | |
// Create the area_coordinator for notification, associate user. | |
$expected_email = '[email protected]'; | |
$assigned_area_coordinator_user = $this->factory->user->create( |