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
/* Disable VC auto-update */ | |
function seventhqueen_vc_disable_update() { | |
if (function_exists('vc_license') && function_exists('vc_updater') && ! vc_license()->isActivated()) { | |
remove_filter( 'upgrader_pre_download', array( vc_updater(), 'preUpgradeFilter' ), 10); | |
remove_filter( 'pre_set_site_transient_update_plugins', array( | |
vc_updater()->updateManager(), | |
'check_update' | |
) ); |
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
function sanitize_chinese_user( $username, $raw_username, $strict ) { | |
if ( $username != $raw_username ) { | |
$username = $raw_username; | |
} | |
$username = strip_tags( $username ); | |
// Kill Chinese characters | |
$username = preg_replace( '|[^a-z0-9 _.\-@一-龥]|ui', '', $username ); | |
// Consolidate contiguous whitespace |
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
<?php | |
/* Redirect user to levels page until he subscribes for a membership */ | |
add_action( 'template_redirect', 'sq_membership_restrict' ); | |
function sq_membership_restrict() { | |
global $pmpro_pages, $post; | |
if ( is_user_logged_in() && ! pmpro_hasMembershipLevel() ) { | |
if (isset( $post->ID ) && ! in_array( $post->ID, $pmpro_pages )) { | |
wp_redirect( pmpro_url() ); |
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
<html> | |
<head> | |
<title>page title</title> | |
</head> | |
<body <?php body_class(); ?> <?php kleo_schema_org_markup();?>> | |
</body> | |
</html> |
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
[vc_row][vc_column][kleo_grid type="3" colored_icons="yes" bordered_icons="yes" divided="yes"][kleo_feature_item title="Featured item 1" icon="twitter" icon_position="center"][/kleo_feature_item][kleo_feature_item title="Featured item 1" icon="twitter" icon_position="center"][/kleo_feature_item][kleo_feature_item title="Featured item 1" icon="twitter" icon_position="center"][/kleo_feature_item][kleo_feature_item title="Featured item 1" icon="twitter" icon_position="center"][/kleo_feature_item][kleo_feature_item title="Featured item 1" icon="twitter" icon_position="center"][/kleo_feature_item][kleo_feature_item title="Featured item 1" icon="twitter" icon_position="center"][/kleo_feature_item][/kleo_grid][/vc_column][/vc_row] |
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
<?php | |
//https://themeforest.net/item/kleo-pro-community-focused-multipurpose-buddypress-theme/6776630?ref=SeventhQueen | |
//https://wordpress.org/plugins/essential-real-estate/ | |
if ( ! function_exists( 'kleo_ere_before_main_content' ) ) { | |
function kleo_ere_before_main_content() { | |
remove_action( 'kleo_before_main_content', 'kleo_title_main_content' ); | |
get_template_part( 'page-parts/general-before-wrap' ); | |
} | |
add_action( 'ere_before_main_content', 'kleo_ere_before_main_content' ); |
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
<?php | |
/** | |
* Check if user used Facebook login | |
* | |
* @param int $user_id The user ID to check. | |
* @return bool | |
*/ | |
function sq_is_facebook_user( $user_id = null ) { | |
if ( ! is_user_logged_in() ) { |
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
<?php | |
/* | |
Add the PMPro meta box to a CPT | |
*/ | |
function my_sensei_course_meta_wrapper() | |
{ | |
//duplicate this row for each CPT | |
add_meta_box('pmpro_page_meta', 'Require Membership', 'pmpro_page_meta', 'course', 'side'); | |
} | |
function pmpro_cpt_init() |
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
<?php | |
/** | |
* Restrict users to your site and redirect them to register page | |
* @author SeventhQueen | |
* | |
* @return void | |
*/ | |
function sq_restrict_my_website(){ |
NewerOlder