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
| // Debouncer | |
| (function($,sr){ | |
| // debouncing function from John Hann | |
| // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ | |
| var debounce = function (func, threshold, execAsap) { | |
| var timeout; | |
| return function debounced () { | |
| var obj = this, args = arguments; |
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
| /** | |
| * Display time since post was published | |
| * | |
| * @uses human_time_diff() Return time difference in easy to read format | |
| * @uses get_the_time() Get the time the post was published | |
| * @uses current_time() Get the current time | |
| * | |
| * @return string Timestamp since post was published | |
| * | |
| * @author c.bavota |
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
| /** | |
| * Add and extra class to the entry-content div | |
| * | |
| */ | |
| function jw_entry_content_class( $attributes ) { | |
| if ( is_tax( $taxonomy ) ) | |
| $attributes['class'] .= $class_to_add; | |
| return $attributes; |
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
| *~ | |
| .DS_Store | |
| .svn | |
| .cvs | |
| *.bak | |
| *.swp | |
| Thumbs.db | |
| # wordpress specific | |
| wp-config.php |
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( 'genesis_before', 'prefix_remove_entry_header' ); | |
| /** | |
| * Remove Entry Header | |
| */ | |
| function prefix_remove_entry_header() | |
| { | |
| if ( ! is_front_page() ) { 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 namespace Plugin\Models; | |
| use Plugin\Helper; | |
| class MemberMapper | |
| { | |
| public function sync_members( $post_id ) | |
| { | |
| $admins = get_users( array( 'role' => 'administrator', 'fields' => 'ID' ) ); |
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 | |
| $url = 'https://luminous-landscape.com/wp-json/posts?filter[posts_per_page]=4'; | |
| get_recent_posts( $url ); | |
| function get_recent_posts( $url ) { | |
| $json = file_get_contents($url); | |
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
| // Check if user_login already exists before we force update | |
| if ( ! username_exists( $username ) ) { | |
| // Force update user_login and user_nicename | |
| $tablename = $wpdb->prefix . "users"; | |
| $wpdb->update( $tablename, // Table to Update ( prefix_users ) | |
| array( | |
| 'user_login' => $username, // Data to Update ( user_login ) | |
| 'user_nicename' => $username // Data to Update ( user_nicename ) | |
| ), |
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
| hasOriginalUsername: function() { | |
| var illegalChars = new RegExp(/\W/); // allow letters, numbers, and underscores | |
| if ( illegalChars.test( this.originalUsername ) ) { | |
| return true; | |
| } else{ |
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 | |
| function prefix_get_post_type () { | |
| $args = array( | |
| 'post_type' => 'post_type', | |
| 'posts_per_page' => 10 | |
| ); | |
| // The Query | |
| $the_query = new WP_Query( $args ); | |
| // Create empty posts array | |
| $posts = array(); |