Skip to content

Instantly share code, notes, and snippets.

@kcristiano
kcristiano / suppress-log-warnings.php
Last active May 5, 2024 14:58 — forked from christianwach/suppress-log-warnings.php
A WordPress plugin that suppresses warnings created by various plugins and themes in WordPress.
<?php
/**
* Plugin Name: Suppress Log Warnings
* Plugin URI: https://gist.github.com/christianwach/7d2bb481f9efe185f2b8
* Description: Suppresses annoying warnings generated by various plugins.
* Version: 1.0
*
* Put this plugin in /wp-content/mu-plugins/
*
* @package CMW_Suppress_Log_Warnings
@kcristiano
kcristiano / civiup.sh
Last active October 13, 2022 21:39
Civi Update
#!/bin/bash
# The script was built for debian - paths may vary
PHPCLI="/usr/local/bin/php"
WPCLI="/usr/local/bin/wp-cli.phar"
WP="/usr/local/bin/wp"
CV="/usr/local/bin/cv"
DATE=$(date +%Y%m%d-%I%M%S)
echo "Hello, "$USER". This script will update CiviCRM."
echo "This script requires minimum version of WordPress 5.4. CiviCRM 5.35 amd PHP 7.3."
read -p "Press [Enter] key to start the backups and updates."
@kcristiano
kcristiano / 5.26.2-paths-urls-set-in-ui.json
Last active July 24, 2020 12:10
5.26.2-paths-urls-set-in-ui.json
{
"constants": {
"CIVICRM_UF": "WordPress",
"CIVICRM_UF_BASEURL": "https://site.test/",
"CIVICRM_SETTINGS_PATH": "/srv/www/site/wp-content/uploads/civicrm/civicrm.settings.php",
"CIVICRM_UF_WP_BASEPAGE": null,
"CIVICRM_TEMPLATE_COMPILEDIR": "/srv/www/site/wp-content/plugins/files/civicrm/templates_c/",
"CIVICRM_L10N_BASEDIR": null
},
"civicrm_paths": {
@kcristiano
kcristiano / functions.php
Created August 24, 2019 18:15 — forked from tessak22/functions.php
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php
index f2df6c8476..493e174f79 100644
--- a/CRM/Utils/System/WordPress.php
+++ b/CRM/Utils/System/WordPress.php
@@ -208,6 +208,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
$fragment = isset($fragment) ? ('#' . $fragment) : '';
$path = CRM_Utils_String::stripPathChars($path);
+ $basepage = FALSE;
@kcristiano
kcristiano / cvbuild.sh
Created November 6, 2017 20:17
new site creation - Debian Jessie
#!/bin/bash
projectdir=/home
homedir=/home
echo -n "Enter user name: "
read username
echo -n "Enter the CiviCRM version you need (eg 4.7.26) and press [ENTER]: "
read civiver
echo -n "Enter the WP version you need (eg 4.8) and press [ENTER]: "
read wpver
@kcristiano
kcristiano / keybase.md
Last active December 23, 2016 21:43
keybase.md

Keybase proof

I hereby claim:

  • I am kcristiano on github.
  • I am kcristiano (https://keybase.io/kcristiano) on keybase.
  • I have a public key ASAFEUgWC7MZ9kF4jbhvNMvYAonpQhmBTGpGqyHu-NHy9go

To claim this, I am signing this object:

@kcristiano
kcristiano / wc-all.xml
Created February 12, 2016 20:09
WordCamp Global Sponsor XML
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
@kcristiano
kcristiano / baseurl.php
Created February 1, 2016 15:50
baseurl
<?php
// Test where we are and define CIVICRM_UF_BASEURL
$wp_civicrm_home_uf_baseurl = home_url();
$wp_civicrm_adminfull_uf_baseurl = admin_url();
$wp_civicrm_admin_uf_baseurl = str_replace('/wp-admin/', '', $wp_civicrm_adminfull_uf_baseurl);
if (!defined('CIVICRM_UF_BASEURL') && ! is_admin()) {
define( 'CIVICRM_UF_BASEURL', $wp_civicrm_home_uf_baseurl );
}
@kcristiano
kcristiano / Hooks-CiviCRM-WP.md
Last active August 29, 2015 14:19
List of Hooks used in WordPress CiviCRM. WordPress hooks used by CiviCRM and hooks created in CiviCRM for WordPress use

WordPress Hooks used in CiviCRM

add_action();

CiviCRM_For_WordPress::wp();

CiviCRM_For_WordPress::wp_loaded();

CiviCRM_For_WordPress::plugins_loaded();

CiviCRM_For_WordPress::admin_menu();

CiviCRM_For_WordPress::admin_notices();

CiviCRM_For_WordPress::load_{$menu_page}();