View random_login.php
function jpr_generateRandomString($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}
View author-role.php
add_action('bp_core_activated_user', 'bp_custom_registration_role',10 , 3);
function bp_custom_registration_role($user_id, $key, $user) {
$userdata = array();
$userdata['ID'] = $user_id;
$userdata['role'] = 'author';
//only allow if user role is my_role
if (($userdata['role'] == "subscriber") or ($userdata['role'] == "contributor"))
wp_update_user($userdata);
}
View 260-2
<?php
/**
* Add the code below to your WeFoster Child Theme
*/
function wfc_add_main_class() {
echo 'my-custom-class ';
}
add_action( 'class_main','wfc_add_main_class' );
function wfc_add_sidebar_class() {
View doing-it-right.html
<?php get_template_part('templates/loops/content', 'page'); ?>
<!-- My Custom Content -->
<p>This is some custom content after my page content is shown. I'm adding this by overwriting my template via a Child Theme!</p>
<!-- My Custom Content -->
<?php do_action('close_page_content'); ?>
View acf-customizer-patch.php
<?php
/*
Plugin Name: ACF Customizer Patch
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer.
Author: Mark Fabrizio
Version: 1.0
Author URI: http://owlwatch.com/
*/
class acf_customizer_patch
View load_anspress.php
<?php
function wfc_load_anpress_when_needed() {
if ( is_anspress() ) {
ap_scripts_front();
}
}
add_action('wp_enqueue_scripts', 'wfc_load_anpress_when_needed', 1);
View starter-settings.php
<?php
function wefoster_import_starter_settings() {
$screen = get_current_screen();
if (strpos($screen->id, "acf-options-starter-kits") == true) {
// Check to see if the settings have already been imported.
$starterkit = get_field( "choose_a_starter_kit", 'option' );
$template = get_template();
$imported = get_option( $template . '_' . $starterkit . '_customizer_import', false );
View theme-tour.php
<?php
/**
* Theme Activation Tour
*
* This class handles the pointers used in the introduction tour.
* @package Popup Demo
*
*/
class WordImpress_Theme_Tour {
View add-dashicons-to-wordpress-customizer.php
<?php
/**
* Enqueue the stylesheet.
* http://aristeides.com/blog/modifying-wordpress-customizer/
*/
function my_enqueue_customizer_stylesheet() {
wp_register_style( 'my-customizer-css', YOUR_PLUGIN_URL. 'assets/css/customizer.css', NULL, NULL, 'all' );
wp_enqueue_style( 'my-customizer-css' );
View bp-default-notification-settings.php
<?php
add_action( 'bp_core_activated_user', 'bpdev_set_email_notifications_preference');
function bpdev_set_email_notifications_preference( $user_id ) {
//I am putting all the notifications to no by default
//you can set the value to 'yes' if you want that notification to be enabled.
$settings_keys = array(
'notification_activity_new_mention' => 'no',
'notification_activity_new_reply' => 'no',