Change WordPress user roles and capabilities › Forums › How to or FAQ › How to hide content via css › Reply To: How to hide content via css
27/11/2019 at 14:34
#6156
Vladimir
Keymaster
You may use URE Pro additional options using code below as a starting point:
// Additional options for URE
// Hide parts of front-end page for selected role
add_filter( 'ure_role_additional_options', 'ure_add_change_front_end_css', 10, 1 );
function ure_add_change_front_end_css( $items ) {
$item = URE_Role_Additional_Options::create_item( 'change_front_end_css', esc_html__('Change Front-end CSS', 'user-role-editor'), 'init', 'change_front_end_css_init' );
$items[$item->id] = $item;
return $items;
}
function change_front_end_css_init() {
wp_enqueue_script( 'jquery' );
add_action( 'wp_footer', 'ure_change_front_end_css' );
}
function ure_change_front_end_css() {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
// jQuery('#header').hide();
jQuery('.header-inner').hide();
});
</script>
<?php
}