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 | |
| /** | |
| * A class for searching files and folders, also recursively. | |
| * | |
| * @package Pixelbart Gists | |
| * @author Pixelbart | |
| */ | |
| class PixelbartFinder { | |
| /** |
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 | |
| /** | |
| * Shortcode for displaying all posts with pro, order by pro count | |
| */ | |
| function helpful_pro_shortcode() { | |
| global $wpdb; | |
| $table_name = $wpdb->prefix . 'helpful'; |
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
| /** | |
| * Prüft ob der aktuelle Browser der Internet Explorer ist. | |
| * | |
| * @return boolean | |
| */ | |
| function is_ie() { | |
| if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { | |
| $ua = htmlentities( $_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8' ); | |
| if ( preg_match( '~MSIE|Internet Explorer~i', $ua ) || ( strpos( $ua, 'Trident/7.0' ) !== false && strpos( $ua, 'rv:11.0' ) !== false ) ) { | |
| return true; |
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
| /* Helpful */ | |
| .helpful {} | |
| /* Helpful: Users has already voted */ | |
| .helpful.helpful-exists {} | |
| /** | |
| * Headline | |
| */ |
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 | |
| /** | |
| * In this example you will learn how to add Helpful to an | |
| * existing Post Type (here FAQ), including its own heading. | |
| * | |
| * @package Helpful Example | |
| * @author Pixelbart | |
| */ | |
| $args = array( |
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 | |
| /** | |
| * Custom title tag in WordPress | |
| * | |
| * @author Kevin Pliester | |
| */ | |
| /** | |
| * Set custom title | |
| * |
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 | |
| /** | |
| * @author Kevin Pliester <me@pixelbart.de> | |
| */ | |
| /** | |
| * Der E-Mail-Empfänger. | |
| */ | |
| $email_receivers = [ 'meine@email.de' ]; |
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 related posts at the last position in the content. | |
| * URL to Plugin: https://de.wordpress.org/plugins/wordpress-23-related-posts-plugin/ | |
| * | |
| * @param string $content post content. | |
| * | |
| * @return string | |
| */ | |
| function my_related_posts( $content ) { |
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 | |
| /** | |
| * Class for custom post statuses | |
| */ | |
| class Custom_Status | |
| { | |
| protected $status, $labels, $post_type; | |
| /** | |
| * Set variables |
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
| (function($) { | |
| if( $('.wp-block-gallery, .wp-block-image').length ) { | |
| $(ukLightboxGallery); | |
| } | |
| function ukLightboxGallery() { | |
| $('.wp-block-gallery, .wp-block-image').attr('data-uk-lightbox', true); | |
| $('figure').each(function() { | |
| var src = $(this).find('img').attr('src'); |