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( 'facetwp_facet_render_args', 'your_function_name' ); | |
// General example | |
function your_function_name( $args ){ | |
if ( 'name_of_facet_wp_filter' == $args['facet']['name'] ) { | |
foreach ( $args['values'] AS $key => $value ) { | |
// insert logic for changing the label / display value | |
$args['values'][$key]['facet_display_value'] = 'label name'; | |
} | |
} |
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 | |
/* Change filename and extension to lowercase */ | |
add_action('add_attachment', 'hip_rename_attachment'); | |
function hip_rename_attachment( $post_ID ){ | |
$post = get_post( $post_ID ); | |
$file = get_attached_file( $post_ID ); | |
$path = pathinfo( $file ); | |
$newfile = $path['dirname']."/".strtolower( $path['filename'] ).'.'.strtolower( $path['extension'] ); |