Skip to content

Instantly share code, notes, and snippets.

Tim Carr n7studios

Block or report user

Report or block n7studios

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View comment-rating-field-pro-plugin-get-posts-sorted-by-rating.php
<?php
/**
* For developers who wish to get an array of Posts ordered by rating, highest to lowest, the
* below code can be used.
*
* @param array $args WP_Query compatible arguments
*/
if ( function_exists( 'get_posts_ordered_by_rating' ) ) {
$posts = get_posts_ordered_by_rating( array(
'post_type' => 'post',
View comment-rating-field-pro-plugin-get-post-rating-data.php
<?php
/**
* For developers who want to directly access the numerical rating data for a Post, the below
* functions can be used.
*/
/**
* Get the Post's Total Number of Ratings
*
* @param int $post_id Post ID
View comment-rating-field-pro-plugin-display-comment-rating.php
<?php
/**
* For developers and themes which do not make use of the WordPress wp_list_comments() function,
* the below code can be added.
*
* There must be a Field Group configured at Comment Rating Field Pro > Field Groups to display
* rating fields for the Post Type the visitor is viewing.
*/
if ( function_exists( 'display_comment_rating' ) ) {
echo display_comment_rating( $comment_text, $post_id, $comment_id );
View comment-rating-field-pro-plugin-display-post-rating.php
<?php
/**
* For developers who want to display a Post's rating in a specific place, and do not wish to
* use Shortcodes, the below code can be used.
*
* There must be a Field Group configured at Comment Rating Field Pro > Field Groups to display
* rating fields for the Post Type of the Post ID specified.
*/
if ( function_exists( 'display_average_rating' ) ) {
display_average_rating( array(
View comment-rating-field-pro-plugin-display-rating-fields.php
<?php
/**
* For developers and themes which do not make use of the WordPress comment_form() function,
* the below code can be added to your theme's comment form.
*
* There must be a Field Group configured at Comment Rating Field Pro > Field Groups to display
* rating fields for the Post Type the visitor is viewing.
*/
if ( function_exists( 'display_rating_fields' ) ) {
echo display_rating_fields();
View wp-dropdown-categories-aria-label.php
<?php
/**
* If the aria-label argument has been specified in a wp_dropdown_categories() call,
* output the aria-label option in the <select>
*
* @since 1.0.0
*
* @param string $output HTML Output
* @param array $arguments wp_dropdown_category() arguments
* @return string Modified HTML Output
View wordpress-add-title-to-iframe-oembed.php
<?php
/**
* Adds a title attribute to iframe oembeds
*
* @since 1.0.0
*
* @param string $html HTML
* @param string $url URL to embed
* @param array $attributes HTML Attributes
* @param int $post_id Post ID
@n7studios
n7studios / iframe-oembed.php
Created Jul 25, 2017
Add title attribute to WordPress iframe oembeds
View iframe-oembed.php
<?php
/**
* Adds a title attribute to iframe oembeds
*
* @since 1.0.0
*
* @param string $html HTML
* @param string $url URL to embed
* @param array $attributes HTML Attributes
* @param int $post_id Post ID
@n7studios
n7studios / wp-dropdown-categories-accessibility.php
Last active Jul 25, 2017
Add aria-label to wp_dropdown_categories()
View wp-dropdown-categories-accessibility.php
<?php
/**
* If the aria-label argument has been specified in a wp_dropdown_categories() call,
* output the aria-label option in the <select>
*
* @since 1.0.0
*
* @param string $output HTML Output
* @param array $arguments wp_dropdown_category() arguments
* @return string Modified HTML Output
@n7studios
n7studios / the-events-calendar-categories.php
Created May 25, 2017
The Events Calendar: Categories
View the-events-calendar-categories.php
<?php
/**
* Plugin Name: The Events Calendar: Categories
* Plugin URI: http://www.n7studios.co.uk
* Version: 1.0.0
* Author: n7 Studios
* Author URI: http://www.n7studios.co.uk
* Description: Register WordPress' Categories Taxonomies for The Events Calendar
*/
You can’t perform that action at this time.