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
add_filter( 'gform_currencies', 'cameronjonesweb_round_gravity_forms_currencies' ); | |
function cameronjonesweb_round_gravity_forms_currencies( $currencies ) { | |
foreach ( $currencies as $key => $val ) { | |
$currencies[ $key ]['decimals'] = 0; | |
} | |
return $currencies; | |
} |
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_action( 'init', 'rewrites' ); | |
add_filter( 'post_type_link', 'filter_post_link', 1, 2 ); | |
function rewrites() { | |
add_rewrite_tag( '%artist%', '([^/]+)' ); | |
add_rewrite_rule( | |
'songs/([^/]+)/([^/]+)?$', | |
'index.php?artist=$matches[1]&songs=$matches[2]', | |
'top' |
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
{ | |
"basics": { | |
"name": "Cameron Jones", | |
"label": "WordPress Developer", | |
"picture": "https://secure.gravatar.com/avatar/95d0c3a6511821a3f93807930a329cbb", | |
"email": "cameron@cameronjonesweb.com.au", | |
"phone": "0428 785 391", | |
"website": "https://cameronjonesweb.com.au", | |
"summary": "", | |
"location": { |
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 | |
/** | |
* Generates the post type labels | |
* | |
* @param string $single Singular name of the post type. | |
* @param string $plural Plural name of the post type. | |
* @param array $overrides Override any generated labels. | |
* @return array The post type labels | |
*/ | |
function cameronjonesweb_generate_post_type_labels( $single, $plural, $overrides = [] ) { |
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; | |
}); |
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
/* | |
Skin Name: Default | |
Author: Cameron Jones | |
Author URI: https://cameronjonesweb.com.au | |
*/ |
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 | |
$styles = [ | |
'color' => '#f00', | |
'background' => '#fff', | |
]; | |
cameronjonesweb_generate_style_attribute( $styles ); |
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_action( 'init', 'cameronjonesweb_remove_button_from_notice_setup' ); | |
function cameronjonesweb_remove_button_from_notice( $message ) { | |
$message = preg_replace('#<(a)(?:[^>]+)?>.*?</\1>#s', '', $message ); | |
return $message; | |
} | |
function cameronjonesweb_remove_button_from_notice_setup() { | |
$notice_types = apply_filters( 'woocommerce_notice_types', [ 'error', 'success', 'notice' ] ); |
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 | |
$string = 'Hello world!'; | |
$phrase = 'He'; | |
if ( strpos( $string, $phrase ) ) { | |
// This code won't run. | |
} | |
if ( cameronjonesweb_string_contains_phrase( $string, $phrase ) ) { | |
// This code will run. |