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 my_easymail_add_subscriber ( $cf7 ) { | |
$submission = WPCF7_Submission::get_instance(); | |
$data = $submission->get_posted_data(); | |
$fields['email'] = $data["your-email"]; | |
$fields['name'] = $data["your-name"]; | |
if ( function_exists ('alo_em_add_subscriber') && is_email( $fields['email'] ) ) | |
{ | |
alo_em_add_subscriber( $fields, 1, alo_em_get_language(true) ); |
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 | |
/** | |
* Case: related news | |
* | |
* At first query for posts of same category, then, if it doesn't find enough posts, query for other posts and merge the 2 results. | |
* | |
* Put the following code inside a single template. | |
* | |
* @link Inspired by http://wordpress.stackexchange.com/questions/71576/combining-queries-with-different-arguments-per-post-type#answer-71582 |
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 | |
/* | |
* Plugin name: Test Rewrite Plugin | |
* Source: https://jeremyfelt.com/2015/07/17/flushing-rewrite-rules-in-wordpress-multisite-for-fun-and-profit/ | |
* */ | |
add_action( 'admin_bar_menu', 'toolbar_link_to_mypage', 999 ); | |
function toolbar_link_to_mypage( $wp_admin_bar ) { |
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 | |
/** | |
* Flush permalink on EVERY site on a mulsitite, so you don't have to visit | |
* Permalink dashboard page of every single blog. | |
* | |
* How to use: | |
* - upload it in /wp-content/mu-plugins/ | |
* - leave the file there for some days | |
* - then REMOVE the file! | |
*/ |
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
/** | |
* Register your custom post type: write all the settings you like in $args. | |
* | |
* Note the 'slug' set to '/' to remove custom post type slug from url e.g. | |
* "/post-slug" instead of default "/custom-type-slug/post-slug" | |
*/ | |
public function register_my_custom_type() { | |
$args = array( | |
/* ... */ |
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
#!/bin/bash | |
# Check wp-cli installed | |
type wp >/dev/null 2>&1 || { echo >&2 "This script requires wp-cli but it's not installed. Aborting."; exit 1; } | |
printf "\e[32mLet's go installing WP...\n\e[0m" | |
printf "\nTo install in a subfolder, write the folder name.\n" | |
echo "Otherwise leave empty to install in root:" |
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
#!/usr/bin/php -q | |
<?php | |
require "../gump.class.php"; | |
$validator = new GUMP(); | |
$_POST = array( | |
'first_name' => 'Joe', | |
'last_name' => 'Black', |
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 | |
/********************************************************************** | |
* zTranslate integration | |
**********************************************************************/ | |
function alo_em_ztrans_set_plugin( $multilang_plugin ){ | |
if ( function_exists('ztrans_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 | |
/* | |
// ------------------------------------------------------------------------------- | |
// EXTRA: add the "open-easymail-popup" class to have a link that opens newsletter dialog | |
// ------------------------------------------------------------------------------- | |
<a href="" class="open-easymail-popup">Newsletter</a> | |
*/ | |
NewerOlder