Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
happy

Florian code-flow

💭
happy
View GitHub Profile
@code-flow
code-flow / my-add-stars-to-comments.php
Last active Aug 29, 2015
Adds a star to WordPress comments (using the WP-Comment-Rating Plugin) that have more than 5 upvotes.
View my-add-stars-to-comments.php
<?php
/*
Plugin Name: Add stars to comments
Description: Adds stars to comments when comment gets 10 up-votes
*/
add_filter( 'wpbcr_output_elements', 'my_wpbcr_output_elements', 10, 2 );
function my_wpbcr_output_elements( $elements, $comment ) {
@code-flow
code-flow / my-shortcode-ranking-filter.php
Last active Aug 29, 2015
Example WordPress plugin to hook into the 'wpbcr_shortcode_best_comments_sql' filter of the WP-Comment Rating Plugin by WP-Buddy
View my-shortcode-ranking-filter.php
<?php
/*
Plugin Name: My Shortcode Ranking Filter for WP-Comment Rating Plugin
Description: Hooks into the sql filter of the WP-Comment-Rating and allows the usage of the shortcode like this: [wpbcr_comment_ranking do="filter_by_xy_meta"]
*/
add_filter( 'wpbcr_shortcode_best_comments_sql', 'my_wpbcr_shortcode_best_comments_sql', 10, 6 );
/**
@code-flow
code-flow / my-shortcode-ranking-filter-comment-template.php
Last active Aug 29, 2015
Example WordPress plugin that shows the best comments based on the ratings for the WP-Comment Rating Plugin by WP-Buddy
View my-shortcode-ranking-filter-comment-template.php
<?php
/*
Plugin Name: My Shortcode Ranking Filter with comment template for WP-Comment Rating Plugin
Description: Displays the best comments with the template
*/
/*
* IMPORTANT: Only works for PHP >= 5.3 AND WP-Comment Rating >= 1.3
*/
@code-flow
code-flow / purple-heart-to-pages-as-shortcode.php
Created Apr 23, 2014
Purple Heart to Pages as Shortcode
View purple-heart-to-pages-as-shortcode.php
<?php
/*
Plugin Name: Purple Heart to Pages as Shortcode
*/
add_action( 'wp', 'add_phrating_to_pages', 10 );
function add_phrating_to_pages() {
global $post, $wpb_purpleheart;
@code-flow
code-flow / fss-add-icons.php
Created Jul 7, 2014
Fixed Social Share Icons AddOn (Example)
View fss-add-icons.php
<?php
/*
Plugin Name: Fixed Social Share Icons AddOn (Example)
Description: Adds more social icons to the Fixed WordPress Social Share Button
Version: 1.0
*/
/**
* Adds the icons in the style.css definition to the list of icons.
View class-csv-import.php
<?php
namespace floriansimeth\cli;
use WP_CLI\Formatter;
if ( ! defined( 'ABSPATH' ) ) {
die();
}
@code-flow
code-flow / countdown-import-helper.php
Created May 3, 2017
Correct import behaviour when WPAllImport is used.
View countdown-import-helper.php
<?php
/*
Plugin Name: Countdown Import Helper
Description: Correct import behaviour when WPAllImport is used.
Version 0.1.0
*/
add_action( 'pmxi_saved_post', 'cdih_save_post', 10, 1 );
@code-flow
code-flow / snip-permissions.php
Created May 11, 2018
Rich Snippets WordPress Plugin Global Snippet Permissions
View snip-permissions.php
<?php
/*
Plugin Name: snip permission configuration
Plugin URL: https://rich-snippets.io/global-snippet-permissions/
Description: Set correct permission to user roles.
Version: 0.1.0
Author: wpbuddy
Author URI: https://wp-buddy.com
*/
@code-flow
code-flow / snip-rest-capabilities.php
Created Oct 10, 2018
Changes the standard capabilities to access SNIPs REST API to a different value.
View snip-rest-capabilities.php
<?php
/*
Plugin Name: snip - REST API Capability Changer
Plugin URI: https://rich-snippets.io/global-snippets-capabilities/
Description: Changes the standard capabilities to access SNIPs REST API to a different value.
Version: 0.1.0
Author: floriansimeth
Author URI: https://florian-simeth.de
License: License: GPLv2 or later
View snip-woocommerce-review-args.php
<?php
/*
Plugin Name: snip - WooCommerce review args
Plugin URI: https://rich-snippets.io/woocommerce-review-args-hook/
Description: Changes arguments on WooCommerce reviews
Version: 0.1.0
License: License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {