This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function replace_nbsp_in_posts() { | |
global $wpdb; | |
$query = " | |
UPDATE {$wpdb->posts} | |
SET post_content = REPLACE(post_content, CHAR(160), ' ') | |
WHERE post_content LIKE '%" . chr(160) . "%' | |
"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_remove_decimals_from_course_points( $output, $atts ) { | |
if ( isset( $atts['show'] ) && $atts['show'] == 'course_points' ) { | |
// Remove decimal points by casting to an integer | |
$output = intval( $output ); | |
} | |
return $output; | |
} | |
add_filter( 'learndash_course_info', 'custom_remove_decimals_from_course_points', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the function to customize user profile fields | |
function customize_user_profile_fields() { | |
?> | |
<style type="text/css"> | |
/* Remove optional fields from the user profile page */ | |
#your-profile .form-table:first-of-type, | |
#your-profile h3:first-of-type, | |
#your-profile .user-nickname-wrap, | |
#your-profile .user-url-wrap, | |
#your-profile .user-display-name-wrap, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require( 'fs' ); | |
const path = require( 'path' ); | |
const themeJsonPath = path.join( __dirname, 'theme.json' ); | |
const themeJson = fs.readFileSync( themeJsonPath ); | |
const theme = JSON.parse( themeJson ); | |
const { palette } = theme.settings.color; | |
const colors = palette.reduce(( acc, item ) => { | |
const [color, number] = item.slug.split( '-' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display specific ACF groups on selected sites only for Multisite. | |
if ( is_multisite() ) : | |
add_filter( 'acf/location/rule_types', 'acf_location_rule_type_multisite' ); | |
add_filter( 'acf/location/rule_values/site', 'acf_location_rule_values_multisites' ); | |
add_filter( 'acf/location/rule_match/site', 'acf_location_rules_match_site', 10, 3 ); | |
endif; | |
function acf_location_type_multisite( $choices ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create the WordPress rewrite rule to handle third level slugs for videos. | |
* | |
*/ | |
function video_cpt_generating_rule( $wp_rewrite ) { | |
$rules = []; | |
$terms = get_terms( [ | |
'taxonomy' => 'series', | |
'hide_empty' => false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Populate ACF select field options with Gravity Forms form ID | |
*/ | |
function acf_populate_gf_forms_ids( $field ) { | |
if ( class_exists( 'GFFormsModel' ) ) { | |
$choices = []; | |
foreach ( \GFFormsModel::get_forms() as $form ) { | |
$choices[ $form->id ] = $form->title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Show all posts based on taxonomy meta key. | |
* | |
* @return WP_Query $courses New WP_Query containing courses. | |
*/ | |
function display_posts_taxonomy_order() { | |
$term_args = array( | |
'taxonomy' => 'discipline', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* File search.js | |
* | |
* Scroll to div on load. | |
* | |
*/ | |
const divToScroll = document.getElementById( 'scroll-here' ); | |
document.addEventListener( 'DOMContentLoaded', function ( event ) { |
NewerOlder