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 | |
add_filter( 'get_pages', 'add_posts_to_frontpage_dropdown', 20, 2 ); | |
add_action( 'pre_get_posts', 'update_frontpage_post_query' ); | |
function add_posts_to_frontpage_dropdown( $pages, $r ) { | |
if ( array_key_exists( 'name', $r ) && 'page_on_front' == $r['name'] ) { | |
$args = [ | |
'post_type' => 'post', |
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 | |
/* Add LearnDash Enrolled Courses Grid to My Account Tab in WooCommerce */ | |
/* Add Courses Link to My Account menu */ | |
add_filter ( 'woocommerce_account_menu_items', 'wc_ld_link', 40 ); | |
function wc_ld_link( $menu_links ){ | |
$menu_links = array_slice( $menu_links, 0, 5, true ) | |
+ array( 'courses' => 'My Courses' ) | |
+ array_slice( $menu_links, 5, NULL, true ); |
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
#! /usr/bin/env ruby | |
# NOTE: Requires Ruby 2.1 or greater. | |
# This script can be used to parse and dump the information from | |
# the 'html/contact_info.htm' file in a Facebook user data ZIP download. | |
# | |
# It prints all cell phone call + SMS message + MMS records, plus a summary of each. | |
# | |
# It also dumps all of the records into CSV files inside a 'CSV' folder, that is created |
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
// WordPress Time Constants | |
MINUTE_IN_SECONDS = 60 (seconds) | |
HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS | |
DAY_IN_SECONDS = 24 * HOUR_IN_SECONDS | |
WEEK_IN_SECONDS = 7 * DAY_IN_SECONDS | |
MONTH_IN_SECONDS = 30 * DAY_IN_SECONDS | |
YEAR_IN_SECONDS = 365 * DAY_IN_SECONDS |
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
RewriteCond %{REQUEST_FILENAME} -s | |
RewriteRule ^wp-content/uploads/(.*)$ dl-file.php?file=$1 [QSA,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
######################################################################## | |
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024 | |
# ---------------------------------------------------------------------- | |
# @Author: Andreas Hecht | |
# @Author URI: https://seoagentur-hamburg.com | |
# License: GNU General Public License v2 or later | |
# License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
######################################################################## | |
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 | |
/* | |
* Get the Blog ID of the main site in a multisite network. | |
* | |
* @return int The blog_id of the main site. | |
*/ | |
function km_get_main_site_blog_id() { | |
return get_network()->site_id; | |
} |
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 | |
$parent_lesson_id = learndash_get_setting( $post, 'lesson' ); | |
$parent_lesson = get_post( $parent_lesson_id ); | |
?> |
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
#!/bin/bash -e | |
# Start allways the same | |
wpuser='yourusername' | |
wpuseremail='[email protected]' | |
wpuserpass=$(date +%s | sha256sum | base64 | head -c 16) | |
dpprefix=$(date +%s | sha256sum | base64 | head -c 6) | |
clear |