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: Disable Plugins | |
Description: Disables plugins that you specify depending on the value of the WP_LOCAL_DEV constant | |
Version: 0.2 | |
License: GPL version 2 or any later version | |
Author: Mark Jaquith | |
Author URI: http://coveredwebservices.com/ | |
*/ |
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
<a style="float:right; margin:0 10px;" href="#" class="dodelete-dates button">Remove All Dates</a> | |
<p>Add dates on which this course will run.</p> | |
<?php while($mb->have_fields_and_multi('dates')): ?> | |
<?php $mb->the_group_open(); ?> | |
<?php $mb->the_field('date'); ?> | |
<p><input type="text" name="<?php $mb->the_name(); ?>" value="<?php $mb->the_value(); ?>" class="datepicker" /> | |
<a href="#" class="dodelete button">Remove Date</a></p> |
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 | |
require_once "wordless_preprocessor.php"; | |
/** | |
* Compile LESS files using the `lessc` executable. | |
* | |
* LessPreprocessor relies on some preferences to work: | |
* - css.lessc_path (defaults to "/usr/bin/lessc"): the path to the lessc executable | |
* - css.output_style (defaults to "compressed"): the output style used to render css files |
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
add_action( 'delete_user', 'dont_delete_user' ); | |
function dont_delete_user( $id ) { | |
$dont_delete_ids = array( 1, 2, 3, 4 ); // protected user IDs | |
if ( in_array( $id, $dont_delete_ids ) ) | |
wp_die( 'You cannot delete this user account.' ); | |
} |
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
// Based on the code in Griddle by @necolas | |
// http://necolas.github.com/griddle/ | |
// ============================================================================= | |
// Helper Functions | |
// ============================================================================= | |
// Find the greatest common factor of two integers | |
@function gcf($a, $b) { | |
@if $b == 0 { |
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 slug in CSS class of all sliders | |
add_filter( 'tgmsp_slider_classes', 'clinicoftcm_slider_classes', 10, 2 ); | |
function clinicoftcm_slider_classes( $classes, $id ) { | |
$slider = get_post( $id, ARRAY_A ); | |
if( $slider['post_name'] ) | |
$classes[] = 'soliloquy-' . $slider['post_name']; | |
return $classes; | |
} |
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_filter( 'wp_link_query', 'seren_wp_link_query_term_linking', 99, 2 ); | |
function seren_wp_link_query_term_linking( $results, $query ) { | |
// Query taxonomy terms. | |
$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' ); | |
$terms = get_terms( $taxonomies, array( | |
'name__like' => $query['s'], | |
'number' => 20, |
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_filter('wp_mail_smtp_custom_options', function( $phpmailer ) { | |
$phpmailer->SMTPOptions = array( | |
'ssl' => array( | |
'verify_peer' => false, | |
'verify_peer_name' => false, | |
'allow_self_signed' => 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 | |
function darpar_body_class( $classes ) { | |
if ( is_singular() && has_post_thumbnail() ) { | |
array_push( $classes, 'has-thumbnail' ); | |
} | |
if ( is_product_category() && get_woocommerce_term_meta( get_queried_object_id(), 'thumbnail_id', true ) ) { | |
array_push( $classes, 'emyr' ); | |
}; |
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_action( 'phpmailer_init', function( $phpmailer ) { | |
$phpmailer->addCustomHeader("X-Mailgun-Drop-Message: yes"); | |
}); |
OlderNewer