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
// Remove the WooThemes Helper notice from the admin | |
add_action( 'init', 'uw_remove_woothemes_helper_nag' ); | |
function uw_remove_woothemes_helper_nag() { | |
remove_action( 'admin_notices', 'woothemes_updater_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
function add_image_insert_override($sizes){ | |
unset( $sizes['thumbnail']); | |
unset( $sizes['medium']); | |
unset( $sizes['large']); | |
return $sizes; | |
} | |
add_filter('intermediate_image_sizes_advanced', 'add_image_insert_override' ); |
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 prevent_category_reorder($args) { | |
$args['checked_ontop'] = false; | |
return $args; | |
} | |
add_filter('wp_terms_checklist_args','prevent_category_reorder'); |
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
/** FILTER THE TEXT, THEN EXECUTE A FUNCTION THAT USES THE FILTER **/ | |
add_filter( 'gettext', 'grab_text', 20, 3 ); | |
function grab_text( $translated_text, $text, $domain ) { | |
if ( $translated_text == 'Barcode' ) { | |
$translated_text = 'UPC'; | |
} | |
return $translated_text; | |
} |
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_action('admin_head', 'my_stuff'); | |
function my_stuff() { | |
echo '<style> | |
.nice-class { | |
border: 1px solid red; | |
} | |
</style>'; | |
} |
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
/* | |
CREATING A CUSTOM TIME TO READ FUNCTION BECAUSE WE'RE USING CUSTOM POST FIELDS | |
---------------------------------------------------------------------------------------------------- */ | |
add_shortcode('my-custom-readtime', 'reading_time'); | |
function reading_time() { | |
global $post; | |
$content = get_post_field( 'post_content', $post->ID ); | |
$content .= types_render_field('field_name', array( "id"=>$post->ID) ); | |
$content .= types_render_field('field_name', array( "id"=>$post->ID) ); // Add more fields as needed |
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
/** | |
* This will allow you to grab the output of an existing shortcode (you're probably already using) | |
* and execute the shortcodes you're using inside of it. | |
*/ | |
function my_function_name ( $output, $tag ) { | |
if ( 'existing_shortcode_name' != $tag ) { | |
return $output; | |
} | |
$output = do_shortcode($output); | |
return $output; |
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
/** | |
* Configure the Date and Time Automatic Entry | |
* | |
*/ | |
new GW_Populate_Date( array( | |
'form_id' => 9, | |
'target_field_id' => 111, | |
'format' => 'mdYHis' | |
) ); |
OlderNewer