Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel McClure danielmcclure

View GitHub Profile
@danielmcclure
danielmcclure / learndash-code-in-answer.php
Created Jul 13, 2020 — forked from tradesouthwest/learndash-code-in-answer.php
LearnDash cloze answer accept case sensitive
View learndash-code-in-answer.php
<?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 / functions.php
Created May 23, 2020
Remove Post Links from WordPress Dashboard
View functions.php
<?php
// Remove Posts from Dashboard Sidebar
function m3_post_remove () {
remove_menu_page('edit.php');
}
add_action('admin_menu', 'm3_post_remove'); //adding action for triggering function call
// Remove Posts from Admin Menu
function m3_remove_wp_nodes() {
View remove-custom-post-type-slug-from-permalinks.php
<?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 ) {
View functions.php
/**
* 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 / m3-custom-functionality.php
Created Sep 24, 2019
M3 Custom Functionality Plugin Header for WordPress
View m3-custom-functionality.php
<?php
/**
* M3 Custom Functionality
*
* @package M3CustomFunctionality
* @author Daniel McClure
* @copyright Copyright (c) 2019, Daniel McClure
* @license GPL-2.0+
*
* @wordpress-plugin
@danielmcclure
danielmcclure / wp-config.php
Created Sep 17, 2019
Sentry.io Settings for WP Config
View wp-config.php
<?php
/**
* Sentry.io Settings for WP Config
* Enables features and settings for the WordPress Sentry plugin for Sentry.io
* Plugin URI: https://wordpress.org/plugins/wp-sentry-integration/
*/
// Delete and customise as appropriate, replacing _YOUR_DSN_ with you actual DSN from Sentry.io
define( 'WP_SENTRY_DSN', '_YOUR_DSN_' ); // Enable PHP Tracker
View checkbox_input.php
<?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
@danielmcclure
danielmcclure / functions.php
Created Jul 23, 2019
Suppress all Genesis microdata/schema output
View functions.php
<?php
// Suppress all Genesis microdata/schema output
add_filter( 'genesis_disable_microdata', '__return_true' );
@danielmcclure
danielmcclure / style.scss
Created May 22, 2019 — forked from seothemes/style.scss
Gravity Forms SCSS
View style.scss
/* ## Gravity Forms
--------------------------------------------- */
.gform_heading,
.gform_body,
.gform_footer {
clear: both;
}
.gform_heading {
@danielmcclure
danielmcclure / wp-config.php
Created May 2, 2019
Settings that Block Updates for WordPress Sites
View wp-config.php
<?php
/**
* Settings that Block Updates for WordPress Sites
*/
// Disable Live File Editing
define( 'DISALLOW_FILE_MODS', true );
// Disable Automatic WordPress Updates
define( 'WP_AUTO_UPDATE_CORE', false );
You can’t perform that action at this time.