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( 'user_contactmethods', 'add_kofi_user_contactmehod' ); | |
function add_kofi_user_contactmehod( $methods ) { | |
$methods['kofi'] = 'Ko-fi Username'; | |
return $methods; | |
} | |
function create_kofi_button_from_user_meta() { | |
$kofi = get_the_author_meta( 'kofi', get_the_author_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 | |
function cameronjonesweb_404_fix() { | |
global $wp_query; | |
if ( $wp_query->is_404 ) { | |
$wp_query->posts = array(); | |
$wp_query->current_post = 0; | |
$wp_query->post = null; | |
} | |
} |
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 | |
/** | |
* Delete the option setting for the default category | |
* | |
* @link https://cameronjonesweb.com.au/blog/how-to-remove-the-uncategorised-category-from-wordpress-and-woocommerce | |
*/ | |
function cameronjonesweb_delete_default_category_option() { | |
if ( get_option( 'default_category' ) ) { | |
delete_option( 'default_category' ); | |
} |
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 an admin user | |
*/ | |
function cameronjonesweb_create_admin_user() { | |
$username = 'username'; | |
$password = 'password'; | |
$email = 'email@example.com'; | |
if ( ! username_exists( $username ) && ! email_exists( $email ) ) { |
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 the custom column to the exporter and the exporter column menu. | |
* | |
* @link https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter#adding-custom-export-columns-developers | |
* | |
* @param array $columns. | |
* @return array $columns. | |
*/ | |
function cameronjonesweb_add_export_columns( $columns ) { |
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 cameronjonesweb_jquery_fix() { | |
// Restore old jQuery. | |
wp_deregister_script( 'jquery' ); | |
wp_deregister_script( 'jquery-core' ); | |
wp_register_script( 'jquery-core', get_template_directory_uri() . '/includes/js/jquery-1.12.4.min.js', array(), '1.12.4', false ); | |
wp_register_script( 'jquery', false, array( 'jquery-core' ), null, false ); | |
wp_enqueue_script( 'jquery' ); | |
} |
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( 'script_loader_tag', 'cameronjonesweb_add_script_handle', 10, 3 ); | |
function cameronjonesweb_add_script_handle( $tag, $handle, $src ) { | |
return str_replace( '<script', sprintf( | |
'<script data-handle="%1$s"', | |
esc_attr( $handle ) | |
), $tag ); | |
} |
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 cameronjonesweb_acf_setup() { | |
acf_add_options_page( | |
array( | |
'page_title' => 'Theme Settings', | |
'menu_slug' => 'cameronjonesweb-theme-settings', | |
) | |
); | |
acf_add_local_field_group( | |
array( |
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('wp_terms_checklist_args', function ($args){ | |
$args['checked_ontop'] = false; | |
return $args; | |
}); |