Skip to content

Instantly share code, notes, and snippets.

View code-flow's full-sized avatar
😆
happy

Florian code-flow

😆
happy
View GitHub Profile
@code-flow
code-flow / my-add-stars-to-comments.php
Last active August 29, 2015 13:56
Adds a star to WordPress comments (using the WP-Comment-Rating Plugin) that have more than 5 upvotes.
<?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 August 29, 2015 13:56
Example WordPress plugin to hook into the 'wpbcr_shortcode_best_comments_sql' filter of the WP-Comment Rating Plugin by WP-Buddy
<?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 August 29, 2015 13:56
Example WordPress plugin that shows the best comments based on the ratings for the WP-Comment Rating Plugin by WP-Buddy
<?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 April 23, 2014 06:49
Purple Heart to Pages as Shortcode
<?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 July 7, 2014 07:11
Fixed Social Share Icons AddOn (Example)
<?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.
<?php
namespace floriansimeth\cli;
use WP_CLI\Formatter;
if ( ! defined( 'ABSPATH' ) ) {
die();
}
@code-flow
code-flow / countdown-import-helper.php
Created May 3, 2017 07:40
Correct import behaviour when WPAllImport is used.
<?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 09:14
Rich Snippets WordPress Plugin Global Snippet Permissions
<?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 / the-events-calendar-json-deactivation.php
Created October 3, 2018 08:26
This plugin deactivates JSON+LD outpout of the "The Events Calendar" plugin.
<?php
/*
Plugin Name: The Events Calendar JSON+LD Deactivation
Description: This plugin deactivates JSON+LD outpout of the "The Events Calendar" plugin.
Version: 0.1.0
Author: Florian Simeth
Author URI: https://rich-snippets.io
License: GPLv2 or later
*/
@code-flow
code-flow / snip-rest-capabilities.php
Created October 10, 2018 04:36
Changes the standard capabilities to access SNIPs REST API to a different value.
<?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