Post-States

add_filter( ‘display_post_states’, ‘bu_style_post_state_bricks’, 15, 2 ); function bu_style_post_state_bricks ($post_states, $post) { if( isset( $post_states[‘bricks’] ) ) { if( current_user_can( ‘edit_posts’, $post->ID ) ) { $bricks_edit_link = get_permalink($post->ID) . ‘?bricks=run’; $post_states[‘bricks’] = ‘‘ . $post_states[‘bricks’] . ‘‘; } else { $post_states[‘bricks’]…Continue reading

Allow JS Files Upload

/** * Allow JS uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Allow CSS Files Upload

/** * Allow CSS uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Post class update

add_filter( ‘body_class’, function( $classes ) { $acc_type=tmwp_get_user_role(); if (!$acc_type) $acc_type=’anonymous’; return array_merge( $classes, array(‘acc-type-‘.strtolower($acc_type),tmwp_get_page_class()) ); } );Continue reading