Customise the WordPress gallery html layout

I find a solution for this: // Customise the WordPress gallery html layout add_filter(‘post_gallery’,’customFormatGallery’,10,2); function customFormatGallery($string,$attr){ $output = “<div class=\”mihan-gallery\”>”; $posts = get_posts(array(‘include’ => $attr[‘ids’],’post_type’ => ‘attachment’)); foreach($posts as $imagePost){ $output .= “<a class=\”mihangitem\” href=”https://wordpress.stackexchange.com/questions/384853/”.wp_get_attachment_image_src($imagePost->ID,”mihan-large’)[0].”‘><img src=”https://wordpress.stackexchange.com/questions/384853/”.wp_get_attachment_image_src($imagePost->ID,”mihan-medium’)[0].”‘></a>”; } $output .= “<div class=\”clear\”></div></div>”; return $output; }

Redirect User Role When on Specific Page

You can achieve your goal this way: // Block Access to /wp-admin function mwd_redirect_if_on_page() { if ( is_user_logged_in() && is_admin() && current_user_can( ‘contributor’ ) && (defined( ‘DOING_AJAX’ ) && !DOING_AJAX) ) ) { wp_redirect( home_url(‘specific-page’) ); exit; } } add_action( ‘init’, ‘mwd_redirect_if_on_page’ ); If you carefully see I’ve added ajax check. This way contributor won’t … Read more

Add custom css file after plugin css with WordPress Child Theme functions.php

The original stylesheet is enqueued as openpos.bill.bootstrap wp_enqueue_style(‘openpos.bill.bootstrap’, OPENPOS_URL.’/assets/css/bootstrap.css’) // load my custom css after this one But you’ve set openpos.bill.style as the dependency: wp_enqueue_style(‘bill-screen-style’, get_stylesheet_directory_uri() . ‘/include-parts-from-functions-php-file/frontend-related/plugins/openpos-plugin/pos-app/css/bill-screen-style.css’,array(‘openpos.bill.style’)); These need to be the same.

Gutenberg block don’t save rich text content

Short Answer: When saving an attribute, always respect the attribute type. So if your attribute is of the array type, then save the value as an array, e.g. props.setAttributes( { innerContent: [ content ] } ). Longer Answer Your register_block_type() call is missing the editor_script parameter. See the block editor handbook for details, but basically, … Read more