Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
// Remove WooCommerce Theme Support admin message
add_theme_support( 'woocommerce' );
@danielmcclure
danielmcclure / style.scss
Created May 22, 2019 02:39 — forked from seothemes/style.scss
Gravity Forms SCSS
/* ## Gravity Forms
--------------------------------------------- */
.gform_heading,
.gform_body,
.gform_footer {
clear: both;
}
.gform_heading {
<?php
$args = array(
'label' => '', // Text in Label
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '', // if empty, retrieved from post meta where id is the meta_key
'id' => '', // required
'name' => '', //name will set from id if empty
/**
* Remove the "nofollow" attribute from all comments author's links
* except for a specific author.
*/
function dofollow_blog_author_comment( $return, $author ) {
if ( $author === 'Your Name' ) {
$return = str_replace( "rel='external nofollow ugc'", '', $return );
}
return $return;
@danielmcclure
danielmcclure / remove-custom-post-type-slug-from-permalinks.php
Last active October 5, 2024 17:48 — forked from kellenmace/remove-custom-post-type-slug-from-permalinks.php
Remove custom post type slug from permalinks in WordPress
<?php
// Safely Remove CPT slugs from your CPT permalinks.
// Note: Replace CPT_NAME with your CPT name.
/**
* Remove the slug from published post permalinks. Only affect our custom post type, though.
*/
function m3_remove_cpt_slug( $post_link, $post ) {
if ( 'CPT_NAME' === $post->post_type && 'publish' === $post->post_status ) {
@danielmcclure
danielmcclure / learndash-code-in-answer.php
Created July 13, 2020 03:45 — forked from tradesouthwest/learndash-code-in-answer.php
LearnDash cloze answer accept case sensitive
<?php
/**
* LearnDash filter to prevent converting answer values to lowercase
*
* @possibly use ld_adv_quiz_pro_ajax()
* @uses stripslashes( strtolower( trim( $userResponse ) ) ) Default
* @since 1.0
* @from WpProQuiz_View_FrontQuiz.php
* post_type=sfwd-quiz
*/
@danielmcclure
danielmcclure / sf-pro-filter-input-object.php
Created February 6, 2024 23:01 — forked from rmorse/sf-pro-filter-input-object.php
Search & Filter Pro - Filter Input Object
<?php
function filter_input_object($input_object, $sfid)
{
//ensure we are only filtering the correct field name - in this case the field we want to filter has the name `_sfm_colours`
//we also want to make sure its a `select` input type we're filtering
if(($input_object['name']!='_sfm_colours')||($input_object['type']!='select'))
{
return $input_object;
}