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( 'pre_update_option_blogname', 'arunas_limit_blogname', 10, 2 ); | |
function arunas_limit_blogname( $value, $old_value ) { | |
// check for length (pr do any other kind of validation) | |
if ( 40 < strlen($value) ) { | |
// throw error via Settings API | |
add_settings_error( | |
'blogname', // option name | |
'blogname', // error id | |
__( 'Blog title is too long', 'plugin-slug' ), |
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('elsue_bits_img_id' , 'sb_dynamic_image'); | |
function sb_dynamic_image($thumb_id) { | |
global $post; | |
if( class_exists('Dynamic_Featured_Image') ) { | |
global $dynamic_featured_image; | |
// Get all dynmaic images | |
$featured_images = $dynamic_featured_image->get_featured_images( $post->ID ); |
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 | |
/* | |
Seperate Woocommerce reviews from comments and make a reviews moderation panel. | |
*/ | |
class PL_Woo_Review_Mods { | |
function __construct() { | |
add_action( 'current_screen', array( $this, 'check_current_page' ), 10, 2 ); | |
add_action( 'admin_menu', array( $this, 'add_product_reviews' ) ); | |
} | |
function check_current_page( $screen ) { |
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('acf/location/rule_types', 'acf_location_rules_types'); | |
function acf_location_rules_types( $choices ) { | |
$choices['Page']['pagelinespage'] = 'Pagelines Page'; | |
return $choices; | |
} | |
// Find pages | |
add_filter('acf/location/rule_values/pagelinespage', 'acf_location_rules_values_pagelinespage'); |
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 load_mc_iris() { | |
if (wp_script_is( 'iris', 'enqueued' )) { | |
return; // if it's already enqueued, don't enqueue it again. | |
} else { // since it's NOT enqueued, let's enqueue it | |
wp_enqueue_script( | |
'iris', //iris.js handle | |
admin_url( 'js/iris.min.js' ), //path to wordpress iris 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
<?php | |
/* | |
* NOTE: 2 varibales passed here... | |
*/ | |
add_filter( 'pl-area-inner-classes', 'my_classes_filter', 10, 2 ); | |
/* | |
* Filter function now needs 2 variables | |
* 1st is the actual value being filtered | |
* 2nd is the section meta data in the form of an 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
// from http://www.pagelinestheme.com/make-content-width-section-full-width/ | |
// overriding dms/dms/less/pl-structure.less | |
body.display-boxed #site .boxed-wrap .pl-area.makestuffinsidefullwidth .pl-area-wrap > .pl-content { | |
padding-left: 0px; | |
padding-right: 0px; | |
} | |
body.display-full #site .pl-area.makestuffinsidefullwidth .pl-content { | |
max-width: none; | |
} |
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 remove_post_thumbnail($metadata, $object_id, $meta_key, $single){ | |
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() ) | |
return false; | |
else | |
return $metadata; | |
} | |
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4); |
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 | |
class Section_Overide { | |
function __construct() { | |
add_filter( 'pagelines_render_section', array( $this, 'section_overide' ), 10, 2 ); | |
} | |
function section_overide( $s, $class ) { | |
NewerOlder