This file contains hidden or 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
| /* | |
| * jQuery('a').pluginName(); | |
| * or | |
| * jQuery('a').pluginName({ | |
| * className: 'alternative-class-name' | |
| * }); | |
| */ | |
| ;(function ( $, window, document ) { | |
| $.fn.pluginName = function( options ) { |
This file contains hidden or 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( 'transition_post_status', 'srf_publish_post_unique_date', 10, 3 ); | |
| function srf_publish_post_unique_date( $new_status, $old_status, $post ) { | |
| // only perform operation when post is | |
| // changing to a status of 'publish' | |
| // otherwise (abort) | |
| if ( 'publish' !== $new_status ) { return; } |
This file contains hidden or 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 | |
| /* | |
| * Examples to add custom classes to Genesis WordPress Framework Markup when using HTML5 output | |
| */ | |
| add_action( 'genesis_setup', 'srf_add_cust_classes', 15 ); // Priority 15 ensures it runs after Genesis itself has setup. | |
| function srf_add_cust_classes() { | |
| add_filter( 'genesis_attr_site-inner', 'srf_attr_site_inner' ); | |
| add_filter( 'genesis_attr_content-sidebar-wrap', 'srf_attr_content_sidebar_wrap' ); | |
| add_filter( 'genesis_attr_content', 'srf_attr_content' ); | |
| add_filter( 'genesis_attr_sidebar-primary', 'srf_attr_sidebar_primary' ); |
This file contains hidden or 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
| // Note: This is an improved version provided by @laurentmuller in the comments below. | |
| // removes all data attributes from a target element | |
| // example: removeDataAttributes('#user-list'); | |
| function removeDataAttributes(target) { | |
| var $target = $(target); | |
| // Loop through data attributes. | |
| $.each($target.data(), function (key) { | |
| // Because each key is in camelCase, |
NewerOlder